text:
/**
 *
 */
function Column() {
    this.id = null;
    this.title = "列";
    this.parent = null; // parent Id
    this.currOwner = null; // form Id
    this.children = []; // children.
    this.className = "";
    this.classtypename = "Column";
    this.evn = 0; // environment: 0: design time; 1; runtime
};

Column.prototype = new UIComponent();

// for previewing
Column.prototype.clone = function () {
    var c = new Column();
    // c.id = this.id;
    // c.title = this.title;
    // c.parent = this.parent; // parent Id
    // c.currOwner = this.currOwner; // form Id
    // c.evn = this.evn; // environment: 0: design time; 1; runtime
    // c.toDomForHTML();
    // c.dom.className = this.dom.className;
    // c.dom.classList.remove("coledit", "coltitle");
    // for (var i = 0; i < this.children.length; i++) {
    //     var cln = this.children[i].clone();
    //     c.children.push(cln);
    //     c.dom.appendChild(cln.dom);
    // }
    return c;
};

Column.prototype.cloneRules = function (owner, old) {
    for (var i = 0; i < this.children.length; i++) {
        if (!(owner.children[i] instanceof Header)
            && !(owner.children[i] instanceof Paragraph)
            && !(owner.children[i] instanceof StaticList)
            && !(owner.children[i] instanceof Anchor)
            && !(owner.children[i] instanceof Image)
            && !(owner.children[i] instanceof FileDisplayer)
            && !(owner.children[i] instanceof FilesDisplayer)
            && !(owner.children[i] instanceof BarChart)
            && !(owner.children[i] instanceof PieChart)
            && !(owner.children[i] instanceof CurveChart)
            && !(owner.children[i] instanceof EarthMap)) {
            this.children[i].cloneRules(owner, old);
        }
    }
};

Column.prototype.addChild = function (child) {
    child.parent = this.id;
    child.currOwner = this.currOwner;
    this.children.push(child);
    //this.dom.appendChild(child.dom);
};

Column.prototype.insertChild = function (child, siblingId) {
    child.parent = this.id;
    child.currOwner = this.currOwner; // form Id
    var f = 0;
    var t = null;
    for (var i = 0; i < this.children.length; i++) {
        if (this.children[i].id == siblingId) {
            f = i;
            t = this.children[i];
            break;
        }
    }
    if (t != null) {
        this.children.splice(f, 0, child);
        this.dom.insertBefore(child.dom, t.dom);
    }
};

Column.prototype.removeChild = function (child) {
    for (var i = 0; i < this.children.length; i++) {
        if (this.children[i].id == child.id) {
            this.children.splice(i, 1);
            this.dom.removeChild(child.dom);
            break;
        }
    }
};

// 递归,先根遍历
Column.prototype.seekObjectByID = function (id) {
    var target = null;
    if (this.id == id) {
        target = this;
    } else if (this.children.length > 0) {
        for (var i = 0; i < this.children.length; i++) {
            if (this.children[i] instanceof Row) {
                target = this.children[i].seekObjectByID(id);
            } else if (this.children[i] instanceof CheckBoxes
                || this.children[i] instanceof Radios) {
                if (this.children[i].id == id) {
                    target = this.children[i];
                } else {
                    target = this.children[i].seekObjectByID(id);
                }
            } else if (this.children[i].id == id) {
                target = this.children[i];
            }
            if (target != null) {
                break;
            }
        }
    }
    return target;
};

// 递归,get the component list
Column.prototype.seekObjects = function () {
    var list = [];
    if (this.children.length > 0) {
        for (var i = 0; i < this.children.length; i++) {
            list.push(this.children[i]);
            if (this.children[i] instanceof Row) {
                list = list.concat(this.children[i].seekObjects());
            }
        }
    }
    return list;
};

Column.prototype.parseFromJSON = function (json, evn) {
    this.id = json.id;
    this.parent = json.parent; // parent Id
    this.title = json.title;
    this.currOwner = json.currOwner; // form Id
    this.className = json.className;
    this.parseChildrenFromJSON(json.children, evn);
};

Column.prototype.parseChildrenFromJSON = function (content, evn) {
    if (content != undefined && content != null && content.length > 0) {
        for (var i = 0; i < content.length; i++) {
            if (content[i].classtypename == "Row") {
                var r = new Row();
                r.parseFromJSON(content[i], evn);
                this.addChild(r);
            } else {
                if (content[i].classtypename == "SingleLineText") {
                    var r = new SingleLineText();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "SingleSelect") {
                    var r = new SingleSelect();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "MultipleLineText") {
                    var r = new MultipleLineText();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "CheckBoxes") {
                    var r = new CheckBoxes();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "Radios") {
                    var r = new Radios();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "Button") {
                    var r = new Button();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "LargeButton") {
                    var r = new LargeButton();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "ListSelect") {
                    var r = new ListSelect();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "Image") {
                    var r = new Image();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "FileUpload") {
                    var r = new FileUpload();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "Anchor") {
                    var r = new Anchor();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "Header") {
                    var r = new Header();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "Paragraph") {
                    var r = new Paragraph();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "StaticList") {
                    var r = new StaticList();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "PageableTableView") {
                    var r = new PageableTableView();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "TableView") {
                    var r = new TableView();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "IntegerInput") {
                    var r = new IntegerInput();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "NaturalNumberInput") {
                    var r = new NaturalNumberInput();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "CurrencyInput") {
                    var r = new CurrencyInput();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "DecimalsInput") {
                    var r = new DecimalsInput();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "DateTimeInput") {
                    var r = new DateTimeInput();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "DateTimeRangeInput") {
                    var r = new DateTimeRangeInput();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "FileDisplayer") {
                    var r = new FileDisplayer();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "FilesDisplayer") {
                    var r = new FilesDisplayer();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "FileUpload") {
                    var r = new FileUpload();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "BarChart") {
                    var r = new BarChart();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "CurveChart") {
                    var r = new CurveChart();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "PieChart") {
                    var r = new PieChart();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                } else if (content[i].classtypename == "EarthMap") {
                    var r = new EarthMap();
                    r.parseFromJSON(content[i], evn);
                    this.addChild(r);
                }
            }
        }
    }
};

Column.prototype.parseRules = function (owner) {
    // parsing some rules for column object
    // to do ...
    // parsing some children rules
    this.parseChildrenRules(owner);
};

Column.prototype.parseChildrenRules = function (owner) {
    if (this.children != undefined && this.children != null
        && this.children.length > 0) {
        for (var i = 0; i < this.children.length; i++) {
            if (this.children[i].classtypename == "SingleLineText"
                || this.children[i].classtypename == "SingleSelect"
                || this.children[i].classtypename == "MultipleLineText"
                || this.children[i].classtypename == "CheckBox"
                || this.children[i].classtypename == "Radio"
                || this.children[i].classtypename == "Button"
                || this.children[i].classtypename == "LargeButton"
                || this.children[i].classtypename == "ListSelect"
                || this.children[i].classtypename == "Image"
                || this.children[i].classtypename == "FileUpload"
                || this.children[i].classtypename == "Anchor"
                || this.children[i].classtypename == "IntegerInput"
                || this.children[i].classtypename == "NaturalNumberInput"
                || this.children[i].classtypename == "CurrencyInput"
                || this.children[i].classtypename == "DecimalsInput"
                || this.children[i].classtypename == "DateTimeInput"
                || this.children[i].classtypename == "DateTimeRangeInput") {
                this.children[i].parseExpressions(owner);
            }
        }
    }
};

Column.prototype.toDomForHTML = function (parent) {
    this.dom = document.createElement("DIV");
    parent.appendChild(this.dom);
    this.dom.id = this.id;
    //this.dom.style.height  = "100%";

    var classlist = this.className.split(" ");
    for (var i = 0; i < classlist.length; i++) {
        this.dom.classList.add(classlist[i]);
    }

    if (this.children.length > 0) {
        for (var i = 0; i < this.children.length; i++) {
            this.children[i].toDomForHTML(this.dom);
        }
    }
    return this.dom;
};

Column.prototype.toDom = function (parent) {
    this.dom = document.createElement("DIV");
    parent.appendChild(this.dom);
    this.dom.id = this.id;
    this.dom.className = "coledit coltitle ";
    this.dom.addEventListener('dragenter', this, false);
    this.dom.addEventListener('dragover', this, false);
    this.dom.addEventListener('dragleave', this, false);
    this.dom.addEventListener('drop', this, false);

    var classlist = this.className.split(" ");
    for (var i = 0; i < classlist.length; i++) {
        this.dom.classList.add(classlist[i]);
    }

    if (this.children.length > 0) {
        for (var i = 0; i < this.children.length; i++) {
            this.children[i].toDom(this.dom);
        }
    }

    return this.dom;
};

Column.prototype.handleEvent = function (e) {
    switch (e.type) {
        case "dragenter": // Events fired on the drop target
            this.doDragEnter(e);
            break;
        case "dragover": // Events fired on the drop target
            this.doDragOver(e);
            break;
        case "dragleave": // Events fired on the drop target
            this.doDragLeave(e);
            break;
        case "drop":// Events fired on the drop target
            this.doDrop(e);
            break;
    }
};

Column.prototype.doDragEnter = function (evt) {
    if (map[this.currOwner] != null
        && map[this.currOwner].currObject instanceof Form) {
        Utils.stopDefault(evt);
        bgcache = evt.target.style.backgroundColor;
        Utils.stopBubble(evt);
    }
};

