text:
<?xml version="1.0" encoding="UTF-8"?>
<oval_definitions xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd      http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:ind-def="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5">
  <generator>
    <oval:schema_version>5.9</oval:schema_version>
    <oval:timestamp>2009-01-12T10:41:00-05:00</oval:timestamp>
    <terms_of_use>Copyright (c) 2002-2012, The MITRE Corporation. All rights reserved. The contents of this file are subject to the license described in terms.txt.</terms_of_use>
  </generator>
  <definitions>
    <definition id="oval:org.mitre.oval.test:def:169" version="1" class="miscellaneous">
      <metadata>
        <title>Evaluate to true if the float datatype is properly supported</title>
        <description>This definition is intended to evalutate to true if the interpreter properly supports the float datatype and all of its valid operations.</description>
      </metadata>
      <criteria operator="AND">
        <criteria operator="AND" comment="True if the equals operation is supported.">
          <criterion comment="Test that the equals operation is supported with an equal float value." test_ref="oval:org.mitre.oval.test:tst:1499"/>
          <criterion negate="true" comment="Test that the equals operation is supported with a unequal float value." test_ref="oval:org.mitre.oval.test:tst:1707"/>
        </criteria>
        <criteria operator="AND" comment="True if the not equal operation is supported.">
          <criterion negate="true" comment="Test that the not equal operation is supported with an equal float value." test_ref="oval:org.mitre.oval.test:tst:1298"/>
          <criterion comment="Test that the not equal operation is supported with a unequal float value." test_ref="oval:org.mitre.oval.test:tst:1492"/>
        </criteria>
        <criteria operator="AND" comment="True if the greater than operation is supported.">
          <criterion comment="Test that the greater than operation is supported with a greater than float value." test_ref="oval:org.mitre.oval.test:tst:1319"/>
          <criterion negate="true" comment="Test that the greater than operation is supported with an equal float value." test_ref="oval:org.mitre.oval.test:tst:1100"/>
          <criterion negate="true" comment="Test that the greater than operation is supported with a less than float value." test_ref="oval:org.mitre.oval.test:tst:1402"/>
        </criteria>
        <criteria operator="AND" comment="True if the greater than or equal operation is supported is supported.">
          <criterion comment="Test that the greater than or equal operation is supported with a greater than float value." test_ref="oval:org.mitre.oval.test:tst:1199"/>
          <criterion comment="Test that the greater than or equal operation is supported with an equal float value." test_ref="oval:org.mitre.oval.test:tst:794"/>
          <criterion negate="true" comment="Test that the greater than or equal operation is supported with a less than float value." test_ref="oval:org.mitre.oval.test:tst:999"/>
        </criteria>
        <criteria operator="AND" comment="True if the less than operation is supported is supported.">
          <criterion comment="Test that the less than operation is supported with a less than float value." test_ref="oval:org.mitre.oval.test:tst:1541"/>
          <criterion negate="true" comment="Test that the less than operation is supported with an equal float value." test_ref="oval:org.mitre.oval.test:tst:1419"/>
          <criterion negate="true" comment="Test that the less than operation is supported with a greater than float value." test_ref="oval:org.mitre.oval.test:tst:1702"/>
        </criteria>
        <criteria operator="AND" comment="True if the less than or equal operation is supported is supported.">
          <criterion comment="Test that the less than or equal operation is supported with a less than float value." test_ref="oval:org.mitre.oval.test:tst:1357"/>
          <criterion comment="Test that the less than or equal operation is supported with an equal float value." test_ref="oval:org.mitre.oval.test:tst:1226"/>
          <criterion negate="true" comment="Test that the less than or equal operation is supported with a greater than float value." test_ref="oval:org.mitre.oval.test:tst:1519"/>
        </criteria>
      </criteria>
    </definition>
  </definitions>
  <tests>
    <variable_test id="oval:org.mitre.oval.test:tst:1499" version="1" comment="Test that the equals operation is supported with an equal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1129"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1189"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1707" version="1" comment="Test that the equals operation is supported with a unequal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1084"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1548"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1298" version="1" comment="Test that the not equal operation is supported with an equal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1129"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1579"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1492" version="1" comment="Test that the not equal operation is supported with a unequal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1084"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1445"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1319" version="1" comment="Test that the greater than operation is supported with a greater than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1084"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1568"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1100" version="1" comment="Test that the greater than operation is supported with an equal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1129"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1446"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1402" version="1" comment="Test that the greater than operation is supported with a less than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1250"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1373"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1199" version="1" comment="Test that the greater than or equal operation is supported with a greater than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1084"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1279"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:794" version="1" comment="Test that the greater than or equal operation is supported with an equal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1129"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1566"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:999" version="1" comment="Test that the greater than or equal operation is supported with a less than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1250"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1169"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1541" version="1" comment="Test that the less than operation is supported with a less than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1250"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1454"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1419" version="1" comment="Test that the less than operation is supported with an equal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1129"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1443"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1702" version="1" comment="Test that the less than operation is supported with a greater than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1084"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1378"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1357" version="1" comment="Test that the less than or equal operation is supported with a less than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1250"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1496"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1226" version="1" comment="Test that the less than or equal operation is supported with an equal float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1129"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1198"/>
    </variable_test>
    <variable_test id="oval:org.mitre.oval.test:tst:1519" version="1" comment="Test that the less than or equal operation is supported with a greater than float value." check_existence="at_least_one_exists" check="at least one" xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <object object_ref="oval:org.mitre.oval.test:obj:1084"/>
      <state state_ref="oval:org.mitre.oval.test:ste:1508"/>
    </variable_test>
  </tests>
  <objects>
    <variable_object id="oval:org.mitre.oval.test:obj:1129" version="1" comment="This variable_object references the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <var_ref>oval:org.mitre.oval.test:var:120</var_ref>
    </variable_object>
    <variable_object id="oval:org.mitre.oval.test:obj:1084" version="1" comment="This variable_object references the float value '1.234e2'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <var_ref>oval:org.mitre.oval.test:var:906</var_ref>
    </variable_object>
    <variable_object id="oval:org.mitre.oval.test:obj:1250" version="1" comment="This variable_object references the float value '1.05254'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <var_ref>oval:org.mitre.oval.test:var:16</var_ref>
    </variable_object>
  </objects>
  <states>
    <variable_state id="oval:org.mitre.oval.test:ste:1189" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1548" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1579" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="not equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1445" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="not equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1568" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="greater than">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1446" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="greater than">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1373" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="greater than">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1279" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="greater than or equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1566" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="greater than or equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1169" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="greater than or equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1454" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="less than">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1443" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="less than">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1378" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="less than">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1496" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="less than or equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1198" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="less than or equal">1.234</value>
    </variable_state>
    <variable_state id="oval:org.mitre.oval.test:ste:1508" version="1" comment="This variable_state represents the float value '1.234'." xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent">
      <value datatype="float" operation="less than or equal">1.234</value>
    </variable_state>
  </states>
  <variables>
    <constant_variable id="oval:org.mitre.oval.test:var:120" version="1" comment="This constant_variable represents the float value '1.234'." datatype="float">
      <value>1.234</value>
    </constant_variable>
    <constant_variable id="oval:org.mitre.oval.test:var:906" version="1" comment="This constant_variable represents the float value '1.234e2'." datatype="float">
      <value>1.234e2</value>
    </constant_variable>
    <constant_variable id="oval:org.mitre.oval.test:var:16" version="1" comment="This constant_variable represents the float value '1.05254'." datatype="float">
      <value>1.05254</value>
    </constant_variable>
  </variables>
</oval_definitions>


text:
/*

An abstraction over a 'SimTable' in the units required page.

The SimTable is represented on the page as a table with attack options.

This module provided utility functions for reading from and manipulating this table.

*/
define([

"module", "jquery", "../context", "../console", "../string-utils", "../ui-utils",

"./model/UnitList", "./model/Sim", "./model/AttackPlan"

], function(module, $, GRIMBO, console, StringUtils, uiUtils, UnitList, Sim, AttackPlan) {

    var DEBUG = GRIMBO.debug;
    var log = console.createLog(module.id, DEBUG);

    // SimTable
    // Utility operations to perform on a sim table DOM element.

    function SimTable($simTable) {
        this.$simTable = $simTable;
    }

    /**
     * Set a "sim-index" attribute on the table, so we know which Sim it is for.
     */
    SimTable.setSimIndex = function($simTable, simIndex) {
        var h = SimTable.getSimHeader($simTable);
        $simTable.add(h).attr("data-sim-index", simIndex);
    };

    /**
     * @return The "sim-index" attribute of the table, so we know which Sim it is for.
     */
    SimTable.getSimIndex = function($simTable) {
        return parseInt($simTable.attr("data-sim-index"), 10);
    };

    SimTable.getSimIndexForHeading = function($childOfHeading) {
        return parseInt($childOfHeading.closest("h3").attr("data-sim-index"), 10);
    };

    /**
     * Update the table UI to match "attackOptionIndex".
     */
    SimTable.setAttackOptionIndex = function($simTable, attackOptionIndex) {
        // Get the row to be selected.
        var $tr = $simTable.find(".grimbo.attack-option").eq(attackOptionIndex);
        // Clear all rows of selected class.
        $tr.siblings().add($tr).removeClass("selected");
        // Select the chosen row.
        $tr.addClass("selected");
    };

    /**
     * Update the table UI to match "attackOptionIndex".
     */
    SimTable.getSelectedAttackOptionRow = function($simTable) {
        // Get the row to be selected.
        return $simTable.find(".grimbo.attack-option .selected");
    };

    /**
     * @return The "attack-option-index" for the passed-in row.
     */
    SimTable.getRowAttackOptionIndex = function(tr) {
        return parseInt($(tr).attr("data-attack-option-index"), 10);
    };

    SimTable.parseUnitsStr = function(str) {
        function crop(arr) {
            // remove 'new general' baggage from split by cropping the array if necessary [*]
            for (var i = 0; i < arr.length; i++) {
                // match a digit from the start of the string to eliminate extra parts of string
                if (!arr[i].match(/^\d/)) {
                    arr.length = i;
                    break;
                }
            }
        }

        var units = new UnitList(),
            match;

        if (!str) {
            return units;
        }

        // Remove attack wave prefix, e.g. "1: 145R".
        // So remove everything before first ':'.
        match = str.match(/.*?\:(.*)/);
        if (match) {
            str = StringUtils.$trim(match[1]);
        }

        // str will be like "47R 1S 80C 72B"
        // [*] or like 12R 1S 200C  (220)
        // if a new general is used.
        var split = str.split(/\s+/);

        crop(split);

        // split will now be array with only units, like ["47R", "1S", "80C", "72B"]
        for (var i = 0; i < split.length; i++) {
            match = split[i].match(/^([\d]+)(.*)/);
            if (match) {
                // match should not be null after we've sanitised the array
                var unitType = match[2];
                var unitNumber = match[1];
                unitNumber = parseFloat(unitNumber);
                units = units.addUnits(unitType, unitNumber);
            }
        }

        return units;
    };

    SimTable.parseToSim = function($simTable) {
        function parseEnemiesFromHeader(sim, $h) {
            /*

    10  15
      (#filter)

      75

*/
            var children = $h.children("span");
            sim.campEnemies = [];
            // -2 because the filter and experience s are not enemies
            for (var i = 0; i < children.length - 2; i++) {
                var span = children[i];
                var enemy = {};
                enemy.count = StringUtils.$trim(span.previousSibling);
                enemy.type = $.trim($(span).attr("title"));
                sim.campEnemies.push(enemy);
            }
            var expStr = StringUtils.$trim(children.last().text());
            sim.exp = parseInt(expStr, 10);
        }

        function parseUnitsRequiredFromRow(tr) {
            /*

1: 134B
2: 23R 1S 44C 132LB	134B 1G
22.26R	134B 1G
23R	40KU 40SS 24DP
16DP 1DHP	40KU 40SS 40DP
16DP 1DHP	162.75

1: 135B
2: 23R 1S 44C 132LB	135B 1G
22.26R	135B 1G
23R	40KU 40SS 24DP
16DP 1DHP	40KU 40SS 40DP
16DP 1DHP	163.75

1: 136B
2: 23R 1S 44C 132LB	136B 1G
22.27R	136B 1G
23R	40KU 40SS 27DP
13DP 1DHP	40KU 40SS 40DP
13DP 1DHP	164.75

*/
            log(tr);
            var $td = $(tr).find("td");
            if (!$td || $td.length < 1) {
                log("parseSimTable: tds not found");
                return null;
            }

            // create some info objects that pair a stats header with its text as lines
            var unitInfo = $.map(["units", "avgLoss", "maxLoss", "minKill", "maxKill"], function(prop, i) {
                return {
                    prop: prop,
                    lines: StringUtils.$trim($td.eq(i + 1)).split("\n")
                };
            });

            var waves = [];
            var numWaves = unitInfo[0].lines.length;
            for (var i = 0; i < numWaves; i++) {
                var option = {};
                for (var j = 0; j < unitInfo.length; j++) {
                    option[unitInfo[j].prop] = SimTable.parseUnitsStr(unitInfo[j].lines[i]);
                }
                waves.push(option);
            }

            if (waves.length < 1) {
                var e = new Error("No waves found");
                e.tr = tr;
                throw e;
            }

            return waves;
        }

        var sim = {};
        var $h = SimTable.getSimHeader($simTable);
        if ($h.length < 1) {
            throw new Error("Expected to find a header associated with the Sim
.");
        }
        parseEnemiesFromHeader(sim, $h);
        sim.attackOptions = [];
        $simTable.find("tr").each(function(i, tr) {
            log(i, tr);
            if (0 === i) {
                return;
            }
            var option = parseUnitsRequiredFromRow(tr);
            if (option) {
                sim.attackOptions.push(option);
            }
        });

        if (sim.attackOptions.length < 1) {
            var e = new Error("No attack options found");
            e.table = $simTable[0];
            //throw e;
        }

        log(sim);
        return new Sim(sim.campEnemies, sim.exp, sim.attackOptions);
    };

    SimTable.getSimHeader = function($simTable) {
        return $simTable.prev("h3");
    };

    SimTable.showTableAndHeader = function($simTable, isShow) {
        // normalise in case ignore is undefined or falsey rather than false.
        isShow = false !== isShow;
        var $h = SimTable.getSimHeader($simTable);
        var func = isShow ? "show" : "hide";
        $h[func]();
        $simTable[func]();
    };

    SimTable.hideTableAndHeader = function($simTable) {
        SimTable.showTableAndHeader($simTable, false);
    };

    /**
     * @return int.
     */
    SimTable.getChosenAttackOption = function($simTable) {
        var $sel = $simTable.find("tr.attack-option.selected");
        if ($sel.length < 1) {
            return -1;
        }
        var idx = $sel.attr("data-attack-option-index");
        return parseInt(idx, 10);
    };

    SimTable.addAttackOptionClasses = function($simTable) {
        $simTable.find("tbody").each(function(i, tbody) {
            $(tbody).find("tr").each(function(i, tr) {
                var $tr = $(tr);
                $tr.addClass("grimbo attack-option");
                $tr.attr("data-attack-option-index", i);
            });
        });
    };

    SimTable.addSummaryRows = function($simTable, thisWaveLosses, totalLosses, totalActive, totalXP) {
        function createRow(cssClass, cells) {
            var $tr = $("

").addClass(cssClass);
            for (var i = 0; i < cells.length; i++) {
                // ensure a string ""+
                var $td = $("	").html("" + cells[i]);
                if (i === cells.length - 1) {
                    $td.attr("colspan", "99");
                }
                $tr.append($td);
            }
            return $tr;
        }
        var $tr1 = createRow("grimbo summary wave-losses", ["Wave losses: [" + thisWaveLosses.totalUnits() + "]", uiUtils.unitListToHtml(thisWaveLosses) + " [" + thisWaveLosses.totalUnitValue() + "]"]);
        var $tr2 = createRow("grimbo summary total-losses", ["Total losses: [" + totalLosses.totalUnits() + "]", uiUtils.unitListToHtml(totalLosses) + " [" + totalLosses.totalUnitValue() + "]"]);
        var totalRequired = totalActive.add(totalLosses);
        log(totalActive, totalLosses, totalRequired);
        var $tr3 = createRow("grimbo summary total-required", ["Total required: [" + totalRequired.totalUnits() + "]", uiUtils.unitListToHtml(totalRequired)]);
        var $tr4 = createRow("grimbo summary total-exp", ["Total XP:", totalXP]);
        var $trs = $tr1.add($tr2).add($tr3).add($tr4).css("border", "solid black 1px");
        $simTable.append($trs);
    };

    SimTable.removeSummaryRows = function($simTable) {
        $simTable.find("tr.grimbo.summary").remove();
    };

    function createInstanceMethodsForStatics(constructor, firstArgPropertyName, methodNames) {
        // For each static method name provided, create an instance method (on the prototype).
        $.each(methodNames, function(i, methodName) {
            // Create a new 'instance' method on the prototype with the same name as the static method.
            constructor.prototype[methodName] = function() {
                var instance = this;
                var staticMeth = constructor[methodName];

                // The first argument to the static method is a property of the instance itself.
                var firstArg = instance[firstArgPropertyName];
                var args = [firstArg].concat(Array.prototype.slice.apply(arguments));

                return staticMeth.apply(null, args);
            };
        });
    }

    // Create 'instance' methods for each of the specified 'static' methods.
    // All the 'static' methods take $simTable as the first parameter.
    createInstanceMethodsForStatics(SimTable, "$simTable", [

    "parseToSim", "parseSimTable", "getSimHeader", "showTableAndHeader", "hideTableAndHeader",

    "getChosenAttackOption", "addSummaryRows", "removeSummaryRows", "getSimIndex", "setSimIndex",

    "setAttackOptionIndex", "getSelectedAttackOptionRow"

    ]);

    return SimTable;

});

redpajama_set_name: RedPajamaGithub


text:
using System;

using JetBrains.Annotations;

namespace CodeJam
{
	/// <summary>
	/// Helper methods for the <see cref="Func{TResult}"/> and <see cref="Action"/> delegates.
	/// </summary>
	[PublicAPI]
	public static partial class Fn
	{
		/// <summary>
		/// Gets the function that always returns <c>true</c>.
		/// </summary>
		public static readonly Func<bool> True = () => true;

		/// <summary>
		/// Gets the function that always returns <c>false</c>.
		/// </summary>
		public static readonly Func<bool> False = () => false;
	}
}


text:
using namespace cms;

// custom demo classes
class CustomNodeAddon;
class CustomNode {
  friend CustomNodeAddon;

  public:
    CustomNode(): name(""), value(0.0f){}
    string name;
    float value;
    std::vector<std::shared_ptr<CustomNode>> children;

    std::vector<CustomNodeAddon*> addons;
};

class CustomNodeAge : public CustomNode {
  public:
    CustomNodeAge() : age(0){}
    int age;
};

class CustomNodeAddon {
  public:
    void addTo(CustomNode& newnode){
      // we're a friend class of CustomNode, so we can
      // directly access its private addons attribute
      newnode.addons.push_back(this);
      this->node = &newnode;
    }

    CustomNode* node;
    std::string name;
};

// configurator for our custom classes
class Configurator : public cms::cfg::Configurator {
  public:
    Configurator(ModelCollection& mc) : cms::cfg::Configurator(mc) {
    }

    void cfg(CustomNode& node, const std::map<string, string>& data){
      Model m;
      m.set(data);
      m.with("name", [&node](const std::string& v){ node.name = v; });
      m.withFloat("value", [&node](float v){ node.value = v; });

    }

    void cfg(CustomNodeAge& node, const std::map<string, string>& data){
      this->cfg((CustomNode&)node, data);
      Model m;
      m.set(data);
      m.withInt("age", [&node](int v){ node.age = v; });
    }

    void cfg(CustomNodeAddon& addon, const std::map<string, string>& data){
      Model m;
      m.set(data);
      m.with("name", [&addon](const std::string& v){ addon.name = v; });
    }

    // overwrite Configurator's version, because that one only knows about
    // the cfg methods in the Configurator class
    template<typename T>
    void cfgWithModel(T& c, Model& model){
      this->apply(model, [this, &c](ModelBase& mod){
        this->cfg(c, mod.attributes());
      });
    }
};

// builder for our custom classes
class Builder : public cms::cfg::Builder<CustomNode> {
  private:
    std::shared_ptr<Configurator> configurator;

  public:
    Builder(){
      this->configurator = std::make_shared<Configurator>(this->getModelCollection());

      this->setChilderFunc([](CustomNode& parent, CustomNode& child){
        parent.children.push_back(std::shared_ptr<CustomNode>(&child));
      });

      this->addInstantiator("CustomNode", [this](Model& model){
        // create instance
        auto n = new CustomNode();
        // apply configuration data
        this->configurator->cfgWithModel(*n, model);
        // return to caller
        return n;
      });

      this->addInstantiator("CustomNodeAge", [this](Model& model){
        // create instance
        auto n = new CustomNodeAge();
        // apply configuration data
        this->configurator->cfgWithModel(*n, model);
        // return to caller
        return n;
      });

      this->addExtender("CustomNodeAddon", [this](CustomNode& node, Model& model){
        // create instance
        auto a = new CustomNodeAddon();
        // apply configuration data
        this->configurator->cfgWithModel(*a, model);
        a->addTo(node);
        // return to caller
        return a;
      });
    }
};

class FooKlass {

};

class Builder2 : public cms::cfg::Builder<FooKlass> {
};

TEST_CASE("cms::cfg::Builder", ""){
  SECTION("typical_usage"){
    // builder instance
    Builder builder;
    // load json data which contains hierarchical and configuration information
    builder.getModelCollection().loadJsonFromFile(ci::app::getAssetPath("test_builder.json"));
    // build an item from the json data
    auto n1 = builder.build("typical_usage.node1");

    // check the node got created and configured
    REQUIRE(n1->name == "root");
    REQUIRE(n1->value == 1.0f);
    REQUIRE(n1->children.size() == 2);

    // check that all its children were added and configured
    REQUIRE(n1->children[0]->name == "child1");
    REQUIRE(n1->children[0]->value == 2.0f);
    REQUIRE(n1->children[0]->children.size() == 1);

    REQUIRE(n1->children[0]->children[0]->name == "grandchild1");
    REQUIRE(n1->children[0]->children[0]->value == 3.0f);
    REQUIRE(n1->children[0]->children[0]->children.size() == 0);

    REQUIRE(n1->children[1]->name == "child2");
    REQUIRE(n1->children[1]->value == 4.5f);
    REQUIRE(n1->children[1]->children.size() == 0);

    // check that all "addons" were attached
    REQUIRE(n1->addons.size() == 2);
    REQUIRE(n1->addons[0]->name == "addon#1");
    REQUIRE(n1->addons[1]->name == "addon no. 2");
  }

  SECTION("combining_builders"){
    Builder builder;
    builder.getModelCollection().loadJsonFromFile(ci::app::getAssetPath("test_builder.json"));
    Builder2 builder2;
    builder2.getModelCollection().loadJsonFromFile(ci::app::getAssetPath("test_builder.json"));
    builder2.add(builder);
    auto n = (CustomNode*)builder2.build("combining_builders.node1");
    REQUIRE(n->name == "customer");
    REQUIRE(n->value == 101.0f);
    REQUIRE(n->children.size() == 1);
  }
}


text:
var path = require('path');
var async = require('async');
var flower = require('flower');
var safedir = require('safedir');
var uglify = require("uglify-js");

var common = require('../common.js');
var utils = common.load('utils');
var readfile = common.load('helpers', 'file');
var createETag = common.load('helpers', 'etag');
var routerBuild = common.load('build', 'router');

function remove(list, name) {
  return list.splice(list.indexOf(name), 1)[0];
}

function loadfile(file, callback) {
  if (!file.path) {
    return callback(null, file);
  }

  readfile(file.path, function (error, fileobject) {
    if (error) return callback(error, null);

    // convert buffer to stringt
    fileobject.content = fileobject.content.toString();

    // add input properties to fileobject
    callback(null, utils.extend(fileobject, file));
  });
}

function ClientCore(piccolo, callback) {
  if (!(this instanceof ClientCore)) return new ClientCore(piccolo, callback);

  var self = this;

  async.parallel({
    bindings: safedir.bind(null, common.find('bindings', null), { safe: false }),
    modules: safedir.bind(null, common.find('modules', null), { safe: false }),
    core: safedir.bind(null, common.find('client', null), { safe: false })
  }, function (error, list) {
    if (error) return callback(error, null);

    // remove head and foot file from core list
    var head = { path: remove(list.core, common.find('client', 'head')) };
    var foot = { path: remove(list.core, common.find('client', 'foot')) };
    var init = { path: remove(list.core, common.find('client', 'init')) };

    list.bindings = list.bindings
      // remove server files from modules
      .filter(function (filepath) {
        return (filepath.indexOf('.server.js') === -1);
      })
      // resolve filepaths to include modulename
      .map(function (filepath) {
        var bindingname = path.basename(filepath, ".client.js");

        return {
          path: filepath,
          binding: bindingname
        };
      });

    // Link domstream-client module
    list.bindings.push({
      path: require.resolve('domstream-client'),
      binding: 'domstream'
    });

    // resolve filepaths to include modulename
    list.modules = list.modules.map(function (filepath) {
      var modulename = path.basename(filepath, ".js");

      return {
        path: filepath,
        module: modulename
      };
    });

    // resolve core files
    list.core = list.core.map(function (filepath) {
      return { path: filepath };
    });

    // create stringified dependencies map
    var dependenciesMap = (function () {
      var build = piccolo.build.dependencies.build;
      var mtime = 0;
      var map = {
        dirMap: build.dirMap,
        packageMap: build.packageMap
      };

      // Calculate mtime
      Object.keys(build.mtime).forEach(function (filename) {
        var timestamp = build.mtime[filename];
        if (timestamp > mtime) {
          mtime = timestamp;
        }
      });

      // return fileobject
      return {
        content: 'build.dependencies = ' + JSON.stringify(map),
        mtime: new Date(mtime)
      };
    })();

    // create stringified template map
    var templateMap = (function () {
      var build = piccolo.build.templates;
      var files = Object.keys(build.files);

      return {
        content: 'build.template = ' + JSON.stringify(files),
        mtime: new Date(build.mtime)
      };
    })();

    routerBuild.include(piccolo, function (error, routeContent) {
      if (error) return callback(error, null);

      // create load list
      var loadlist;
      loadlist = [];
      loadlist.push(head);
      loadlist.push(templateMap);
      loadlist.push(dependenciesMap);
      loadlist.push.apply(loadlist, list.bindings);
      loadlist.push.apply(loadlist, list.modules);
      loadlist.push(init);
      loadlist.push(routeContent);
      loadlist.push.apply(loadlist, list.core);
      loadlist.push(foot);

      // load all files
      async.map(loadlist, loadfile, function (error, files) {
        if (error) return callback(error, null);

        var mtime = 0, content = "";
        var jsp = uglify.parser;
        var pro = uglify.uglify;

        files.forEach(function (file) {
          // calculate the mtime
          var timestamp = file.mtime.getTime();
          if (timestamp > mtime) {
            mtime = timestamp;
          }

          // Add module content as a string so it can be compiled separately
          if (file.module) {
            // store source code in object property value
            content += 'build.NativeModuleSource.' + file.module + ' = ';

            // Compress content if settings says
            if (piccolo.get('compress')) {
              var ast = jsp.parse(file.content.toString());
                  ast = pro.ast_mangle(ast);
                  ast = pro.ast_squeeze(ast);

              file.content = pro.gen_code(ast);
            }

            // escape and add content
            content += JSON.stringify(file.content);

            // End JS quote
            content += ';';
          }
          // Add binding content in an function wrapper
          else if (file.binding) {
            content += 'build.NativeBinding.' + file.binding + ' = function (exports, require, module, piccolo, __filename, __dirname) {\n';
            content += file.content;
            content += '\n};';
          }
          // Add normal JS code
          else {
            content += file.content;
          }

          // Add linebreak (they are so beautiful)
          content += "\n";
        });

        // set mtime date
        self.mtime = new Date(mtime);
        self.etag = createETag(content);

        // Compress content if settings says
        if (piccolo.get('compress')) {
          var ast = jsp.parse(content);
              ast = pro.ast_mangle(ast);
              ast = pro.ast_squeeze(ast);

          content = pro.gen_code(ast);
        }

        // create memory stream
        self.memory = flower.memoryStream();
        flower.buffer2stream(content).pipe(self.memory);

        // return client object
        callback(null, self);
      });
    });
  });

}
module.exports = ClientCore;

ClientCore.prototype.read = function () {
  var stream = this.memory.relay();
      stream.pause();

  // add metadata properties
  stream.type = 'application/javascript';
  stream.mtime = this.mtime;
  stream.etag = this.etag;

  // emit ready on next tick
  process.nextTick(function () {
    stream.emit('ready');
  });

  return stream;
};


text:
import { Model } from "../common/model";
import { EventsService } from "../resources/events.service";

export class EventModel extends Model {
  constructor(
    protected eventsService: EventsService, data: any
  ) {
    super(eventsService, data);
  }
}


text:
// pdlfs-common/src/rpc.cc

#include <stdio.h>
#include <stdlib.h>
#include <vector>

#include "platform/pdlfs_logging.h"
#include "platform/pdlfs_platform.h"
#include "utils/pdlfs_rpc.h"

#if defined(PDLFS_MARGO_RPC)
#include "margo_rpc.h"
#endif

#if defined(PDLFS_MERCURY_RPC)
#include "mercury_rpc.h"
#endif

namespace bubblefs {
namespace mypdlfs {

RPCOptions::RPCOptions()
    : impl(kMercuryRPC),
      mode(kServerClient),
      rpc_timeout(5000000),
      num_io_threads(1),
      extra_workers(NULL),
      addr_cache_size(128),
      env(NULL),
      fs(NULL) {}

RPC::~RPC() {}

RPCServer::~RPCServer() {
  std::vector<RPCInfo>::iterator it;
  for (it = rpcs_.begin(); it != rpcs_.end(); ++it) {
    delete it->rpc;
    delete it->pool;
  }
}

void RPCServer::AddChannel(const std::string& listening_uri, int workers) {
  RPCInfo info;
  RPCOptions options;
  options.env = env_;
  info.pool = ThreadPool::NewFixed(workers);
  options.extra_workers = info.pool;
  options.fs = fs_;
  options.uri = listening_uri;
  info.rpc = RPC::Open(options);
  rpcs_.push_back(info);
}

Status RPCServer::status() const {
  Status s;
  std::vector<RPCInfo>::const_iterator it;
  for (it = rpcs_.begin(); it != rpcs_.end(); ++it) {
    assert(it->rpc != NULL);
    s = it->rpc->status();
    if (!s.ok()) {
      break;
    }
  }
  return s;
}

Status RPCServer::Start() {
  Status s;
  std::vector<RPCInfo>::iterator it;
  for (it = rpcs_.begin(); it != rpcs_.end(); ++it) {
    assert(it->rpc != NULL);
    s = it->rpc->Start();
    if (!s.ok()) {
      break;
    }
  }
  return s;
}

Status RPCServer::Stop() {
  Status s;
  std::vector<RPCInfo>::iterator it;
  for (it = rpcs_.begin(); it != rpcs_.end(); ++it) {
    assert(it->rpc != NULL);
    s = it->rpc->Stop();
    if (!s.ok()) {
      break;
    }
  }
  return s;
}

namespace rpc {

If::~If() {}

namespace {
#if defined(PDLFS_MARGO_RPC)
class MargoRPCImpl : public RPC {
  MargoRPC* rpc_;

 public:
  virtual Status Start() { return rpc_->Start(); }
  virtual Status Stop() { return rpc_->Stop(); }

  virtual If* OpenClientFor(const std::string& addr) {
    return new MargoRPC::Client(rpc_, addr);
  }

  MargoRPCImpl(const RPCOptions& options) {
    rpc_ = new MargoRPC(options.mode == kServerClient, options);
    rpc_->Ref();
  }

  virtual ~MargoRPCImpl() { rpc_->Unref(); }
};
#endif
}

namespace {
#if defined(PDLFS_MERCURY_RPC)
class MercuryRPCImpl : public RPC {
  MercuryRPC::LocalLooper* looper_;
  MercuryRPC* rpc_;

 public:
  virtual Status status() const { return rpc_->status(); }
  virtual Status Start() { return looper_->Start(); }
  virtual Status Stop() { return looper_->Stop(); }

  virtual If* OpenClientFor(const std::string& addr) {
    return new MercuryRPC::Client(rpc_, addr);
  }

  MercuryRPCImpl(const RPCOptions& options) {
    rpc_ = new MercuryRPC(options.mode == kServerClient, options);
    looper_ = new MercuryRPC::LocalLooper(rpc_, options);
    rpc_->Ref();
  }

  virtual ~MercuryRPCImpl() {
    rpc_->Unref();
    delete looper_;
  }
};
#endif
}

}  // namespace rpc

RPC* RPC::Open(const RPCOptions& raw_options) {
  assert(raw_options.uri.size() != 0);
  assert(raw_options.mode != kServerClient || raw_options.fs != NULL);
  RPCOptions options(raw_options);
  if (options.env == NULL) {
    options.env = Env::Default();
  }
#if VERBOSE >= 1
  Verbose(__LOG_ARGS__, 1, "rpc.uri -> %s", options.uri.c_str());
  Verbose(__LOG_ARGS__, 1, "rpc.timeout -> %llu (microseconds)",
          (unsigned long long)options.rpc_timeout);
  Verbose(__LOG_ARGS__, 1, "rpc.num_io_threads -> %d", options.num_io_threads);
  Verbose(__LOG_ARGS__, 1, "rpc.extra_workers -> [%s]",
          options.extra_workers != NULL
              ? options.extra_workers->ToDebugString().c_str()
              : "NULL");
#endif
  RPC* rpc = NULL;
#if defined(PDLFS_MARGO_RPC)
  if (options.impl == kMargoRPC) {
    rpc = new rpc::MargoRPCImpl(options);
  }
#endif
#if defined(PDLFS_MERCURY_RPC)
  if (options.impl == kMercuryRPC) {
    rpc = new rpc::MercuryRPCImpl(options);
  }
#endif
  if (rpc == NULL) {
#ifndef NDEBUG
    char msg[] = "No rpc implementation is available\n";
    fwrite(msg, 1, sizeof(msg), stderr);
    abort();
#else
    Error(__LOG_ARGS__, "No rpc implementation is available");
    exit(EXIT_FAILURE);
#endif
  } else {
    return rpc;
  }
}

}  // namespace mypdlfs
}  // namespace bubblefs


text:
var oEditor		= window.parent.InnerDialogLoaded() ;
var FCK			= oEditor.FCK ;
var FCKLang		= oEditor.FCKLang ;
var FCKConfig	= oEditor.FCKConfig ;

//#### Dialog Tabs

// Set the dialog tabs.
window.parent.AddTab( 'Info', oEditor.FCKLang.DlgInfoTab ) ;

if ( FCKConfig.FlashUpload )
	window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;

if ( !FCKConfig.FlashDlgHideAdvanced )
	window.parent.AddTab( 'Advanced', oEditor.FCKLang.DlgAdvancedTag ) ;

// Function called when a dialog tag is selected.
function OnDialogTabChange( tabCode )
{
	ShowE('divInfo'		, ( tabCode == 'Info' ) ) ;
	ShowE('divUpload'	, ( tabCode == 'Upload' ) ) ;
	ShowE('divAdvanced'	, ( tabCode == 'Advanced' ) ) ;
}

// Get the selected flash embed (if available).
var oFakeImage = FCK.Selection.GetSelectedElement() ;
var oEmbed ;

if ( oFakeImage )
{
	if ( oFakeImage.tagName == 'IMG' && oFakeImage.getAttribute('_fckflash') )
		oEmbed = FCK.GetRealElement( oFakeImage ) ;
	else
		oFakeImage = null ;
}

window.onload = function()
{
	// Translate the dialog box texts.
	oEditor.FCKLanguageManager.TranslatePage(document) ;

	// Load the selected element information (if any).
	LoadSelection() ;

	// Show/Hide the "Browse Server" button.
	GetE('tdBrowse').style.display = FCKConfig.FlashBrowser	? '' : 'none' ;

	// Set the actual uploader URL.
	if ( FCKConfig.FlashUpload )
		GetE('frmUpload').action = FCKConfig.FlashUploadURL ;

	window.parent.SetAutoSize( true ) ;

	// Activate the "OK" button.
	window.parent.SetOkButton( true ) ;
}

function LoadSelection()
{
	if ( ! oEmbed ) return ;

	GetE('txtUrl').value    = GetAttribute( oEmbed, 'src', '' ) ;
	GetE('txtWidth').value  = GetAttribute( oEmbed, 'width', '' ) ;
	GetE('txtHeight').value = GetAttribute( oEmbed, 'height', '' ) ;

	// Get Advances Attributes
	GetE('txtAttId').value		= oEmbed.id ;
	GetE('chkAutoPlay').checked	= GetAttribute( oEmbed, 'play', 'true' ) == 'true' ;
	GetE('chkLoop').checked		= GetAttribute( oEmbed, 'loop', 'true' ) == 'true' ;
	GetE('chkMenu').checked		= GetAttribute( oEmbed, 'menu', 'true' ) == 'true' ;
	GetE('cmbScale').value		= GetAttribute( oEmbed, 'scale', '' ).toLowerCase() ;

	GetE('txtAttTitle').value		= oEmbed.title ;

	if ( oEditor.FCKBrowserInfo.IsIE )
	{
		GetE('txtAttClasses').value = oEmbed.getAttribute('className') || '' ;
		GetE('txtAttStyle').value = oEmbed.style.cssText ;
	}
	else
	{
		GetE('txtAttClasses').value = oEmbed.getAttribute('class',2) || '' ;
		GetE('txtAttStyle').value = oEmbed.getAttribute('style',2) || '' ;
	}

	UpdatePreview() ;
}

//#### The OK button was hit.
function Ok()
{
	if ( GetE('txtUrl').value.length == 0 )
	{
		window.parent.SetSelectedTab( 'Info' ) ;
		GetE('txtUrl').focus() ;

		alert( oEditor.FCKLang.DlgAlertUrl ) ;

		return false ;
	}

	if ( !oEmbed )
	{
		oEmbed		= FCK.EditorDocument.createElement( 'EMBED' ) ;
		oFakeImage  = null ;
	}
	UpdateEmbed( oEmbed ) ;

	if ( !oFakeImage )
	{
		oFakeImage	= oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oEmbed ) ;
		oFakeImage.setAttribute( '_fckflash', 'true', 0 ) ;
		oFakeImage	= FCK.InsertElementAndGetIt( oFakeImage ) ;
	}
	else
		oEditor.FCKUndo.SaveUndoStep() ;

	oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oEmbed ) ;

	return true ;
}