Column.prototype.doDragOver = function (evt) {
    if (map[this.currOwner] != null
        && map[this.currOwner].currObject instanceof Form) {
        Utils.stopDefault(evt);
        evt.target.style.backgroundColor = Utils.highLight();
        evt.dataTransfer.dropEffect = evt.dataTransfer.effectAllowed;
        Utils.stopBubble(evt);
        return false;
    }
};

Column.prototype.doDragLeave = function (evt) {
    if (map[this.currOwner] != null
        && map[this.currOwner].currObject instanceof Form) {
        Utils.stopDefault(evt);
        evt.target.style.backgroundColor = bgcache;
        bgcache = null;
        Utils.stopBubble(evt);
    }
};

Column.prototype.doDrop = function (e) {
    if (map[this.currOwner] != null
        && map[this.currOwner].currObject instanceof Form) {
        Utils.stopDefault(e);
        e.target.style.backgroundColor = bgcache;
        bgcache = null;
        if (copyclip != null) {
            if (this.dom.children.length == 0) {
                if (e.dataTransfer.effectAllowed == "copy") { // create
                    this.newComponent(copyclip);
                } else if (e.dataTransfer.effectAllowed == "move") { // move
                    map[this.currOwner].stack.execute(new FMMoveLayoutNodeCmd(
                        this, copyclip, map[this.currOwner].currObject));
                } else if (e.dataTransfer.effectAllowed == "copyMove") {// copy+move

                }
            } else {
                var x = e.clientX
                    - (this.dom.getBoundingClientRect().left + this.dom.scrollLeft);
                var y = e.clientY
                    - (this.dom.getBoundingClientRect().top + this.dom.scrollTop);
                var t = null;
                var before = false;
                for (var i = 0; i < this.dom.children.length; i++) {
                    if (y < this.dom.children[i].getBoundingClientRect().top) {
                        before = true;
                        t = this.dom.children[i];
                        break;
                    }
                    if (y > this.dom.children[i].getBoundingClientRect().bottom) {
                        before = false;
                        break;
                    }
                }
                if (before) { // insert before
                    if (e.dataTransfer.effectAllowed == "copy") { // create
                        this.newInsertComponent(copyclip, t.nextSibling.id);
                    } else if (e.dataTransfer.effectAllowed == "move") { // move
                        map[this.currOwner].stack
                            .execute(new FMMoveBeforeLayoutNodeCmd(this, copyclip, t.id,
                                map[this.currOwner].currObject));
                    } else if (e.dataTransfer.effectAllowed == "copyMove") {// copy+move

                    }
                } else { // insert after
                    if (t != null && t.nextSibling != null) {
                        if (e.dataTransfer.effectAllowed == "copy") { // create
                            this.newInsertComponent(copyclip, t.nextSibling.id);
                        } else if (e.dataTransfer.effectAllowed == "move") {// move
                            map[this.currOwner].stack
                                .execute(new FMMoveBeforeLayoutNodeCmd(
                                    this, copyclip, t.nextSibling.id,
                                    map[this.currOwner].currObject));
                        } else if (e.dataTransfer.effectAllowed == "copyMove") {// copy+move

                        }
                    } else {
                        if (e.dataTransfer.effectAllowed == "copy") { // create
                            this.newComponent(copyclip);
                        } else if (e.dataTransfer.effectAllowed == "move") {// move
                            map[this.currOwner].stack
                                .execute(new FMMoveLayoutNodeCmd(this, copyclip,
                                    map[this.currOwner].currObject));
                        } else if (e.dataTransfer.effectAllowed == "copyMove") {// copy+move

                        }
                    }
                }
            }
            copyclip = null;
        }
        Utils.stopBubble(e);
    }
};

Column.prototype.newComponent = function (copyclip) {
    var that = this;
    if (copyclip instanceof CheckBoxes || copyclip instanceof Radios) {
        $.getJSON(service.api(27), {num: "4"}).complete(function (data) {
            var ids = JSON.parse(data.responseText);
            copyclip.id = ids[0];
            copyclip.children[0].id = ids[1];
            copyclip.children[1].id = ids[2];
            copyclip.children[2].id = ids[3];
            map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
        });
    } else if (copyclip instanceof Row) {
        if (copyclip.children.length == 1) {
            $.getJSON(service.api(27), {num: "2"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
            });
        } else if (copyclip.children.length == 2) {
            $.getJSON(service.api(27), {num: "3"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
            });
        } else if (copyclip.children.length == 3) {
            $.getJSON(service.api(27), {num: "4"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                copyclip.children[2].id = ids[3];
                map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
            });
        } else if (copyclip.children.length == 4) {
            $.getJSON(service.api(27), {num: "5"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                copyclip.children[2].id = ids[3];
                copyclip.children[3].id = ids[4];
                map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
            });
        } else if (copyclip.children.length == 6) {
            $.getJSON(service.api(27), {num: "6"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                copyclip.children[2].id = ids[3];
                copyclip.children[3].id = ids[4];
                copyclip.children[4].id = ids[5];
                copyclip.children[5].id = ids[6];
                map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
            });
        }
    } else {
        $.getJSON(service.api(2)).complete(
            function (data) {
                copyclip.id = data.responseText;
                map[that.currOwner].stack.execute(new FMAppendNodeCmd(that, copyclip));
            });
    }
};

Column.prototype.newInsertComponent = function (copyclip, id) {
    var that = this;
    if (copyclip instanceof CheckBoxes || copyclip instanceof Radios) {
        $.getJSON(service.api(27), {num: "4"}).complete(function (data) {
            var ids = JSON.parse(data.responseText);
            copyclip.id = ids[0];
            copyclip.children[0].id = ids[1];
            copyclip.children[1].id = ids[2];
            copyclip.children[2].id = ids[3];
            map[that.currOwner].stack
                .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
        });
    } else if (copyclip instanceof Row) {
        if (copyclip.children.length == 1) {
            $.getJSON(service.api(27), {num: "2"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                map[that.currOwner].stack
                    .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
            });
        } else if (copyclip.children.length == 2) {
            $.getJSON(service.api(27), {num: "3"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                map[that.currOwner].stack
                    .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
            });
        } else if (copyclip.children.length == 3) {
            $.getJSON(service.api(27), {num: "4"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                copyclip.children[2].id = ids[3];
                map[that.currOwner].stack
                    .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
            });
        } else if (copyclip.children.length == 4) {
            $.getJSON(service.api(27), {num: "5"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                copyclip.children[2].id = ids[3];
                copyclip.children[3].id = ids[4];
                map[that.currOwner].stack
                    .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
            });
        } else if (copyclip.children.length == 6) {
            $.getJSON(service.api(27), {num: "6"}).complete(function (data) {
                var ids = JSON.parse(data.responseText);
                copyclip.id = ids[0];
                copyclip.children[0].id = ids[1];
                copyclip.children[1].id = ids[2];
                copyclip.children[2].id = ids[3];
                copyclip.children[3].id = ids[4];
                copyclip.children[4].id = ids[5];
                copyclip.children[5].id = ids[6];
                map[that.currOwner].stack
                    .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
            });
        }
    } else {
        $.getJSON(service.api(2)).complete(
            function (data) {
                copyclip.id = data.responseText;
                map[that.currOwner].stack
                    .execute(new FMInsertBeforeLayoutNodeCmd(that, copyclip, id));
            });
    }
};

Column.prototype.toTree = function () {
    return {
        id: this.id,
        text: this.title,
        icon: "fa fa-columns",
        data: "列|",
        children: this.toTreeChildren(),
    }
};

Column.prototype.toTreeChildren = function () {
    var children = [];
    for (var i = 0; i < this.children.length; i++) {
        children.push(this.children[i].toTree());
    }
    return children;
};

Column.prototype.fetchBoundComponents = function () {
    var coms = [];
    for (var i = 0; i < this.children.length; i++) {
        if (this.children[i].classtypename == "SingleLineText"
            || this.children[i].classtypename == "SingleSelect"
            || this.children[i].classtypename == "MultipleLineText"
            || this.children[i].classtypename == "StaticList"
            || this.children[i].classtypename == "Radios"
            || this.children[i].classtypename == "Paragraph"
            || this.children[i].classtypename == "ListSelect"
            || this.children[i].classtypename == "Image"
            || this.children[i].classtypename == "Header"
            || this.children[i].classtypename == "FileUpload"
            || this.children[i].classtypename == "Anchor"
            || this.children[i].classtypename == "IntegerInput"
            || this.children[i].classtypename == "NaturalNumberInput"
            || this.children[i].classtypename == "CurrencyInput"
            || this.children[i].classtypename == "DecimalsInput"
            || this.children[i].classtypename == "DateTimeInput"
            || this.children[i].classtypename == "DateTimeRangeInput") {
            if (this.children[i].varId != null) {
                coms.push(this.children[i]);
            }
        } else if (this.children[i].classtypename == "Row"
            || this.children[i] instanceof UIContainer) {
            coms = coms.concat(this.children[i].fetchBoundComponents());
        }
    }
    return coms;
};


text:
/**
 * Workflow processes
 */
@org.osgi.annotation.versioning.Version("1.10.4")
package com.adobe.acs.commons.workflow.process;

redpajama_set_name: RedPajamaGithub


text:
cmake_minimum_required(VERSION 3.4.0)

# CMake invokes the toolchain file twice during the first build, but only once
# during subsequent rebuilds. This was causing the various flags to be added
# twice on the first build, and on a rebuild ninja would see only one set of the
# flags and rebuild the world.
# https://github.com/android-ndk/ndk/issues/323
if(ARCBUILD_TOOLCHAIN_INCLUDED)
  return()