function UpdateEmbed( e )
{
	SetAttribute( e, 'type'			, 'application/x-shockwave-flash' ) ;
	SetAttribute( e, 'pluginspage'	, 'http://www.macromedia.com/go/getflashplayer' ) ;

	SetAttribute( e, 'src', GetE('txtUrl').value ) ;
	SetAttribute( e, "width" , GetE('txtWidth').value ) ;
	SetAttribute( e, "height", GetE('txtHeight').value ) ;

	// Advances Attributes

	SetAttribute( e, 'id'	, GetE('txtAttId').value ) ;
	SetAttribute( e, 'scale', GetE('cmbScale').value ) ;

	SetAttribute( e, 'play', GetE('chkAutoPlay').checked ? 'true' : 'false' ) ;
	SetAttribute( e, 'loop', GetE('chkLoop').checked ? 'true' : 'false' ) ;
	SetAttribute( e, 'menu', GetE('chkMenu').checked ? 'true' : 'false' ) ;

	SetAttribute( e, 'title'	, GetE('txtAttTitle').value ) ;

	if ( oEditor.FCKBrowserInfo.IsIE )
	{
		SetAttribute( e, 'className', GetE('txtAttClasses').value ) ;
		e.style.cssText = GetE('txtAttStyle').value ;
	}
	else
	{
		SetAttribute( e, 'class', GetE('txtAttClasses').value ) ;
		SetAttribute( e, 'style', GetE('txtAttStyle').value ) ;
	}
}