endif(ARCBUILD_TOOLCHAIN_INCLUDED)
set(ARCBUILD_TOOLCHAIN_INCLUDED 1)

# Touch toolchain variable to suppress "unused variable" warning.
# This happens if CMake is invoked with the same command line the second time.
if(CMAKE_TOOLCHAIN_FILE)
endif()

# Export configurable variables for the try_compile() command.
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES SDK_ROOT SDK_API_VERSION SDK_ARCH IOS_TARGET IOS_BITCODE XCODE_VERSION)

# select xcode version and get SDK_ROOT
if(NOT SDK_ROOT)
  find_program(XCODE_SELECT_COMMAND xcode-select)
  message(STATUS "XCODE_SELECT_COMMAND: ${XCODE_SELECT_COMMAND}")
  if(XCODE_SELECT_COMMAND)
    execute_process(COMMAND ${XCODE_SELECT_COMMAND} "-print-path"
      OUTPUT_VARIABLE SDK_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
  endif()
  if(SDK_ROOT MATCHES "/Library/Developer/CommandLineTools")
    message(STATUS "`xcode-select -print-path` returns \"${SDK_ROOT}\", which is not iOS toolchain directory!")
    unset(SDK_ROOT)
  endif()
  set(DEFAULT_XCODE_APP_ROOT "/Applications/Xcode.app/Contents/Developer")
  if(NOT SDK_ROOT AND EXISTS ${DEFAULT_XCODE_APP_ROOT})
    set(SDK_ROOT ${DEFAULT_XCODE_APP_ROOT})
  endif()
endif()
if(NOT SDK_ROOT)
  message(FATAL_ERROR "Please set SDK_ROOT variable to toolchain root directory (e.g. /Applications/Xcode8.0.app/Contents/Developer)")
endif()
message(STATUS "SDK_ROOT: ${SDK_ROOT}")

# find xcode version
if(NOT XCODE_VERSION)
  # xcodebuild -version
  if(EXISTS "${SDK_ROOT}/../version.plist")
    file(READ "${SDK_ROOT}/../version.plist" XCODE_VERSION)
    string(REGEX REPLACE "[ \t\r\n]" "" XCODE_VERSION "${XCODE_VERSION}")
    string(REGEX MATCH "<key>CFBundleShortVersionString</key><string>([0-9.]+)" XCODE_VERSION "${XCODE_VERSION}")
    string(REGEX MATCH "([0-9.]+)" XCODE_VERSION "${XCODE_VERSION}")
  else()
    message(FATAL_ERROR "${SDK_ROOT}/../version.plist does not existed!")
  endif()
endif()
message(STATUS "XCODE_VERSION: ${XCODE_VERSION}")

# Initialize compiler and linker flags
set(SDK_C_FLAGS)
set(SDK_CXX_FLAGS)
set(SDK_LINKER_FLAGS)
set(SDK_LINKER_FLAGS_EXE)

# hard set values
if(NOT SDK_ARCH)
  set(SDK_ARCH "armv7;armv7s;arm64;arm64e")
else()
  string(REPLACE " " ";" SDK_ARCH "${SDK_ARCH}") # Add support of arch's seperated by space
endif()
message(STATUS "SDK_ARCH: ${SDK_ARCH}")

# iOS target
if(SDK_ARCH MATCHES "^arm.*")
  set(IOS_TARGET "iPhoneOS")
  list(APPEND SDK_C_FLAGS -miphoneos-version-min=7.0 -ftree-vectorize -ffast-math)
  if(SDK_ARCH MATCHES "(armv7|armv7s)")
    list(APPEND SDK_C_FLAGS -mfloat-abi=softfp -mfpu=neon ) # Enable NEON for ARM
  endif()
elseif(SDK_ARCH MATCHES "(i386|i686|x86_64)")
  set(IOS_TARGET "iPhoneSimulator")
  list(APPEND SDK_C_FLAGS -mios-simulator-version-min=7.0)
  else()
  message(FATAL_ERROR "Unknown target architectures: SDK_ARCH=${SDK_ARCH}")
endif()
message(STATUS "IOS_TARGET: ${IOS_TARGET}")

# some internal values
set(IOS_DEVELOPER_ROOT "${SDK_ROOT}/Platforms/${IOS_TARGET}.platform/Developer")
set(OSX_TOOLCHAIN_ROOT "${SDK_ROOT}/Toolchains/XcodeDefault.xctoolchain")

# Target specific architectures for OS X.
set(CMAKE_OSX_ARCHITECTURES "${SDK_ARCH}" CACHE STRING "Build architectures for iOS")

# Specify the location or name of the OS X platform SDK to be used.
if(NOT SDK_API_VERSION)
  file(GLOB SDK_API_VERSION_SUPPORTED "${IOS_DEVELOPER_ROOT}/SDKs/*")
  list(SORT SDK_API_VERSION_SUPPORTED)
  # has compile error when using the oldest one (0)
  # clang: error: invalid version number in '-miphoneos-version-min=.sd'
  list(GET SDK_API_VERSION_SUPPORTED -1 CMAKE_OSX_SYSROOT)
  string(REGEX MATCH "([0-9.]+)\\.sdk" SDK_API_VERSION "${CMAKE_OSX_SYSROOT}")
  string(REPLACE ".sdk" "" SDK_API_VERSION "${SDK_API_VERSION}")
  string(REGEX MATCHALL "([0-9.]+)\\.sdk" SDK_API_VERSION_SUPPORTED "${SDK_API_VERSION_SUPPORTED}")
  string(REPLACE ".sdk" "" SDK_API_VERSION_SUPPORTED "${SDK_API_VERSION_SUPPORTED}")
  message(STATUS "SDK_API_VERSION available: ${SDK_API_VERSION_SUPPORTED}")
else()
  set(CMAKE_OSX_SYSROOT "${IOS_DEVELOPER_ROOT}/SDKs/${IOS_TARGET}${SDK_API_VERSION}.sdk")
endif()
message(STATUS "SDK_API_VERSION: ${SDK_API_VERSION}")
message(STATUS "CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT}")
set(CMAKE_OSX_SYSROOT "${CMAKE_OSX_SYSROOT}" CACHE PATH "Sysroot used for iOS support")
# Specify the minimum version of OS X on which the target binaries are to be deployed.
# CMAKE_OSX_DEPLOYMENT_TARGET # get from CMAKE_OSX_SYSROOT

# cross compiling setup
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_VERSION ${SDK_API_VERSION})
#set(CMAKE_SYSTEM_PROCESSOR arm) # optional

# platform flags
set(UNIX 1)
set(APPLE 1)
set(IOS 1)
if(SDK_ARCH MATCHES "^arm.*")
  set(ARM 1)
endif()

# root path
set(CMAKE_FIND_ROOT_PATH ${OSX_TOOLCHAIN_ROOT} ${IOS_DEVELOPER_ROOT} ${CMAKE_OSX_SYSROOT})
# only search the iOS sdks, not the remainder of the host filesystem
# search paths (for makefiles the first one might be switched to "NEVER")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# compiler
set(CMAKE_C_COMPILER   ${OSX_TOOLCHAIN_ROOT}/usr/bin/clang)
set(CMAKE_CXX_COMPILER ${OSX_TOOLCHAIN_ROOT}/usr/bin/clang++)
# include(CMakeForceCompiler)
# cmake_force_c_compiler(${CMAKE_C_COMPILER} Clang)
# cmake_force_cxx_compiler(${CMAKE_CXX_COMPILER} Clang)

# default to searching for frameworks first
set(CMAKE_FIND_FRAMEWORK FIRST)

# set up the default search directories for frameworks
set(CMAKE_SYSTEM_FRAMEWORK_PATH
  ${IOS_DEVELOPER_ROOT}/System/Library/Frameworks
  ${IOS_DEVELOPER_ROOT}/System/Library/PrivateFrameworks
  ${IOS_DEVELOPER_ROOT}/Developer/Library/Frameworks
  )

# RPATH is useless when cross compiling.
set(CMAKE_SKIP_RPATH ON)

# compiler and linker flags
# -v to print version
if(IOS_BITCODE)
  if(SDK_API_VERSION VERSION_GREATER "6.0" AND NOT XCODE_VERSION VERSION_LESS "7.0")
    list(APPEND SDK_C_FLAGS -fembed-bitcode) # enable bitcode when SDK>6.0 and xcode>=7.0
  else()
    message(FATAL_ERROR "No bitcode support for Xcode ${XCODE_VERSION} and iOS SDK ${SDK_API_VERSION}")
  endif()
endif()
# message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")
# https://stackoverflow.com/questions/16294842/how-to-disable-c-dead-code-stripping-in-xcode
# get all the symbols from the all archives
set(SDK_LINKER_FLAGS "-Wl,-all_load")

# combine
string(REPLACE ";" " " SDK_C_FLAGS          "${SDK_C_FLAGS}")
string(REPLACE ";" " " SDK_CXX_FLAGS        "${SDK_CXX_FLAGS}")
string(REPLACE ";" " " SDK_LINKER_FLAGS     "${SDK_LINKER_FLAGS}")
string(REPLACE ";" " " SDK_LINKER_FLAGS_EXE "${SDK_LINKER_FLAGS_EXE}")

# Set or retrieve the cached flags.
# This is necessary in case the user sets/changes flags in subsequent
# configures. If we included the Android flags in here, they would get
# overwritten.
set(CMAKE_C_FLAGS "" CACHE STRING "Flags used by the compiler during all build types.")
set(CMAKE_CXX_FLAGS "" CACHE STRING "Flags used by the compiler during all build types.")
set(CMAKE_ASM_FLAGS "" CACHE STRING "Flags used by the compiler during all build types.")
set(CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "Flags used by the linker during the creation of modules.")
set(CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "Flags used by the linker during the creation of dll's.")
set(CMAKE_EXE_LINKER_FLAGS "" CACHE STRING "Flags used by the linker.")

set(CMAKE_C_FLAGS             "${SDK_C_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS           "${SDK_C_FLAGS} ${SDK_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
set(CMAKE_ASM_FLAGS           "${SDK_C_FLAGS} ${CMAKE_ASM_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${SDK_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "${SDK_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS    "${SDK_LINKER_FLAGS} ${SDK_LINKER_FLAGS_EXE} ${CMAKE_EXE_LINKER_FLAGS}")

# vim:ft=cmake et ts=2 sts=2 sw=2:


text:
using MathNet.Numerics.LinearAlgebra;
using SharpNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace RockPaperScissors
{
    class Program
    {
        static string[] Names = new  string[] { "Rock", "Paper", "Scissors", "Lizard", "Spock" };

        static void Main(string[] args)
        {
            Network network = new Network(new HyperParameters
            {
                CostFunctionName = "CrossEntropyCost",
                Epochs = 290000, //try 20000
                MiniBatchSize = 3,
                LearningRate = 0.1,
                UseDropouts = true
            }, 5, 10, 5);

            network.OnSampleProcessed += Network_OnSampleProcessed;

            //Before Training
            Console.WriteLine("Before training");
            Console.WriteLine("===============\n");
            testRockPaperScissors(network);

            //Our training set is very small - basically it encodes the rock-paper-scissors rules: if paper, then scissors and so on.
            List<(Vector<double>, Vector<double>)> data = new List<(Vector<double>, Vector<double>)>
            {
                //rock, paper, scissors
                (makeRock(), makePaper()),
                (makePaper(), makeScissors()),
                (makeScissors(), makeRock()),
            };

            //Train the network
            setupObservation(network);
            network.Train(data, null);

            Console.WriteLine("\nAfter training");
            Console.WriteLine("==============\n");
            testRockPaperScissors(network);

            //Now train with Rock-Paper-Scissors-Lizard-Spock data
            //Our training set is very small - basically it encodes the rock-paper-scissors rules: if paper, then scissors and so on.
            data = new List<(Vector<double>, Vector<double>)>
            {
                //rock, paper, scissors
                (makeRock(), makePaper()),
                (makeRock(), makeSpock()),
                (makePaper(), makeScissors()),
                (makePaper(), makeLizard()),
                (makeScissors(), makeRock()),
                (makeScissors(), makeSpock()),
                (makeSpock(), makeLizard()),
                (makeSpock(), makePaper()),
                (makeLizard(), makeRock()),
                (makeLizard(), makeScissors()),
            };

            //Train the network
            setupObservation(network);
            network.Reset();
            network.Train(new HyperParameters { MiniBatchSize = 10 }, data, null);

            Console.WriteLine("\nAfter training");
            Console.WriteLine("==============\n");

            testRockPaperScissorsLizardSpock(network);

            Console.WriteLine();
        }

        private static void setupObservation(Network network)
        {
            Console.WriteLine("\nObserve Training?");
            Console.WriteLine("==================");
            Console.WriteLine("1....Observe samples");
            Console.WriteLine("2....Observe mini-batches");
            Console.WriteLine("0....No");
            Console.WriteLine("==================");
            Console.Write("]");
            var input = Console.ReadLine();
            int selection = 0;
            if (int.TryParse(input, out selection))
            {
                if (selection < 0)
                    selection = 0;
                else if (selection > 2)
                    selection = 2;
            }
            else
                selection = 0;
            switch (selection)
            {
                case 0:
                    network.OnSampleProcessed -= Network_OnSampleProcessed;
                    network.OnMiniBatchProcessed -= Network_OnSampleProcessed;
                    break;
                case 1:
                    network.OnSampleProcessed += Network_OnSampleProcessed;
                    Console.Clear();
                    break;
                case 2:
                    network.OnMiniBatchProcessed += Network_OnSampleProcessed;
                    Console.Clear();
                    break;
            }
        }

        private static void Network_OnSampleProcessed(object sender, NetworkInsightEventArgs e)
        {
            Console.CursorLeft = 0;
            Console.CursorTop = 0;
            Console.CursorVisible = false;
            for (int i = 0; i < e.WeightList.Count; i++)
            {
                Console.WriteLine("\nLayer " + i);
                Console.WriteLine("-------");

                if (e.WeightList[i] == null)
                {
                    Console.Write(" (");
                    for (int j = 0; j < e.BiasList[i].Count; j++)
                        Console.Write(string.Format("{0: 000.000;-000.000}{1} ", e.BiasList[i][j], j < e.BiasList[i].Count - 1 ? "," : ")\n"));
                }
                else
                {
                    Console.Write(" ");
                    for (int j = 0; j < e.WeightList[i].RowCount; j++)
                    {
                        Console.Write(string.Format("{0: 000.000;-000.000} ", e.BiasList[i][j]));
                        Console.Write("|");
                        for (int k = 0; k < e.WeightList[i].ColumnCount; k++)
                            Console.Write(string.Format("{0: 000.000;-000.000}{1} ", e.WeightList[i][j,k], k < e.WeightList[i].ColumnCount - 1 ? "," : "|\n"));
                    }
                }
            }
            Console.CursorVisible = true;
        }

        static string convertToName(Vector<double> result)
        {
            return Names[result.MaximumIndex()];
        }
        static string toString(Vector<double> vector, int length)
        {
            if (length == 3)
                return string.Format("({0:0.00}, {1:0.00}, {2:0.00})", vector[0], vector[1], vector[2]);
            else
                return string.Format("({0:0.00}, {1:0.00}, {2:0.00}, {3:0.00}, {4:0.00})", vector[0], vector[1], vector[2], vector[3], vector[4]);
        }
        static  void testRockPaperScissors(Network network, int length = 3)
        {
            Console.WriteLine(string.Format("{0,32}  {1} {2} {3}  {4}", "Rock", "Paper", "Scis.", (length != 3? "Liz.": ""), (length != 3? "Spock" : "")));
            Console.WriteLine(string.Format("{0,32}  {1} {2} {3} {4}", "-----", "-----", "-----", (length != 3? "-----": ""), (length != 3? "-----": "")));
            var result = network.Detect(makeRock());
            Console.WriteLine(string.Format("{0,10} ---> {1,-10} {2}" , "Rock", convertToName(result), toString(result, length)));
            result = network.Detect(makePaper());
            Console.WriteLine(string.Format("{0,10} ---> {1,-10} {2}", "Paper", convertToName(result), toString(result, length)));
            result = network.Detect(makeScissors());
            Console.WriteLine(string.Format("{0,10} ---> {1,-10} {2}", "Scissors", convertToName(result), toString(result, length)));
        }
        static void testRockPaperScissorsLizardSpock(Network network)
        {
            testRockPaperScissors(network, 5);
            var result = network.Detect(makeLizard());
            Console.WriteLine(string.Format("{0,10} ---> {1,-10} {2}", "Lizard", convertToName(result), toString(result, 5)));
            result = network.Detect(makeSpock());
            Console.WriteLine(string.Format("{0,10} ---> {1,-10} {2}", "Spock", convertToName(result), toString(result, 5)));
        }
        static Vector<double> makeRock()
        {
           return CreateVector.DenseOfArray<double>(new double[] { 1, 0, 0, 0, 0 });
        }
        static Vector<double> makePaper()
        {
            return CreateVector.DenseOfArray<double>(new double[] { 0, 1, 0, 0, 0});
        }
        static Vector<double> makeScissors()
        {
           return CreateVector.DenseOfArray<double>(new double[] { 0, 0, 1, 0, 0});
        }
        static Vector<double> makeLizard()
        {
            return CreateVector.DenseOfArray<double>(new double[] { 0, 0, 0, 1, 0 });
        }
        static Vector<double> makeSpock()
        {
            return CreateVector.DenseOfArray<double>(new double[] { 0, 0, 0, 0, 1 });
        }
    }
}


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>Markdown Plugin : revIgniter User Guide</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="robots" content="all" />
		<meta name="author" content="Ralf Bitter" />
		<meta name='description' content='revIgniter User Guide' />

		<link rel="stylesheet" media="screen" href="../css/bootstrap.min.css">

		<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../images/apple-touch-icon-144-precomposed.png">
		<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../images/apple-touch-icon-114-precomposed.png">
		<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../images/apple-touch-icon-72-precomposed.png">
		<link rel="apple-touch-icon-precomposed" href="../images/apple-touch-icon-57-precomposed.png">

          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

          </button>
    			revIgniter User Guide Version 1.7.1

          <form class="navbar-form navbar-right" role="search" method="get" action="http://www.google.com/search">

 				<input type="hidden" name="as_sitesearch" id="as_sitesearch" value="revigniter.com/userGuide/" />
 		        Search User Guide   <input type="search" placeholder="Search ..." name="q" id="q" class="revignitorsearch" accesskey="s" autosave="bsn_srch" results="5" />
 				 <input type="image" id="submitSearch" src="../images/searchGo.png" alt="Search Go Button" />

 		 	 		</form>

revIgniter Home

User Guide Home

Markdown Plugin

Table of Contents Page

Table of Contents

Close

Markdown Plugin

The Markdown Plugin, contributed by Andre Alves Garzia, contains functions dealing with "Markdown", a software tool written in Perl, that converts plain text (formatted with the Markdown syntax) to structurally valid XHTML (or HTML). Please read about Markdown at Daring Fireball.

Loading this Plugin

This plugin is loaded using the following code:

rigLoadPlugin "markdown"

The functions:

rigMarkdownAvailable()

Use this function to check if the Markdown engine (Markdown.pl) is available.

if rigMarkdownAvailable() then
	# Code...
end if

This function returns true or false.

rigMarkdownVersion()

This function, you guessed it, returns the version of the installed Markdown engine.

rigMarkdown(<var>pPlainText</var>, <var>pHTML4Flag</var>)

This function is a wrapper for the Markdown engine to convert plain text to structurally valid XHTML (or HTML).
The first parameter is a string formatted with the Markdown syntax. The optional second parameter is a boolean which configures Markdown to produce HTML 4 output. Defaults to FALSE (XHTML).

if rigMarkdownAvailable() then
	put rigMarkdown(tMDstring) into gData["mdOutput"]
end if

This converts Markdown formatted plain text to XHTML.

	Previous Topic:  Galleria Plugin
	 ::
	Top of Page ::
	User Guide Home ::
	Next Topic:  QueryToJson Plugin

revIgniter :: Copyright © 2009 - 2015 :: dimensionB Bitter u. Bitter GmbH


text:
cookbook_copyright "Chris Kottom"
cookbook_license   "mit"
cookbook_email     "chris@chriskottom.com"


text:
/* NOTE: This file is autogenerated, do not edit this file directly.*/

#include <Foundation/Foundation.h>

/**
 * Formating mode (for dates/numbers)
 *
 */

typedef NS_ENUM(NSInteger, TRFormatSyntax)
{
	/**
	 * Use C standard library methods (default locale)
	 */
	TR_FORMATSYNTAX_CSTDLIB,

	/**
	 * Use platform methods (platform default locale)
	 */
	TR_FORMATSYNTAX_PLATFORM

};

typedef enum TRFormatSyntax TRFormatSyntax;

/**
 * Get the size (element count) of the TRFormatSyntax enum.
 *
 * @return The number of elements.
 */

static inline NSInteger TRFormatSyntax_size(void)
{
	return 2;
}

/**
 * Get the name of a given member of the TRFormatSyntax enum.
 *
 * @param value The enum value.
 * @return The name (as per source code), or "?" if an invalid value is provided.
 */

static inline NSString * TRFormatSyntax_name(TRFormatSyntax value)
{
	switch(value) {
	case TR_FORMATSYNTAX_CSTDLIB:
		return @"TR_FORMATSYNTAX_CSTDLIB";
	case TR_FORMATSYNTAX_PLATFORM:
		return @"TR_FORMATSYNTAX_PLATFORM";
	default:
		return @"?";
	}
}


text:
'use strict'
/* global describe, it */
const assert = require('assert')

describe('Province Model', () => {
  it('should exist', () => {
    assert(global.app.api.models['Province'])
  })
})


text:
class BookingsController < ApplicationController
  before_action :authenticate_user!
  before_action :set_booking, only: [:destroy]

  # POST /boookings
  # POST /bookings.json
  def create
    @booking = Booking.new(booking_params)
    @booking.user_id = current_user.id

    conversation = current_user.send_message(recipients, booking_params[:message][:body], booking_params[:message][:subject]).conversation

    respond_to do |format|
      if @booking.save
        format.html { redirect_to dash_path, notice: 'Request was successfully created.' }
        format.json { render :show, status: :created, location: @booking }
      else
        format.html { render :new }
        format.json { render json: @booking.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /bookings/1
  # DELETE /bookings/1.json
  def destroy
    @booking.destroy
    respond_to do |format|
      format.html { redirect_to dash_path notice: 'Request was successfully deleted.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_booking
      @booking = current_user.bookings.find(params[:id])
       rescue ActiveRecord::RecordNotFound
        flash[:notice] = "not authorized"
        redirect_to :action => 'index'
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def booking_params
      params[:booking].permit(:event_id, :message)
    end
end


text:
define([  "elaiJS/helper"],
          function(helper) {
	'use strict';
  var self = {};

  self.extractGetParams = function (test) {
    var params = helper.extractGetParams();

    this.assertEq("helper", params.module);
    this.done();
  };

  self.extractParamsEmpty = function () {
    var params = helper.extractParams("");
    this.assertEq(0, Object.keys(params).length);
    this.done();
  };

  self.extractParamsValueEmpty = function () {
    var params = helper.extractParams("test");
    this.assertEq(1, Object.keys(params).length);
    this.assertUndefined(params.test);
    this.done();
  };

  self.extractParams = function () {
    var params = helper.extractParams("earth=life&love=inconditional");
    this.assertEq("life", params.earth);
    this.assertEq("inconditional", params.love);
    this.assertEq(2, Object.keys(params).length);
    this.assertUndefined(params.test);
    this.done();
  };

  self.extractParamsTrim = function () {
    var paramsStr = " earth =  life    & love= inconditional  ";
    var params = helper.extractParams(paramsStr, true);
    this.assertEq("life", params.earth);
    this.assertEq("inconditional", params.love);
    this.assertEq(2, Object.keys(params).length);
    this.assertUndefined(params.test);
    this.done();
  };

  self.extractArrayEmpty = function () {
    var array = helper.extractArray();
    this.assertEq(0, array.length);
    this.done();
  };

  self.extractArrayStringEmpty = function () {
    var array = helper.extractArray("");
    this.assertEq("", array[0]);
    this.assertEq(1, array.length);
    this.done();
  };

  self.extractArrayStringEmptyTrim = function () {
    var array = helper.extractArray(" ");
    this.assertEq(" ", array[0]);
    this.assertEq(1, array.length);

    array = helper.extractArray(" ", true);
    this.assertEq("", array[0]);
    this.assertEq(1, array.length);

    this.done();
  };

  self.extractArray = function () {
    var array = helper.extractArray("earth,life,love,inconditional");
    this.assertEq("earth", array[0]);
    this.assertEq("life", array[1]);
    this.assertEq("love", array[2]);
    this.assertEq("inconditional", array[3]);
    this.assertEq(4, array.length);
    this.done();
  };

  self.extractArrayTrim = function () {
    var array = helper.extractArray(" earth,  life,    love, inconditional  ", true);
    this.assertEq("earth", array[0]);
    this.assertEq("life", array[1]);
    this.assertEq("love", array[2]);
    this.assertEq("inconditional", array[3]);
    this.assertEq(4, array.length);
    this.done();
  };

  self.isNotFunction = function () {
    this.assertFalse(helper.isFunction(42));
    this.assertFalse(helper.isFunction(undefined));
    this.assertFalse(helper.isFunction(null));
    this.assertFalse(helper.isFunction("test"));
    this.assertFalse(helper.isFunction({}));
    this.assertFalse(helper.isFunction({test: "test"}));
    this.done();
  };

  self.isFunction = function () {
    var func = function() {};
    this.assertTrue(helper.isFunction(function() {}));
    this.assertTrue(helper.isFunction(func));
    this.done();
  };

  self.isNotObject = function () {
    this.assertFalse(helper.isObject(42));
    this.assertFalse(helper.isObject(undefined));
    this.assertFalse(helper.isObject("test"));
    this.assertFalse(helper.isObject(null));
    this.assertFalse(helper.isObject(function() {}));
    this.done();
  };

  self.isObject = function () {
    this.assertTrue(helper.isObject({}));
    this.assertTrue(helper.isObject({love: 42}));
    this.done();
  };

  self.getElaiJSAttribute = function () {
    this.assertEq("42", helper.getElaiJSAttribute("test"));
    this.assertEq("false", helper.getElaiJSAttribute("debug"));
    this.done();
  };

  self.clone = function() {
    var obj = {test: 42, love: "inconditional"};
    var cloneObj = helper.clone(obj);
    this.assertEq(obj.test, cloneObj.test);
    this.assertEq(obj.love, cloneObj.love);

    obj.test = 41;
    cloneObj.love = function() { };

    obj.onlyOrigine = true;
    cloneObj.onlyClone = true;

    this.assertEq(41, obj.test);
    this.assertEq(42, cloneObj.test);

    this.assertEq("inconditional", obj.love);
    this.assertFalse(helper.isFunction(obj.love));
    this.assertTrue(helper.isFunction(cloneObj.love));

    this.assertUndefined(obj.onlyClone);
    this.assertTrue(obj.onlyOrigine);
    this.assertUndefined(cloneObj.onlyOrigine);
    this.assertTrue(cloneObj.onlyClone);

    this.done();
  };

  self.capitalize = function () {
    this.assertEq("Test", helper.capitalize("test"));
    this.assertEq("TEST", helper.capitalize("TEST"));
    this.assertEq("TEsT", helper.capitalize("tEsT"));
    this.assertEq("TEST", helper.capitalize("tEST"));
    this.assertEq("Testtest", helper.capitalize("testtest"));

    this.done();
  };

  self.equalsStrict = function() {
    this.assertTrue(helper.equals(undefined, undefined));
    this.assertTrue(helper.equals(null, null));
    this.assertTrue(helper.equals(42, 42));
    this.assertTrue(helper.equals("42", "42"));
    this.assertTrue(helper.equals(true, true));
    this.assertTrue(helper.equals(false, false));
    this.assertTrue(helper.equals({}, {}));
    this.assertTrue(helper.equals({love: 42}, {love: 42}));
    this.assertTrue(helper.equals({love: 42, hope: "happy"}, {love: 42, hope: "happy"}));
    this.assertTrue(helper.equals({love: 42, hope: "happy", sun:{42: "love"}},
                                  {love: 42, hope: "happy", sun:{42: "love"}}));
    this.assertTrue(helper.equals({love: 42, hope: "happy", sun:{42: "love", fun: {child : false}}},
                                  {love: 42, hope: "happy", sun:{42: "love", fun: {child : false}}}));

    this.assertFalse(helper.equals(42, "42"));
    this.assertFalse(helper.equals(1, true));
    this.assertFalse(helper.equals(false, 0));
    this.assertFalse(helper.equals({love: 42}, {love: 42, sun: undefined}));

    this.assertFalse(helper.equals(undefined, null));
    this.assertFalse(helper.equals(null, false));
    this.assertFalse(helper.equals(42, 43));
    this.assertFalse(helper.equals("42", "43"));
    this.assertFalse(helper.equals(true, false));
    this.assertFalse(helper.equals(false, undefined));
    this.assertFalse(helper.equals({}, undefined));
    this.assertFalse(helper.equals({love: 42}, {love: 43}));
    this.assertFalse(helper.equals({love: 42}, {love2: 42}));
    this.assertFalse(helper.equals({love: 42, hope: "happy"}, {love: 42, hope: "happi"}));
    this.assertFalse(helper.equals({love: 42, hope: "happy", sun:{42: "love"}},
                                  {love: 42, hope: "happy", sun:{43: "love"}}));
    this.assertFalse(helper.equals({love: 42, hope: "happy", sun:{42: "love", fun: {children: false}}},
                                  {love: 42, hope: "happy", sun:{42: "love", fun: {child : false}}}));

    this.done();
  };

  self.equalsNotStrict = function() {
    this.assertTrue(helper.equals(42, "42", false));
    this.assertTrue(helper.equals(1, true, false));
    this.assertTrue(helper.equals(false, 0, false));
    this.assertTrue(helper.equals({love: 42}, {love: 42, sun: undefined}, false));

    var objComplexe = {love: 42, sun: undefined, hope: "happy"};
    this.assertFalse(helper.equals({love: 42}, objComplexe, false));
    this.assertFalse(helper.equals(objComplexe, {love: 42}, false));

    this.assertTrue(helper.equals(objComplexe, {love: 42, hope: "happy"}, false));

    this.done();
  };

  self.isEmail = function() {
    this.assertFalse(helper.isEmail());
    this.assertFalse(helper.isEmail(""));
    this.assertFalse(helper.isEmail("love"));
    this.assertFalse(helper.isEmail("love@"));
    this.assertFalse(helper.isEmail("love@.dq"));
    this.assertFalse(helper.isEmail("love@love"));
    this.assertFalse(helper.isEmail("love@love."));
    this.assertFalse(helper.isEmail("@love.love"));

    this.assertTrue(helper.isEmail("love@love.love"));
    this.assertTrue(helper.isEmail("love@love.lovelove"));
    this.assertTrue(helper.isEmail("e@e.fr"));
    this.assertTrue(helper.isEmail("love42@love.love"));

    this.done();
  };

	return self;
});


text:
require 'rails_helper'

RSpec.describe 'sponsors/_sponsorships_active.html.haml', type: :view do
  let(:sponsorships_active) {build_stubbed_list :sponsorship, 3, active:true, orphan: build_stubbed(:orphan)}

  describe "active sponsorships exist" do
    before :each do
      render :partial => 'sponsors/sponsorships_active.html.haml', :locals => {sponsorships: sponsorships_active}
    end

    it "should show table title" do
      expect(rendered).to have_text "3 Currently Sponsored Orphans"
    end

    it "should show sponsorships and linked orphans details" do
      sponsorships_active.each do |sa|
        expect(rendered).to have_link(sa.orphan.name, href: orphan_path(sa.orphan))
        expect(rendered).to have_text(sa.orphan.date_of_birth)
        expect(rendered).to have_text(sa.orphan.gender)
        expect(rendered).to have_text(sa.start_date)
      end
    end

    it "should have End Sponsorship form" do
      expect(rendered).to have_button "End Sponsorship"
      expect(rendered).to have_css("input[type='text'][value='#{Date.current}']")
    end

    it "should have delete (X) button" do
      sponsorships_active.each do |sa|
        expect(rendered).to have_link "X", href: sponsorship_path(sa)
      end
    end
  end

  describe "active sponsorships do not exist" do
    before :each do
      render :partial => 'sponsors/sponsorships_active.html.haml', :locals => {sponsorships: []}
    end

    it "should show message" do
      expect(rendered).to have_text "0 Currently Sponsored Orphans"
    end
  end

end


text:
import PeyeonScript

class fusion(object):
	def __init__(self):
		self.sumshot = 0.0
		self.offset = 0

		self.fusion = PeyeonScript.scriptapp("Fusion")
		self.comp = self.fusion.GetCurrentComp()

	def loader(self, name, clip, x, y):
		self.comp.Lock()
		self.clip = self.comp.Loader({"Clip": clip})
		self.setPos(self.clip, x, y)
		if self.offset == 0:
			bg = self.comp.Background()
			self.setPos(bg,-1, +2) #tek bi tane lazim oldugu icin burada
			self.Merge(bg,self.clip,x,y+2)
		else:
			self.Merge(self.merge,self.clip,x,y+2)

		self.clip.SetAttrs({"TOOLS_Name": name})
		self.end = self.clip.ClipTimeEnd[1]
		if self.offset > 0:
			self.offSet()
		self.offset += 1
		self.sumShot(self.end)
		self.comp.Unlock()

	def Merge(self,bg,fg,x,y):
		self.merge = self.comp.Merge()
		self.setPos(self.merge,x,y)
		self.merge.Foreground = fg.Output
		self.merge.Background = bg.Output

	def setPos(self, obj, x, y):
		flow = self.comp.CurrentFrame.FlowView
		flow.SetPos(obj, x, y)

	def sumShot(self, s):
		self.sumshot += s+1

	def offSet(self):
		self.clip.GlobalOut[1] = self.sumshot
		self.clip.GlobalIn[1] = self.sumshot
		self.clip.HoldLastFrame[1] = 0
		self.clip.HoldFirstFrame[1] = 0
		self.clip.ClipTimeStart[1] = 0
		self.clip.ClipTimeEnd[1] = self.end

	def compStartEnd(self):
		self.comp.SetAttrs({"COMPN_GlobalStart": 0})
		self.comp.SetAttrs({"COMPN_GlobalEnd": self.sumshot-1})
		self.comp.SetAttrs({"COMPN_RenderStartTime": 0})
		self.comp.SetAttrs({"COMPN_RenderEndTime": self.sumshot-1})
		self.comp.SetAttrs({"COMPN_RenderStart":0})
		self.comp.SetAttrs({"COMPN_RenderEnd": self.sumshot-1})


text:
using System;
using System.Collections.Generic;

namespace simpleInk
{
    class RecognizerHelper
    {
        private static Dictionary<string, string> Bcp47ToRecognizerNameDictionary = null;

        private static void EnsureDictionary()
        {
            if (Bcp47ToRecognizerNameDictionary == null)
            {
                Bcp47ToRecognizerNameDictionary = new Dictionary<string, string>(StringComparer.CurrentCultureIgnoreCase);

                Bcp47ToRecognizerNameDictionary.Add("en-US", "Microsoft English (US) Handwriting Recognizer");
                Bcp47ToRecognizerNameDictionary.Add("en-GB", "Microsoft English (UK) Handwriting Recognizer");
                Bcp47ToRecognizerNameDictionary.Add("en-CA", "Microsoft English (Canada) Handwriting Recognizer");
                Bcp47ToRecognizerNameDictionary.Add("en-AU", "Microsoft English (Australia) Handwriting Recognizer");
                Bcp47ToRecognizerNameDictionary.Add("de-DE", "Microsoft-Handschrifterkennung - Deutsch");
                Bcp47ToRecognizerNameDictionary.Add("de-CH", "Microsoft-Handschrifterkennung - Deutsch (Schweiz)");
                Bcp47ToRecognizerNameDictionary.Add("es-ES", "Reconocimiento de escritura a mano en español de Microsoft");
                Bcp47ToRecognizerNameDictionary.Add("es-MX", "Reconocedor de escritura en Español (México) de Microsoft");
                Bcp47ToRecognizerNameDictionary.Add("es-AR", "Reconocedor de escritura en Español (Argentina) de Microsoft");
                Bcp47ToRecognizerNameDictionary.Add("fr", "Reconnaissance d'écriture Microsoft - Français");
                Bcp47ToRecognizerNameDictionary.Add("fr-FR", "Reconnaissance d'écriture Microsoft - Français");
                Bcp47ToRecognizerNameDictionary.Add("ja", "Microsoft 日本語手書き認識エンジン");
                Bcp47ToRecognizerNameDictionary.Add("ja-JP", "Microsoft 日本語手書き認識エンジン");
                Bcp47ToRecognizerNameDictionary.Add("it", "Riconoscimento grafia italiana Microsoft");
                Bcp47ToRecognizerNameDictionary.Add("nl-NL", "Microsoft Nederlandstalige handschriftherkenning");
                Bcp47ToRecognizerNameDictionary.Add("nl-BE", "Microsoft Nederlandstalige (België) handschriftherkenning");
                Bcp47ToRecognizerNameDictionary.Add("zh", "Microsoft 中文(简体)手写识别器");
                Bcp47ToRecognizerNameDictionary.Add("zh-CN", "Microsoft 中文(简体)手写识别器");
                Bcp47ToRecognizerNameDictionary.Add("zh-Hans-CN", "Microsoft 中文(简体)手写识别器");
                Bcp47ToRecognizerNameDictionary.Add("zh-Hant", "Microsoft 中文(繁體)手寫辨識器");
                Bcp47ToRecognizerNameDictionary.Add("zh-TW", "Microsoft 中文(繁體)手寫辨識器");
                Bcp47ToRecognizerNameDictionary.Add("ru", "Microsoft система распознавания русского рукописного ввода");
                Bcp47ToRecognizerNameDictionary.Add("pt-BR", "Reconhecedor de Manuscrito da Microsoft para Português (Brasil)");
                Bcp47ToRecognizerNameDictionary.Add("pt-PT", "Reconhecedor de escrita manual da Microsoft para português");
                Bcp47ToRecognizerNameDictionary.Add("ko", "Microsoft 한글 필기 인식기");
                Bcp47ToRecognizerNameDictionary.Add("pl", "System rozpoznawania polskiego pisma odręcznego firmy Microsoft");
                Bcp47ToRecognizerNameDictionary.Add("sv", "Microsoft Handskriftstolk för svenska");
                Bcp47ToRecognizerNameDictionary.Add("cs", "Microsoft rozpoznávač rukopisu pro český jazyk");
                Bcp47ToRecognizerNameDictionary.Add("da", "Microsoft Genkendelse af dansk håndskrift");
                Bcp47ToRecognizerNameDictionary.Add("nb", "Microsoft Håndskriftsgjenkjenner for norsk");
                Bcp47ToRecognizerNameDictionary.Add("nn", "Microsoft Håndskriftsgjenkjenner for nynorsk");
                Bcp47ToRecognizerNameDictionary.Add("fi", "Microsoftin suomenkielinen käsinkirjoituksen tunnistus");
                Bcp47ToRecognizerNameDictionary.Add("ro", "Microsoft recunoaştere grafie - Română");
                Bcp47ToRecognizerNameDictionary.Add("hr", "Microsoftov hrvatski rukopisni prepoznavač");
                Bcp47ToRecognizerNameDictionary.Add("sr-Latn", "Microsoft prepoznavač rukopisa za srpski (latinica)");
                Bcp47ToRecognizerNameDictionary.Add("sr", "Microsoft препознавач рукописа за српски (ћирилица)");
                Bcp47ToRecognizerNameDictionary.Add("ca", "Reconeixedor d'escriptura manual en català de Microsoft");
            }
        }

        public static string LanguageTagToRecognizerName(string bcp47tag)
        {
            EnsureDictionary();

            string recognizerName = string.Empty;
            try
            {
                recognizerName = Bcp47ToRecognizerNameDictionary[bcp47tag];
            }
            catch (KeyNotFoundException)
            {
                recognizerName = string.Empty;
            }

            return recognizerName;
        }
    }
}


text:
package com.chamber.java.library.model;

import com.facebook.crypto.CryptoConfig;

/**
 * Created by hafiq on 28/01/2018.
 */

public enum ChamberType {

    KEY_128(CryptoConfig.KEY_128),
    KEY_256(CryptoConfig.KEY_256);

    private CryptoConfig type;

    public CryptoConfig getConfig()
    {
        return this.type;
    }

    ChamberType(CryptoConfig x) {
        type = x;
    }
}


text:
from . import helpers
from . import constants
from .data_models import StrikeKit

kit_file = "layerb.skt"

# This function exists purely because VS Code can't collapse comment blocks.
# Ignore freely.

def doc_func():
    print("This function should never get called.")
    assert False
    """
    Samples section
    4 byte 'str '            - marks beginning of record
    2 byte str length        - bytes are swapped (c802 == 02c8 == 712)
    2 byte pad               - might be part of string length?
    """

def print_field(descriptor, data):
    print("{0}\t:{1}\tLength:{2}".format(descriptor, data, len(data)))

def parse_file(filepath):
    with open(kit_file, "rb") as f:
        raw_data = f.read()
        x = StrikeKit(raw_data)
        print(x)
        # header = f.read(header_size)
        # instruments = f.read(instrument_count * instrument_size)
        # samples = f.read()

        # parse_instruments(instruments)
        # print_kit_header(header)
        # print_field("Sample data", samples)

def print_kit_header(data):
    # KIT header
    kit_bytes = data[0:3]
    print_field("KIT Header", kit_bytes)
    # No idea. 0x202c (32,44)
    field0 = data[3:5]
    print_field("Pad bytes", field0)
    # Zero pad?
    pad0 = data[5:9]
    print_field("Zero pad", pad0)
    # 0x0063 - no idea - kit volume?
    field0 = data[9:11]
    # kitfx - reverb
    kitfx_reverb = data[11:15]
    print_field("Kit reverb", kitfx_reverb)

def parse_instruments(data):
    result = []
    for x in range(0, constants.INSTRUMENT_COUNT):
        start_index = x * constants.INSTRUMENT_SIZE
        end_index = start_index + constants.INSTRUMENT_SIZE
        instrument = data[start_index:end_index]
        result.append(instrument)
    return instrument

# parse_file(kit_file)


text:
package quuxhandler_test

import (
	"context"
	"testing"
	"time"

	"github.com/uber/zanzibar/examples/example-gateway/build/gen-code/endpoints-idl/endpoints/tchannel/quux/quux"
	ms "github.com/uber/zanzibar/examples/example-gateway/build/services/example-gateway/mock-service"

	// "github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	runtime "github.com/uber/zanzibar/runtime"
)

func TestEchoStringFixture(t *testing.T) {
	ms := ms.MustCreateTestService(t)
	ms.Start()
	defer ms.Stop()

	ms.MockClients().Quux.ExpectEchoString().Success().MinTimes(1)

	var result quux.SimpleService_EchoString_Result
	args := &quux.SimpleService_EchoString_Args{
		Msg: "echo",
	}

	_, _, err := ms.MakeTChannelRequest(context.Background(), "SimpleService", "EchoString", nil, args, &result,
		&runtime.TimeoutAndRetryOptions{
			OverallTimeoutInMs:           time.Duration(3000) * time.Millisecond,
			RequestTimeoutPerAttemptInMs: time.Duration(2000) * time.Millisecond,
			MaxAttempts:                  1,
			BackOffTimeAcrossRetriesInMs: runtime.DefaultBackOffTimeAcrossRetries,
		})
	require.NoError(t, err, "got tchannel error")
	assert.Equal(t, "echo", *result.Success)
}


text:
<?php

/*
|--------------------------------------------------------------------------
| Composer autoloader
|--------------------------------------------------------------------------
*/

require 'vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Library includes
|--------------------------------------------------------------------------
|
| The $lib_includes array determines the code library included in your
| theme. Add or remove files to the array as needed.
| Please note that missing files will produce a fatal error.
|
*/

$lib_includes = [
    'lib/init.php',                                 // Theme setup
    'lib/functions.php',                            // Standalone functions
    'lib/helpers/ParentTheme.php',
    'lib/helpers/ChildTheme.php',
    'lib/helpers/Storage.php',
    'lib/helpers/Category.php',
    'lib/helpers/Post.php',
    'lib/helpers/Tag.php',

    'lib/classes/instagram/instagram.class.php'     // Simple custom Instagram class
];

foreach ($lib_includes as $file) {
    require_once($file);
}
unset($file);

/*
|--------------------------------------------------------------------------
| Class aliases
|--------------------------------------------------------------------------
|
| Some classes - helper classes in most cases - are there to add
| functionality to theme templates. To avoid having to reference these
| classes by their full namespace (and/or original class name), you can
| create aliases for them. Add them here as needed.
|
*/

class_alias('\Roots\ParentTheme\Helpers\ParentTheme','ParentTheme');
class_alias('\Roots\ParentTheme\Helpers\ChildTheme','ChildTheme');
class_alias('\Roots\ParentTheme\Helpers\Storage','Storage');
class_alias('\Roots\ParentTheme\Helpers\Category','Category');
class_alias('\Roots\ParentTheme\Helpers\Post','Post');
class_alias('\Roots\ParentTheme\Helpers\Tag','Tag');

class_alias('\Roots\ParentTheme\Classes\Instagram','Instagram');


text:
package org.epri.pt2;

import java.io.File;

import org.epri.pt2.DO.DNP3ApplicationPacketDO;
import org.apache.commons.io.*;

import junit.framework.TestCase;

public class DNP3PacketReassemblyTest extends TestCase {

	File dnp3File;
	byte[] appData;
	byte[] packetData;

	DNP3ApplicationPacketDO dnp3AppPacket;

	protected void setUp() throws Exception {
		dnp3File = new File(ClassLoader.getSystemClassLoader().getResource("packets/81_byte_packet.bin").getPath());

		appData = FileUtils.readFileToByteArray(dnp3File);

		dnp3AppPacket = new DNP3ApplicationPacketDO();
		dnp3AppPacket.setData(appData);

		packetData = dnp3AppPacket.updatePacket();

		dnp3AppPacket.initialize();

		dnp3AppPacket.addData(packetData);
	}

	public void testIsValid() {
		//assertEquals(true, dnp3AppPacket.isAppPacket());
	}

	public void testIsValidPacket() {
		//assertEquals(true, packetData.length > 1077);
	}

	public void testPacketLength() {
		//assertEquals(1077, dnp3AppPacket.getData().length);
	}

//	public void testReassembly() {
//
//	}
}


text:
module('About Backbone.Collection');

test('Can add Model instances as objects and arrays.', function() {

    expect(3);

    var todos = new TodoList();
    equal(todos.length, 0);

    todos.add({ text: 'Clean the kitchen' });
    equal(todos.length, 1);

    todos.add([
        { text: 'Do the laundry', done: true },
        { text: 'Go to the gym'}
    ]);

    equal(todos.length, 3);
});

test('Can have a url property to define the basic url structure for all contained models.', function() {
    expect(1);
    var todos = new TodoList();
    equal(todos.url, '/todos/');
});

test('Fires custom named events when the models change.', function() {

    expect(2);
    var todos = new TodoList();

    var addModelCallback = this.spy();
    var removeModelCallback = this.spy();

    todos.bind('add', addModelCallback);
    todos.bind('remove', removeModelCallback);

    // How would you get the 'add' event to trigger?
    todos.add({text:"New todo"});

    ok(addModelCallback.called);

    // How would you get the 'remove' callback to trigger?
    todos.remove(todos.last());

    ok(removeModelCallback.called);

});


text:
from flask import *
app = Flask(__name__)
app.config['DEBUG'] = True

@app.route('/')
def main_route():
  options = { "message": "hello world" }
  return render_template("index.html", **options)

@app.route('/services')
def services_route():
	options = { "messages": "Hello services" }
	return render_template("services.html", **options)


text:
package com.example.rohan.droid_calorie.Model;

import java.lang.reflect.Array;
import java.util.ArrayList;

/**
 * Created by Rohan on 3/26/16.
 */
public class User {

    private String userName;
    private double bodyWeight;
    private String height;
    private double bmi;
    private String mealPlan;

    public User(){

    }

    public User(String userName, double bodyWeight, String height, double bmi, String mealPlan){
        this.userName = userName;
        this.bodyWeight = bodyWeight;
        this.height = height;
        this.bmi = bmi;
        this.mealPlan = mealPlan;
    }

    public static ArrayList<User> loadSampleUsers() {
        ArrayList<User> users = new ArrayList<>();
        User rohan = new User("Rohan Gorawala", 160, "5'9", 22.8, "cutting");
        User josh = new User("Josh Sexton", 198, "6'0", 22, "maintaining");
        User obama = new User("Barack Obama", 178, "5'10", 45, "bulking");
        users.add(rohan);
        users.add(josh);
        users.add(obama);
        return users;
    }

    @Override
    public String toString(){
        return userName;
    }

    public String getUserName(){
        return userName;
    }

    public void setUserName(String firstName){
        this.userName = firstName;
    }

    public double getBodyWeight(){
        return bodyWeight;
    }

    public void setBodyWeight(double bodyWeight){
        this.bodyWeight = bodyWeight;
    }

    public String getHeight(){
        return height;
    }

    public void setHeight(String height){
        this.height = height;
    }

    public double getBmi(){
        return bmi;
    }

    public void setBmi(double bmi){
        this.bmi = bmi;
    }

    public String getMealPlan(){
        return mealPlan;
    }

    public void setMealPlan(String mealPlan){
        this.mealPlan = mealPlan;
    }

}


text:
<?php defined('BX_DOL') or die('hack attempt');

define('BX_DEF_MENU_CUSTOM_ITEM_MORE_AUTO', 'more-auto');

class BxBaseMenuCustom extends BxTemplMenu
{
    protected static $_sTmplContentItem;

    protected $_sTmplNameCustomItemMore;
    protected $_sTmplNameCustomItemMorePopup;

    protected $_bMoreAuto;
    protected $_sJsObjectMoreAuto;

    protected $_aHtmlIds;

    public function __construct($aObject, $oTemplate = false)
    {
        parent::__construct($aObject, $oTemplate);

        if(empty(self::$_sTmplContentItem))
            self::$_sTmplContentItem = $this->_oTemplate->getHtml('menu_custom_item.html');

        $this->_sTmplNameCustomItemMore = 'menu_custom_item_more.html';
        $this->_sTmplNameCustomItemMorePopup = 'menu_custom_item_more_popup.html';

        $this->_bMoreAuto = false;
        $this->_sJsObjectMoreAuto = 'oMenuMoreAuto' . bx_gen_method_name($this->_sObject);

        $sPrefix = str_replace('_', '-', $this->_sObject);
        $this->_aHtmlIds = array(
            'more_auto_popup' => $sPrefix . '-ma-popup',
        );
    }

    public function getCode ()
    {
        $sResult = parent::getCode();

        if($this->_bMoreAuto)
            $this->_oTemplate->addJs(array('BxDolMenuMoreAuto.js'));

        return $sResult;
    }

    public function getMenuItems()
    {
        $aResult = parent::getMenuItems();

        $sItem = BX_DEF_MENU_CUSTOM_ITEM_MORE_AUTO;
        if(!empty($this->_aObject['menu_items'][$sItem]) && is_array($this->_aObject['menu_items'][$sItem]) && (int)$this->_aObject['menu_items'][$sItem]['active'] == 1)
            $this->_bMoreAuto = true;

        return $aResult;
    }

    protected function _getTemplateVars()
    {
        $aResult = array_merge(parent::_getTemplateVars(), array(
            'bx_if:show_more_auto_class' => array(
                'condition' => $this->_bMoreAuto,
                'content' => array()
            ),
            'js_code' => $this->_bMoreAuto ? $this->_getJsCodeMoreAuto() : ''
        ));

        return $aResult;
    }

    protected function _getJsCodeMoreAuto()
    {
        $aParams = array(
            'sObject' => $this->_sObject,
            'aHtmlIds' => $this->_aHtmlIds
        );
        return $this->_oTemplate->_wrapInTagJsCode("if(!" . $this->_sJsObjectMoreAuto . ") var " . $this->_sJsObjectMoreAuto . " = new BxDolMenuMoreAuto(" . json_encode($aParams) . "); " . $this->_sJsObjectMoreAuto . ".init();");
    }

    protected function _getMenuItem ($aItem)
    {
    	if (isset($aItem['active']) && !$aItem['active'])
            return false;

        if (isset($aItem['visible_for_levels']) && !$this->_isVisible($aItem))
            return false;

    	$sMethod = '_getMenuItem' . str_replace(' ', '', ucwords(str_replace('-', ' ', $aItem['name'])));

    	if(!method_exists($this, $sMethod)) {
            $aItem = parent::_getMenuItem($aItem);
            if($aItem === false)
                return false;

            $mixedItem = $this->_getMenuItemDefault($aItem);
    	}
    	else
            $mixedItem = $this->$sMethod($aItem);

    	if(empty($mixedItem))
            return false;

        $sItem = $sClass = '';
        if(is_array($mixedItem))
            list($sItem, $sClass) = $mixedItem;
        else
            $sItem = $mixedItem;

        if(!empty($sClass))
            $sClass = ' ' . $sClass;
        if($this->_isSelected($aItem))
            $sClass .= ' bx-menu-tab-active';

        return array(
            'name' => $aItem['name'],
            'class' => $sClass,
            'item' => $sItem
        );
    }

    protected function _getMenuItemMoreAuto ($aItem)
    {
        $aItem['onclick'] = $this->_sJsObjectMoreAuto . '.more(this);';

        $aItem = parent::_getMenuItem($aItem);
        if($aItem === false)
            return false;

        return $this->_oTemplate->parseHtmlByName($this->_getTmplNameItemMore(), array(
            'item' => $this->_getMenuItemDefault($aItem),
            'popup' => BxTemplFunctions::getInstance()->transBox($this->_aHtmlIds['more_auto_popup'], $this->_oTemplate->parseHtmlByName($this->_getTmplNameItemMorePopup(), array(
                'content' => ''
            )), true)
        ));
    }

    protected function _getMenuItemDefault ($aItem)
    {
        if(!isset($aItem['class_wrp']))
            $aItem['class_wrp'] = '';

        if(!isset($aItem['class_link']))
            $aItem['class_link'] = '';

        return $this->_oTemplate->parseHtmlByContent($this->_getTmplContentItem(), $aItem);
    }

    protected function _getTmplNameItemMore()
    {
        return $this->_sTmplNameCustomItemMore;
    }

    protected function _getTmplNameItemMorePopup()
    {
        return $this->_sTmplNameCustomItemMorePopup;
    }

    protected function _getTmplContentItem()
    {
        return self::$_sTmplContentItem;
    }
}

/** @} */


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>0 - 100 frågesportspelet där alla svaren är mellan noll till hundra!</title>

    <link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.min.css" type="text/css">

    <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Catamaran:100,200,300,400,500,600,700,800,900" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Muli" rel="stylesheet">

    <link rel="stylesheet" href="/css/animate.min.css" type="text/css">
    <link rel="stylesheet" href="/vendor/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/vendor/simple-line-icons/css/simple-line-icons.css">
    <link rel="stylesheet" href="/vendor/device-mockups/device-mockups.min.css">

    <link href="/css/main.css" rel="stylesheet">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation Menu
            </button>
            0 -100

                    Ladda ner

                    Kontakt

Hur man laddar ner 0-100

Sök efter "0-100 Powered by MIG" på Appstore eller Google Play.

We  new friends!

                Privacy

                Terms

                FAQ