var ePreview ;

function SetPreviewElement( previewEl )
{
	ePreview = previewEl ;

	if ( GetE('txtUrl').value.length > 0 )
		UpdatePreview() ;
}

function UpdatePreview()
{
	if ( !ePreview )
		return ;

	while ( ePreview.firstChild )
		ePreview.removeChild( ePreview.firstChild ) ;

	if ( GetE('txtUrl').value.length == 0 )
		ePreview.innerHTML = ' ' ;
	else
	{
		var oDoc	= ePreview.ownerDocument || ePreview.document ;
		var e		= oDoc.createElement( 'EMBED' ) ;

		SetAttribute( e, 'src', GetE('txtUrl').value ) ;
		SetAttribute( e, 'type', 'application/x-shockwave-flash' ) ;
		SetAttribute( e, 'width', '100%' ) ;
		SetAttribute( e, 'height', '100%' ) ;

		ePreview.appendChild( e ) ;
	}
}

// <embed id="ePreview" src="fck_flash/claims.swf" width="100%" height="100%" style="visibility:hidden" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">

function BrowseServer()
{
	OpenFileBrowser( FCKConfig.FlashBrowserURL, FCKConfig.FlashBrowserWindowWidth, FCKConfig.FlashBrowserWindowHeight ) ;
}

function SetUrl( url, width, height )
{
	GetE('txtUrl').value = url ;

	if ( width )
		GetE('txtWidth').value = width ;

	if ( height )
		GetE('txtHeight').value = height ;

	UpdatePreview() ;

	window.parent.SetSelectedTab( 'Info' ) ;
}

function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
{
	switch ( errorNumber )
	{
		case 0 :	// No errors
			alert( 'Your file has been successfully uploaded' ) ;
			break ;
		case 1 :	// Custom error
			alert( customMsg ) ;
			return ;
		case 101 :	// Custom warning
			alert( customMsg ) ;
			break ;
		case 201 :
			alert( 'A file with the same name is already available. The uploaded file has been renamed to "' + fileName + '"' ) ;
			break ;
		case 202 :
			alert( 'Invalid file type' ) ;
			return ;
		case 203 :
			alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
			return ;
		default :
			alert( 'Error on file upload. Error number: ' + errorNumber ) ;
			return ;
	}

	SetUrl( fileUrl ) ;
	GetE('frmUpload').reset() ;
}

var oUploadAllowedExtRegex	= new RegExp( FCKConfig.FlashUploadAllowedExtensions, 'i' ) ;
var oUploadDeniedExtRegex	= new RegExp( FCKConfig.FlashUploadDeniedExtensions, 'i' ) ;

function CheckUpload()
{
	var sFile = GetE('txtUploadFile').value ;

	if ( sFile.length == 0 )
	{
		alert( 'Please select a file to upload' ) ;
		return false ;
	}

	if ( ( FCKConfig.FlashUploadAllowedExtensions.length > 0 && !oUploadAllowedExtRegex.test( sFile ) ) ||
		( FCKConfig.FlashUploadDeniedExtensions.length > 0 && oUploadDeniedExtRegex.test( sFile ) ) )
	{
		OnUploadCompleted( 202 ) ;
		return false ;
	}

	return true ;
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

WebDAV for Linux

Linux has built in support for WebDAV

First open your File Explorer (Nautilus or Konqueror).

Open File in the menubar and select Connect to Server...

In the dialog that appears select WebDAV (HTTP) as Service type

Set Server as "attachix.de" or the shared with you URL (something like ab4chQf.k.attachix.de)

Click Connect

Type in your username (in lowercase) and password in the authentication dialog that appears and click Connect


text:
package  com.limagiran.hearthstone.heroi.view;

import com.limagiran.hearthstone.util.AbsolutesConstraints;
import com.limagiran.hearthstone.util.Images;
import com.limagiran.hearthstone.heroi.control.Heroi;
import java.awt.Image;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import org.netbeans.lib.awtextra.AbsoluteConstraints;
import org.netbeans.lib.awtextra.AbsoluteLayout;

/**
 *
 * @author Vinicius
 */
public class Ataque extends JPanel {

    private JLabelAtributos ataque;
    private JLabel background;
    private JLabel investida;
    private final Heroi heroi;

    public Ataque(Heroi heroi) {
        super(new AbsoluteLayout());
        this.heroi = heroi;
        init();
    }

    private void init() {
        setOpaque(false);
        setVisible(false);
        ataque = new JLabelAtributos(heroi, JLabelAtributos.ATAQUE);
        background = new JLabel(Images.HEROI_ATAQUE, SwingConstants.CENTER);
        Images.HEROI_INVESTIDA.setImageObserver(investida);
        investida = new JLabel(Images.HEROI_INVESTIDA) {
            @Override
            public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {
                return true;
            }
        };
        add(ataque, AbsolutesConstraints.HEROI_LABEL_ATAQUE);
        add(background, new AbsoluteConstraints(0, 8, 70, 70));
        add(investida, AbsolutesConstraints.ZERO);
    }

    public void atualizar() {
        ataque.repaint();
        investida.repaint();
    }

    public void setInvestida(boolean flag) {
        investida.setVisible(flag);
    }

    public boolean isInvestida() {
        return investida.isVisible();
    }
}


text:
// compute.cpp: experiments with complex real/imaginary computations
//
// Copyright (C) 2017-2021 Stillwater Supercomputing, Inc.
//
// This file is part of the universal number project, which is released under an MIT Open Source license.
#include <math.h>
#include <stdint.h>
#include <iostream>

#include <cmath>
#include <complex>

#include <universal/native/ieee754.hpp>

// Configure the fixpnt template environment
// first: enable general or specialized fixed-point configurations
#define FIXPNT_FAST_SPECIALIZATION
// second: enable/disable fixpnt arithmetic exceptions
#define FIXPNT_THROW_ARITHMETIC_EXCEPTION 1
#include <universal/number/fixpnt/fixpnt.hpp>

// Configure the cfloat template environment
// first: enable general or specialized cfloat configurations
#define CFLOAT_FAST_SPECIALIZATION
// second: enable/disable fixpnt arithmetic exceptions
#define CFLOAT_THROW_ARITHMETIC_EXCEPTION 1
//#include <universal/number/cfloat/cfloat.hpp>

// Configure the posit template environment
// first: enable general or specialized posit configurations
//#define POSIT_FAST_SPECIALIZATION
// second: enable/disable posit arithmetic exceptions
#define POSIT_THROW_ARITHMETIC_EXCEPTION 1
#include <universal/number/posit/posit.hpp>
#include <universal/math/complex_manipulators.hpp>  // to_binary() for complex types

template<typename Scalar>
void TestComplexConjugate(float r = 0.25f, float i = 0.5f) {
	constexpr bool nibbleMarker = true;
	Scalar s{ 0 };
	std::cout << "TestComplexConjugate for type " << sw::universal::type_tag(s) << '\n';
	std::complex<Scalar> c(r, i);
	std::complex<Scalar> cconj(r, -i);
	std::cout << sw::universal::to_binary(c, nibbleMarker) << " : " << c << '\n';
	std::cout << sw::universal::to_binary(cconj, nibbleMarker) << " : " << cconj << '\n';
	std::complex<Scalar> product = c * cconj;
	std::cout << '(' << r << '+' << i << ")*(" << r << '-' << i << ") = " << sw::universal::to_binary(product, nibbleMarker) << " : " << product << '\n';
	std::cout << "----\n";
}

namespace special {

	/////////////////////////////////        NATIVE IEEE-754       ////////////////////////////////////////////////

	bool isnan(std::complex<float> x) { return (std::isnan(x.real()) || std::isnan(x.imag())); }
	bool isinf(std::complex<float> x) { return (std::isinf(x.real()) || std::isinf(x.imag())); }
	std::complex<float> copysign(std::complex<float> x, std::complex<float> y) { return std::complex<float>(std::copysign(x.real(), y.real()), std::copysign(x.real(), y.real())); }

	bool isnan(std::complex<double> x) { return (std::isnan(x.real()) || std::isnan(x.imag())); }
	bool isinf(std::complex<double> x) { return (std::isinf(x.real()) || std::isinf(x.imag())); }
	std::complex<double> copysign(std::complex<double> x, std::complex<double> y) { return std::complex<double>(std::copysign(x.real(), y.real()), std::copysign(x.real(), y.real())); }

	bool isnan(std::complex<long double> x) { return (std::isnan(x.real()) || std::isnan(x.imag())); }
	bool isinf(std::complex<long double> x) { return (std::isinf(x.real()) || std::isinf(x.imag())); }
	std::complex<long double> copysign(std::complex<long double> x, std::complex<long double> y) { return std::complex<long double>(std::copysign(x.real(), y.real()), std::copysign(x.real(), y.real())); }

	/////////////////////////////////            FIXPNT           ////////////////////////////////////////////////

	template<typename FixedPoint>
	bool isnan(std::complex<FixedPoint> x) {
		return (isnan(x.real()) || isnan(x.imag()));
	}
	template<typename FixedPoint>
	bool isinf(std::complex<FixedPoint> x) {
		return (isinf(x.real()) || isinf(x.imag()));
	}
	template<typename FixedPoint>
	std::complex<FixedPoint> copysign(std::complex<FixedPoint> x, std::complex<FixedPoint> y) {
		return std::complex<FixedPoint>(copysign(x.real(), y.real()), copysign(x.real(), y.real()));
	}
/*
	using fp43sat = sw::universal::fixpnt<4, 3, sw::universal::Saturating, uint8_t>;
	bool isnan(std::complex<fp43sat> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<fp43sat> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<fp43sat> copysign(std::complex<fp43sat> x, std::complex<fp43sat> y) { return std::complex<fp43sat>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	using fp87sat = sw::universal::fixpnt<8, 7, sw::universal::Saturating, uint8_t>;
	bool isnan(std::complex<fp87sat> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<fp87sat> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<fp87sat> copysign(std::complex<fp87sat> x, std::complex<fp87sat> y) { return std::complex<fp87sat>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	using fp1615sat = sw::universal::fixpnt<16, 15, sw::universal::Saturating, uint16_t>;
	bool isnan(std::complex<fp1615sat> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<fp1615sat > x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<fp1615sat> copysign(std::complex<fp1615sat> x, std::complex<fp1615sat > y) { return std::complex<fp1615sat>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	using fp3231sat = sw::universal::fixpnt<32, 31, sw::universal::Saturating, uint32_t>;
	bool isnan(std::complex<fp3231sat> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<fp3231sat> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<fp3231sat> copysign(std::complex<fp3231sat> x, std::complex<fp3231sat> y) { return std::complex<fp3231sat>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	using fp6463sat = sw::universal::fixpnt<64, 63, sw::universal::Saturating, uint32_t>;
	bool isnan(std::complex<fp6463sat> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<fp6463sat> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<fp6463sat> copysign(std::complex<fp6463sat> x, std::complex<fp6463sat> y) { return std::complex<fp6463sat>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }
*/

	/////////////////////////////////            CFLOAT          ////////////////////////////////////////////////

/*  disabling for clang as it is assuming an IEEE-754 type
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/complex:636:23: error: no matching function for call to 'copysign'
                __d = copysign(_Tp(0), __d);
                      ^~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/math.h:512:15: note: candidate function not viable: no known conversion from 'sw::universal::cfloat<8, 3, unsigned char, false, false, false>' to 'double' for 1st argument
extern double copysign(double, double);
              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:1102:40: note: candidate function not viable: no known conversion from 'sw::universal::cfloat<8, 3, unsigned char, false, false, false>' to 'float' for 1st argument
inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
                                       ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include/c++/v1/math.h:1107:1: note: candidate function not viable: no known conversion from 'sw::universal::cfloat<8, 3, unsigned char, false, false, false>' to 'long double' for 1st argument
copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {

	template<size_t nbits, size_t es, typename bt, bool hasSubnormals, bool hasSupernormals, bool isSaturating>
	bool isnan(std::complex<sw::universal::cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating> > x) { return (isnan(x.real()) || isnan(x.imag())); }
	template<size_t nbits, size_t es, typename bt, bool hasSubnormals, bool hasSupernormals, bool isSaturating>
	bool isinf(std::complex<sw::universal::cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating> > x) { return (isinf(x.real()) || isinf(x.imag())); }
	template<size_t nbits, size_t es, typename bt, bool hasSubnormals, bool hasSupernormals, bool isSaturating>
	std::complex<sw::universal::cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating> > copysign(std::complex<sw::universal::cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating> > x,
		std::complex<sw::universal::cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating> > y) {
		return std::complex<sw::universal::cfloat<nbits, es, bt, hasSubnormals, hasSupernormals, isSaturating> > (copysign(x.real(), y.real()), copysign(x.real(), y.real()));
	}

*/

	/////////////////////////////////            POSIT           ////////////////////////////////////////////////
	bool isnan(std::complex<sw::universal::posit<2, 0>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<2, 0>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<2, 0>> copysign(std::complex<sw::universal::posit<2, 0>> x, std::complex<sw::universal::posit<2, 0>> y) { return std::complex<sw::universal::posit<2, 0>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<3, 0>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<3, 0>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<3, 0>> copysign(std::complex<sw::universal::posit<3, 0>> x, std::complex<sw::universal::posit<3, 0>> y) { return std::complex<sw::universal::posit<3, 0>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<3, 1>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<3, 1>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<3, 1>> copysign(std::complex<sw::universal::posit<3, 1>> x, std::complex<sw::universal::posit<3, 1>> y) { return std::complex<sw::universal::posit<3, 1>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<4, 0>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<4, 0>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<4, 0>> copysign(std::complex<sw::universal::posit<4, 0>> x, std::complex<sw::universal::posit<4, 0>> y) { return std::complex<sw::universal::posit<4, 0>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<8, 0>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<8, 0>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<8, 0>> copysign(std::complex<sw::universal::posit<8, 0>> x, std::complex<sw::universal::posit<8, 0>> y) { return std::complex<sw::universal::posit<8, 0>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<8, 1>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<8, 1>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<8, 1>> copysign(std::complex<sw::universal::posit<8, 1>> x, std::complex<sw::universal::posit<8, 1>> y) { return std::complex<sw::universal::posit<8, 1>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<16, 1>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<16, 1>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<16, 1>> copysign(std::complex<sw::universal::posit<16, 1>> x, std::complex<sw::universal::posit<16, 1>> y) { return std::complex<sw::universal::posit<16, 1>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<32, 2>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<32, 2>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<32, 2>> copysign(std::complex<sw::universal::posit<32, 2>> x, std::complex<sw::universal::posit<32, 2>> y) { return std::complex<sw::universal::posit<32, 2>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<64, 3>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<64, 3>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<64, 3>> copysign(std::complex<sw::universal::posit<64, 3>> x, std::complex<sw::universal::posit<64, 3>> y) { return std::complex<sw::universal::posit<64, 3>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<128, 4>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<128, 4>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<128, 4>> copysign(std::complex<sw::universal::posit<128, 4>> x, std::complex<sw::universal::posit<128, 4>> y) { return std::complex<sw::universal::posit<128, 4>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }

	bool isnan(std::complex<sw::universal::posit<256, 5>> x) { return (isnan(x.real()) || isnan(x.imag())); }
	bool isinf(std::complex<sw::universal::posit<256, 5>> x) { return (isinf(x.real()) || isinf(x.imag())); }
	std::complex<sw::universal::posit<256, 5>> copysign(std::complex<sw::universal::posit<256, 5>> x, std::complex<sw::universal::posit<256, 5>> y) { return std::complex<sw::universal::posit<256, 5>>(copysign(x.real(), y.real()), copysign(x.real(), y.real())); }
}

int main()
try {
	using namespace std; // needed for the imaginary literals
	using namespace sw::universal;

	{
		// check if imaginary literals compile
		std::complex<double> c = 0.25 + 0.5i;
		std::cout << "complex variable: " << c << '\n';
	}

	std::cout << "----\ntesting complex conjugate operations for different number types\n";
	TestComplexConjugate<float>();
	TestComplexConjugate<fixpnt<8, 4> >();
	//TestComplexConjugate<cfloat<8, 3> >();  // <-- at this small a float you need subnormals when es < 3 to represent 0.25
	TestComplexConjugate<posit<8, 2> >();

	return EXIT_SUCCESS;
}
catch (char const* msg) {
	std::cerr << "Caught ad-hoc exception: " << msg << std::endl;
	return EXIT_FAILURE;
}
catch (const sw::universal::universal_arithmetic_exception& err) {
	std::cerr << "Caught unexpected universal arithmetic exception: " << err.what() << std::endl;
	return EXIT_FAILURE;
}
catch (const sw::universal::universal_internal_exception& err) {
	std::cerr << "Caught unexpected universal internal exception: " << err.what() << std::endl;
	return EXIT_FAILURE;
}
catch (std::runtime_error& err) {
	std::cerr << "Caught unexpected runtime error: " << err.what() << std::endl;
	return EXIT_FAILURE;
}
catch (...) {
	std::cerr << "Caught unknown exception" << std::endl;
	return EXIT_FAILURE;
}


text:
import java.io.File;
import java.io.*;
import java.io.FileWriter;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

public class UnicodeGenerator {

	public static void main(String[] args) throws IOException {

		// TODO Auto-generated method stub
		Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
		Map<String, List<Double>> featureMap = new HashMap<String, List<Double>>();
		Map<String, String> langMap = new HashMap<String, String>();
		try {
			File fileDir = new File("C:\\Users\\Sneha\\Documents\\study materials\\Independent Study\\entities.txt");
			BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileDir), "UTF-8"));
			String str;
			while ((str = in.readLine()) != null) {

				String splits[] = new String[50];

				splits = str.split("\t");
				//System.out.println(splits[1]);
				String name = splits[3];
			//	System.out.println("hello");
				name = name.toLowerCase();

				if (!map.containsKey(name)) {

					for (int i = 0; i < name.length(); i++) {
						int a = Character.codePointAt(name, i);
						if (map.get(name) == null) {
							map.put(name, new ArrayList<Integer>());
							langMap.put(name, null);
						}
						map.get(name).add(new Integer(a));
						langMap.put(name,splits[2]);

					}
				}

			}
			in.close();
		} catch (UnsupportedEncodingException e) {
			System.out.println(e.getMessage());
		} catch (IOException e) {
			System.out.println(e.getMessage());
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
		for (Map.Entry<String, List<Integer>> entry : map.entrySet()) {
			System.out.println(entry.getKey() + " : " + entry.getValue());
		}

		FileWriter fstream;
		BufferedWriter out;
		fstream = new FileWriter(
				"C:\\Users\\Sneha\\Documents\\study materials\\Independent Study\\values-entities.txt");
		out = new BufferedWriter(fstream);
		Iterator<Entry<String, List<Integer>>> it = map.entrySet().iterator();
		while (it.hasNext()) {

			// the key/value pair is stored here in pairs
			Map.Entry<String, List<Integer>> pairs = it.next();
			out.write(pairs.getKey() + " " + pairs.getValue());
			out.newLine();

		}
		out.close();

		Iterator<Entry<String, List<Integer>>> it1 = map.entrySet().iterator();
		while (it1.hasNext()) {

			// the key/value pair is stored here in pairs
			Map.Entry<String, List<Integer>> pairs = it1.next();
			List<Integer> values = new ArrayList<Integer>();
			values = pairs.getValue();
			String name = pairs.getKey();
			double mean = getMean(values);
			// System.out.println("Mean="+mean);
			double median = getMedian(values);
			// System.out.println("Median: " + median);
			double range = getRange(values);
			// System.out.println("Range: " + range);
			double min = getMin(values);
			// System.out.println("min: " + min);
			double max = getMax(values);

			if (!featureMap.containsKey(name)) {

				featureMap.put(name, new ArrayList<Double>(Arrays.asList(mean, median, range, min, max)));
			} else {
				featureMap.get(name).add(mean);
				featureMap.get(name).add(median);
				featureMap.get(name).add(range);
				featureMap.get(name).add(min);
				featureMap.get(name).add(max);

			}
		}
		FileWriter fwtrain,fwtest;
		BufferedWriter fbwtrain,fbwtest;
		fwtrain = new FileWriter(
				"C:\\Users\\Sneha\\Documents\\study materials\\Independent Study\\features-train.txt");
		fwtest = new FileWriter(
				"C:\\Users\\Sneha\\Documents\\study materials\\Independent Study\\features-test.txt");
		fbwtest = new BufferedWriter(fwtest);
		fbwtrain = new BufferedWriter(fwtrain);
		Iterator<Entry<String, List<Double>>> it2 = featureMap.entrySet().iterator();
		Iterator<Entry<String, String>> it3 = langMap.entrySet().iterator();
		while (it2.hasNext() && it3.hasNext()) {
			Map.Entry<String, List<Double>> pairs1 = it2.next();
			Map.Entry<String, String> pairs2 = it3.next();
			String key = (pairs1.getKey() == pairs2.getKey()) ? pairs1.getKey() : null;
			String lang = pairs2.getValue();
			if(lang=="u"){
				fbwtest.write(pairs1.getKey() + pairs1.getValue() + lang);
				fbwtest.newLine();
			}
			else{
			fbwtrain.write(pairs1.getKey() + pairs1.getValue() + lang);

			fbwtrain.newLine();
			}
		}
		// lastly, close the file and end
		fbwtrain.close();
		fbwtest.close();
	}

	public static double getMean(List<Integer> numberList) {
		double total = 0.0;
		for (int d : numberList) {
			total += d;
		}

		return total / (numberList.size());
	}

	public static double getRange(List<Integer> numberList) {
		double initMin = numberList.get(0);
		double initMax = numberList.get(0);
		for (int i = 1; i < numberList.size(); i++) {
			if (numberList.get(i) < initMin)
				initMin = numberList.get(i);
			if (numberList.get(i) > initMax)
				initMax = numberList.get(i);
		}

		return initMax - initMin;
	}

	public static double getMedian(List<Integer> numberList) {
		Collections.sort(numberList);
		double median = 0;
		double pos1 = Math.floor((numberList.size() - 1.0) / 2.0);
		double pos2 = Math.ceil((numberList.size() - 1.0) / 2.0);
		if (pos1 == pos2) {
			median = numberList.get((int) pos1);
		} else {
			median = (numberList.get((int) pos1) + numberList.get((int) pos2)) / 2.0;
		}

		return median;
	}

	public static double getMin(List<Integer> numberList) {
		Collections.sort(numberList);
		int min = numberList.get(0);
		return min;
	}

	public static double getMax(List<Integer> numberList) {
		Collections.sort(numberList);
		int max = numberList.get(numberList.size() - 1);
		return max;
	}

	public static double getMode(List<Integer> numberList) {

		int[] count = new int[101];
		if (numberList.size() > 0) {
			// count the occurrences
			for (int i = 1; i <= numberList.size(); i++) {
				count[numberList.get(i)]++;
			}

			// go backwards and find the count with the most occurrences
			int index = count.length - 1;
			for (int i = count.length - 2; i >= 0; i--) {
				if (count[i] >= count[index])
					index = i;
			}
			//System.out.println("mde: " + index);
			return index;
		} else
			return -1;
	}

	public int compare(Integer i, Integer j) {
		return i - j;
	}
}


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

<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">

	<changeSet id="change_9" author="aakil">
		<comment>Add reminderminutes to group</comment>
		<sqlFile path="db/scripts/script_9.sql"/>
		<rollback>
            <sqlFile  path="db/scripts/script_9_rollback.sql"/>
        </rollback>
	</changeSet>
</databaseChangeLog>