text:
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/* Kriteria.js */

(function(cxt, global) {
  "use strict";

  var getProperty = require("./lib/getProperty.js").getProperty,
      matchPrefix = require("./lib/matchPrefix.js").matchPrefix,
      Condition = require("./lib/Condition.js").Condition,
      evaluation = require("./lib/evaluation.js").evaluation,
      kref = require("./lib/keys_reference.js").keysReference;

  /**
  * @public
  * @class
  */
  var Kriteria = function Kriteria() {
    this._conditionAnd = [];
    this._conditionOr = [];
    this._not_flg = false;
  };
  Kriteria._name_ = "Kriteria";

  /**
  * @public
  * @function
  * @returns {Condition[]}
  */
  Kriteria.prototype.getConditionAnd = function getConditionAnd() {
    return this._conditionAnd;
  };

  /**
  * @public
  * @function
  * @returns {Condition[]}
  */
  Kriteria.prototype.getConditionOr = function getConditionAOr() {
    return this._conditionOr;
  };

  /**
  * @private
  * @property
  * @description
  */
  Kriteria._JS_OPERATOR = {
    eq: "===",
    ne: "!==",
    lt: "<",
    le: "<=",
    gt: ">",
    ge: ">="
  };

  /**
  * @public
  * @function
  * @param {Condition} condition -
  * @returns {void}
  * @description
  */
  Kriteria.prototype.addAnd = function addAnd(condition) {
    this._conditionAnd[this._conditionAnd.length] = condition;
  };

  /**
  * @public
  * @function
  * @param {Condition} condition -
  * @returns {void}
  * @description
  */
  Kriteria.prototype.addOr = function addOr(condition) {
    this._conditionOr[this._conditionOr.length] = condition;
  };

  /**
  * @public
  * @function
  * @param {Mixed(String|Kriteria|Function)} key - key name or Kriteria instance or Kriteria reqired function
  * @returns {Function} evaluation || {Kriteria}
  * @description
  */
  Kriteria.prototype.and = function and(key) {
    var key_type = typeof key,
        cri = null;

    if(
      key_type === "string" ||
      key instanceof String ||
      key_type === "number" ||
      key instanceof Number
    ) {
      return evaluation("and", key, this);

    } else if(key instanceof Kriteria) {
      cri = key;
      this.addAnd(new Condition("", "", [], "", cri));

      return this;

    } else if(typeof key === "function") {
      cri = new Kriteria();
      key(cri);
      this.addAnd(new Condition("", "", [], "", cri));

      return this;

    } else {
      throw new Error("invalid type of argument. (" + key_type + ")");
    }
  };

  /**
  * @public
  * @function
  * @param {Mixed(String|Kriteria|Function)} key - key name or Kriteria instance or Kriteria reqired function
  * @returns {Mixed(Function|Kriteria)}
  * @description
  */
  Kriteria.prototype.or = function or(key) {
    var key_type = typeof key,
        cri = null;

    if(key_type === "string" ||
       key instanceof String ||
       key_type === "number" ||
       key instanceof Number
      ) {
      return evaluation("or", key, this);

    } else if(key instanceof Kriteria) {
      cri = key;
      this.addOr(new Condition("", "", [], "", cri));

      return this;

    } else if(typeof key === "function") {
      cri = new Kriteria();
      key(cri);
      this.addOr(new Condition("", "", [], "", cri));

      return this;

    } else {
      throw new Error("invalid type of argument. (" + key_type + ")");
    }
  };

  /**
  * @public
  * @function
  * @returns {Kriteria}
  * @description
  */
  Kriteria.prototype.not = function not() {
    this._not_flg = !this._not_flg;

    return this;
  };

  /**
  * @public
  * @static
  * @function
  * @param {Object} conditions -
  *   {Condition[]} conditions.and -
  *   {Condition[]} conditions.or -
  * @returns {Kriteria}
  * @description
  */
  Kriteria.parse = function parse(conditions) {
    var ret = new Kriteria(),
        i = "";

    for(i in conditions.and) {
      ret.addAnd(conditions.and[i]);
    }
    for(i in conditions.or) {
      ret.andOr(conditions.or[i]);
    }
    if(conditions.not) {
      ret.not();
    }

    return ret;
  };

  /**
  * @public
  * @function
  * @param {Object} data -
  * @returns {Boolean}
  * @description
  */
  Kriteria.prototype.match = function match(data) {
    var i = 0, l = 0,
        j = 0, l2 = 0,
        left_key = "",
        operator = "",
        right_key = [],
        key_type = "",
        left_value = null,
        right_value = [],
        result = false,
        condition = null,
        tmp_right_value = null;

    for(i = 0, l = this._conditionAnd.length; i < l; i = i + 1) {
      condition = this._conditionAnd[i];

      if(condition.criteria instanceof Kriteria) {
        result = condition.criteria.match(data);

        // and条件は1つでもfalseがあったら、結果はfalse
        if(!result) {
          break;
        }

      } else {
        left_key = condition.left_key;
        operator = condition.operator;
        right_key = condition.right_key;
        key_type = condition.key_type;
        left_value = getProperty(data, left_key);

        if(key_type === "value") {
          right_value = right_key;

        } else if(key_type === "key") {
          tmp_right_value = getProperty(data, right_key[0]);

          if(Array.isArray(tmp_right_value)) {
            if(operator === "match" || operator === "not_match") {
              right_value = [];

              for(j = 0, l2 = tmp_right_value.length; j < l2; j = j + 1) {
                if(tmp_right_value[j] === null
                   || tmp_right_value[j] === void 0
                   || tmp_right_value[j] === "") {
                  right_value[j] = tmp_right_value[j];

                } else {
                  right_value[j] = new RegExp(tmp_right_value[j]);
                }
              }

            } else {
              right_value = tmp_right_value;
            }

          } else {
            if(operator === "match" || operator === "not_match") {
              if(tmp_right_value === null
                 || tmp_right_value === void 0
                 || tmp_right_value === "") {
                right_value = tmp_right_value;

              } else {
                right_value = [new RegExp(tmp_right_value)];
              }

            } else {
              right_value = [tmp_right_value];
            }
          }
        }

        if(
          right_value === void 0
          || !!~right_value.indexOf(void 0)
          || left_value === void 0
        ) {
          // valueがundefinedの場合はfalse
          result = false;

        } else {
          // 上記以外は比較演算
          result = this._compare(left_value, operator, right_value);
        }

        // and条件は1つでもfalseがあったら、結果はfalse
        if(!result) {
          break;
        }
      }
    }

    // and条件ですべて一致した場合
    if(result) {
      return !!(true ^ this._not_flg);
    }

    for(i = 0, l = this._conditionOr.length; i < l; i = i + 1) {
      condition = this._conditionOr[i];

      if(condition.criteria instanceof Kriteria) {
        result = condition.criteria.match(data);
        if(result) {
          return !!(true ^ this._not_flg);
        }

      } else {
        left_key = condition.left_key;
        operator = condition.operator;
        right_key = condition.right_key;
        key_type = condition.key_type;
        left_value = getProperty(data, left_key);

        if(key_type === "value") {
          right_value = right_key;

        } else if(key_type === "key") {
          tmp_right_value = getProperty(data, right_key[0]);

          if(Array.isArray(tmp_right_value)) {
            if(operator === "match" || operator === "not_match") {
              right_value = [];

              for(j = 0, l2 = tmp_right_value.length; j < l2; j = j + 1) {
                if(tmp_right_value[j] === null
                   || tmp_right_value[j] === void 0
                   || tmp_right_value[j] === "") {
                  right_value[j] = tmp_right_value[j];

                } else {
                  right_value[j] = new RegExp(tmp_right_value[j]);
                }
              }

            } else {
              right_value = tmp_right_value;
            }
          } else {
            if(operator === "match" || operator === "not_match") {
              if(tmp_right_value === null
                 || tmp_right_value === void 0
                 || tmp_right_value !== "") {
                right_value = tmp_right_value;

              } else {
                right_value = [new RegExp(tmp_right_value)];
              }

            } else {
              right_value = [tmp_right_value];
            }
          }
        }

        if(
          right_value === void 0
          || !!~right_value.indexOf(void 0)
          || left_value === void 0
        ) {
          // valueがundefinedの場合はfalse
          result = false;

        } else {
          // 上記以外は比較演算
          result = this._compare(left_value, operator, right_value);
        }

        // or条件は1つでもtrueがあったら、結果はtrue
        if(result) {
          return !!(true ^ this._not_flg);
        }
      }
    }

    // 上記以外はfalse
    return !!(false ^ this._not_flg);
  };

  /**
  * @private
  * @function
  * @param {Mixed(String|Number)} value1 -
  * @param {String} operator -
  * @param {Array} value2 -
  * @returns {Boolean}
  * @description
  */
  Kriteria.prototype._compare = function _compare(value1, operator, value2) {
    var result = false;

    switch(operator) {
      case "eq":
        result = (value2[0] === value1);
        break;

      case "ne":
        result = (value2[0] !== value1);
        break;

      case "lt":
        result = (value2[0] > value1);
        break;

      case "le":
        result = (value2[0] >= value1);
        break;

      case "gt":
        result = (value2[0] < value1);
        break;

      case "ge":
        result = (value2[0] <= value1);
        break;

      case "in":
        result = !!~value2.indexOf(value1);
        break;

      case "not_in":
        result = !~value2.indexOf(value1);
        break;

      case "between":
        result = (value2[0] <= value1 && value2[1] >= value1);
        break;

      case "not_between":
        result = (value2[0] > value1 || value2[1] < value1);
        break;

      case "match":
        if(value2[0] === null) {
          if(value1 === null || value1 === void 0) {
            result = true;
          } else {
            result = false;
          }

        } else if(value1 === null) {
          result = false;

        } else if(value2[0] === "") {
          result = value1 === "" ? true : false;

        } else {
          result = value2[0].test(value1);
        }
        break;

      case "not_match":
        if(value2[0] === null) {
          if(value1 === null || value1 === void 0) {
            result = false;
          } else {
            result = true;
          }

        } else if(value1 === null) {
          result = true;

        } else if(value2[0] === "") {
          result = value1 === "" ? false : true;

        } else {
          result = !value2[0].test(value1);
        }
        break;
    }

    return result;
  };

  /**
  * @public
  * @function
  * @returns {Function}
  * @description
  */
  Kriteria.prototype.matcher = function matcher() {
    /* eslint no-new-func: 0 */
    return new Function("$", "return " + this._createMatchingExpression());
  };

  /**
  * @private
  * @function
  * @returns {String}
  * @description
  */
  Kriteria.prototype._createMatchingExpression = function _createMatchingExpression() {
    var i = 0, l = 0,
        expAnd = [],
        expOr = [],
        retAnd = "",
        retOr = "",
        condition = null,
        ret = "";

    for(i = 0, l = this._conditionAnd.length; i < l; i = i + 1) {
      condition = this._conditionAnd[i];

      if(condition.criteria instanceof Kriteria) {
        expAnd[expAnd.length] = "(" + condition.criteria._createMatchingExpression() + ")";

      } else {
        expAnd[expAnd.length] = this._createExpression(condition);
      }
    }

    for(i = 0, l = this._conditionOr.length; i < l; i = i + 1) {
      condition = this._conditionOr[i];

      if(condition.criteria instanceof Kriteria) {
        expOr[expOr.length] = "(" + condition.criteria._createMatchingExpression() + ")";

      } else {
        expOr[expOr.length] = this._createExpression(condition);
      }
    }

    retAnd = expAnd.join(" && ");
    retOr = expOr.join(" || ");

    if(retAnd && retOr) {
      ret = retAnd + " || " + retOr + " ";
    } else if(!retOr) {
      ret = retAnd;
    } else if(!retAnd) {
      ret = retOr;
    }

    if(this._not_flg) {
      ret = "!(" + ret + ")";
    }

    return ret;
  };

  /**
  * @private
  * @function
  * @param {Condition} condition -
  * @returns {String}
  * @description
  */
  Kriteria.prototype._createExpression = function _createExpression(condition) {
    return "(" +
      this._createJsExpressionOfKeyIsNotUndefined(condition.left_key) +
      " && " +
      (
        condition.key_type === "key" ?
          this._createJsExpressionOfKeyIsNotUndefined(condition.right_key[0]) + " && " :
          ""
      ) +
      this._createJsExpression(condition) +
      ")";
  };

  /**
  * @private
  * @function
  * @param {Condition}
  * @returns {String}
  * @description
  */
  Kriteria.prototype._createJsExpression = function _createJsExpression(condition) {
    var left_key = kref("$", condition.left_key.split(".")),
        operator = condition.operator,
        right_key = condition.right_key,
        key_type = condition.key_type,
        _operator = Kriteria._JS_OPERATOR[operator],
        $_right_key = kref("$", right_key[0]).toString();

    if(_operator) {
      /* 演算子が eq, ne, lt, le, gt, ge のいずれか
           [left_key] [operator] "[right_key]"
           [left_key] [operator] $.[right_key]
      */
      return left_key + " " + _operator + " " +
             this._toStringExpressionFromValue(right_key[0], key_type);

    } else if(operator === "in") {
      /* in 演算子
           !!~[[right_key]].indexOf([left_key])
           (Array.isArray($.[right_key]) ? !!~$.[right_key].indexOf([left_key]) : $.[right_key] === [left_key])
      */
      if(key_type === "value") {
        return "!!~" + this._toStringExpressionFromArray(right_key) + ".indexOf(" + left_key + ")";

      } else {
        return "(Array.isArray(" + $_right_key + ") ? " +
               "!!~" + $_right_key + ".indexOf(" + left_key + "): " +
               $_right_key + " === " + left_key + ")";
      }

    } else if(operator === "not_in") {
      /* not_in 演算子
      */
      if(key_type === "value") {
        return "!~" + this._toStringExpressionFromArray(right_key) + ".indexOf(" + left_key + ")";

      } else {
        return "(Array.isArray(" + $_right_key + ") ? " +
               "!~" + $_right_key + ".indexOf(" + left_key + "): " +
               $_right_key + " !== " + left_key + ")";
      }

    } else if(operator === "between") {
      /* between 演算子
      */
      return left_key + " >= " + this._toStringExpressionFromValue(right_key[0], key_type) +
             " && " +
             left_key + " <= " + this._toStringExpressionFromValue(right_key[1], key_type);

    } else if(operator === "not_between") {
      /* not_between 演算子
      */
      return left_key + " < " + this._toStringExpressionFromValue(right_key[0], key_type) +
             " || " +
             left_key + " > " + this._toStringExpressionFromValue(right_key[1], key_type);

    } else if(operator === "match") {
      /* match 演算子
      */
      if(right_key[0] === void 0) {
        return false;

      } else if(right_key[0] === null) {
        return "(" + left_key + " === null ? true : false)";

      } else if(right_key[0] === "") {
        return "(" + left_key + " === '' ? true : false)";

      } else {
        //return "(" + left_key + " !== null && " + right_key[0] + ".test(" + left_key + "))";
        return "(" + right_key[0] + ".test(" + left_key + "))";
      }

    } else if(operator === "not_match") {
      /* not_match 演算子
      */
      if(right_key[0] === void 0) {
        return false;

      } else if(right_key[0] === null) {
        return "(" + left_key + " === null ? false : true)";

      } else if(right_key[0] === "") {
        return "(" + left_key + " === '' ? false : true)";

      } else {
        //return "(" + left_key + " !== null && !" + right_key[0] + ".test(" + left_key + "))";
        return "(!" + right_key[0] + ".test(" + left_key + "))";
      }

    } else {
      return null;
    }
  };

  /**
  * @private
  * @function
  * @param {String} key -
  * @returns {String}
  * @description
  */
  Kriteria.prototype._createJsExpressionOfKeyIsNotUndefined =
    function _createJsExpressionOfKeyIsNotUndefined(key) {
    var keys = key.split("."),
        work_keys = [],
        ret = [];

    for(var i = 0, l = keys.length; i < l; i = i + 1) {
      work_keys[work_keys.length] = keys[i];
      ret[ret.length] = kref("$", work_keys).toString() + " !== void 0";
    }

    return ret.join(" && ");
  };

  /**
  * @private
  * @function
  * @param {String} key -
  * @returns {String}
  * @description
  */
  Kriteria.prototype._createJSExpressionOfKeyIsUndefined =
    function _createJSExpressionOfKeyIsUndefined(key) {
    var keys = key.split("."),
        work_keys = [],
        ret = [];

    for(var i = 0, l = keys.length; i < l; i = i + 1) {
      work_keys[work_keys.length] = keys[i];

      var $_work_keys = kref("$", work_keys);

      ret[ret.length] = $_work_keys + " === void 0";
      ret[ret.length] = $_work_keys + " === null";
    }

    return ret.join(" || ");
  };

  /**
  * @private
  * @function
  * @param {Array} arr -
  * @returns {String}
  * @description
  */
  Kriteria.prototype._toStringExpressionFromArray = function _toStringExpressionFromArray(arr) {
    var ret = [];

    for(var i = 0, l = arr.length; i < l; i = i + 1) {
      ret[ret.length] = this._toStringExpressionFromValue(arr[i], "value");
    }

    return "[" + ret.join(", ") + "]";
  };

  /**
  * @private
  * @function
  * @param {Mixed(String|Number)} value -
  * @param {String} type -
  * @returns {String}
  * @description
  */
  Kriteria.prototype._toStringExpressionFromValue =
    function _toStringExpressionFromValue(value, type) {
    if(type === "value" && (typeof value === "string" || value instanceof String)) {
      return '"' + value + '"';

    } else if(type === "key") {
      return kref("$", value.split(".")).toString();

    } else {
      return value + '';
    }
  };

  /**
  * @public
  * @function
  * @param {String[]} prefixes -
  * @returns {Object.<Kriteria>}
  */
  Kriteria.prototype.splitByKeyPrefixes = function splitByKeyPrefixes(prefixes) {
    if(!Array.isArray(prefixes) || prefixes.length === 0) {
      return null;
    }

    var ret = {},
        condition = null,
        splited_criteria = null,
        matchPrefixes = [],
        left_key = "",
        right_key = "",
        key_type = "",
        match1 = true,
        match2 = true,
        added = true,
        key = "",
        i = 0, l = 0,
        j = 0, l2 = 0;

    for(i = 0, l = prefixes.length; i < l; i = i + 1) {
      ret[prefixes[i]] = new Kriteria();
    }
    ret.else = new Kriteria();

    for(i = 0, l = this._conditionAnd.length; i < l; i = i + 1) {
      condition = this._conditionAnd[i];

      if(condition.criteria instanceof Kriteria) {
        splited_criteria = condition.criteria.splitByKeyPrefixes(prefixes);

        for(key in splited_criteria) {
          if(splited_criteria[key] !== null) {
            ret[key].and(splited_criteria[key]);
          }
        }

      } else {
        matchPrefixes = [];
        left_key = condition.left_key;
        right_key = condition.right_key[0];
        key_type = condition.key_type;
        added = false;

        for(j = 0, l2 = prefixes.length; j < l2; j = j + 1) {
          matchPrefixes[matchPrefixes.length] = prefixes[j];

          match1 = matchPrefix(left_key, matchPrefixes);
          if(key_type === "key") {
            match2 = matchPrefix(right_key, matchPrefixes);
          }

          if(
            (key_type === "value" && match1) ||
            (key_type === "key" && match1 && match2)
          ) {
            ret[prefixes[j]].addAnd(condition);
            added = true;
            break;
          }
        }

        if(!added) {
          ret.else.addAnd(condition);
        }
      }
    }

    for(i = 0, l = this._conditionOr.length; i < l; i = i + 1) {
      condition = this._conditionOr[i];

      if(condition.criteria instanceof Kriteria) {
        splited_criteria = condition.criteria.splitByKeyPrefixes(prefixes);

        for(key in splited_criteria) {
          if(splited_criteria[key] !== null) {
            ret[key].or(splited_criteria[key]);
          }
        }

      } else {
        matchPrefixes = [];
        left_key = condition.left_key;
        right_key = condition.right_key[0];
        key_type = condition.key_type;
        added = false;

        for(j = 0, l2 = prefixes.length; j < l2; j = j + 1) {
          matchPrefixes[matchPrefixes.length] = prefixes[j];

          match1 = matchPrefix(left_key, matchPrefixes);
          if(key_type === "key") {
            match2 = matchPrefix(right_key, matchPrefixes);
          }

          if(
            (key_type === "value" && match1) ||
            (key_type === "key" && match1 && match2)
          ) {
            ret[prefixes[j]].addOr(condition);
            added = true;
            break;
          }
        }

        if(!added) {
          ret.else.addOr(condition);
        }
      }
    }

    for(key in ret) {
      if(ret[key].getConditionAnd().length > 0 || ret[key].getConditionOr().length > 0) {
        ret[key]._not_flg = this._not_flg;
      } else {
        ret[key] = null;
      }
    }
    return ret;
  };

  /**
  * @public
  * @function
  * @param {Kriteria} kri -
  * @param {Boolean} unique -
  * @returns {Kriteria}
  */
  Kriteria.prototype.merge = function merge(kri, unique) {
    var new_kriteria = new Kriteria(),
        kri_cond_and = kri.getConditionAnd(),
        kri_cond_or = kri.getConditionOr(),
        cond1 = null,
        match = false,
        i = 0, l = 0,
        j = 0, l2 = 0;

    if(this._not_flg !== kri._not_flg) {
      throw new Error("Kriteria#merge - collision to not flag.");
    }

    for(i = 0, l = this._conditionAnd.length; i < l; i = i + 1) {
      new_kriteria.addAnd(this._conditionAnd[i]);
    }

    for(i = 0, l = this._conditionOr.length; i < l; i = i + 1) {
      new_kriteria.addOr(this._conditionOr[i]);
    }

    if(!unique) {
      for(i = 0, l = kri_cond_and.length; i < l; i = i + 1) {
        new_kriteria.addAnd(kri_cond_and[i]);
      }

      for(i = 0, l = kri_cond_or.length; i < l; i = i + 1) {
        new_kriteria.addOr(kri_cond_or[i]);
      }

    } else {
      for(i = 0, l = kri_cond_and.length; i < l; i = i + 1) {
        cond1 = kri_cond_and[i];
        match = false;

        for(j = 0, l2 = this._conditionAnd.length; j < l2; j = j + 1) {
          if(cond1.compareTo(this._conditionAnd[j]) === 0) {
            match = true;
            break;
          }
        }

        if(!match) {
          new_kriteria.addAnd(cond1);
        }
      }

      for(i = 0, l = kri_cond_or.length; i < l; i = i + 1) {
        cond1 = kri_cond_or[i];
        match = false;

        for(j = 0, l2 = this._conditionOr.length; j < l2; j = j + 1) {
          if(cond1.compareTo(this._conditionOr[j]) === 0) {
            match = true;
            break;
          }
        }

        if(!match) {
          new_kriteria.addOr(cond1);
        }
      }
    }

    return new_kriteria;
  };

  /**
  * @public
  * @function
  * @param {Kriteria} kri -
  * @returns {Number}
  *    0 - equal
  *    1 - greater
  *   -1 - less
  */
  Kriteria.prototype.compareTo = function compareTo(kri) {
    var sort_func = function(a, b) {
          return a.compareTo(b);
        },
        kri_cond_and = kri.getConditionAnd(),
        kri_cond_or = kri.getConditionOr(),
        cond1 = null,
        cond2 = null,
        compared = true,
        len1 = 0, len2 = 0,
        i = 0, l = 0;

    this._conditionAnd.sort(sort_func);
    kri_cond_and.sort(sort_func);
    this._conditionOr.sort(sort_func);
    kri_cond_or.sort(sort_func);

    if(this._not_flg && !kri._not_flg) {
      return -1;
    } else if(!this._not_flg && kri._not_flg) {
      return 1;
    }

    len1 = this._conditionAnd.length;
    len2 = kri_cond_and.length;
    l = len1 > len2 ? len1 : len2;
    for(i = 0; i < l; i = i + 1) {
      cond1 = this._conditionAnd[i];
      cond2 = kri_cond_and[i];

      if(!cond1) {
        return -1;
      } else if(!cond2) {
        return 1;
      }

      compared = cond1.compareTo(cond2);

      if(compared !== 0) {
        return compared;
      }
    }

    len1 = this._conditionOr.length;
    len2 = kri_cond_or.length;
    l = len1 > len2 ? len1 : len2;
    for(i = 0; i < l; i = i + 1) {
      cond1 = this._conditionOr[i];
      cond2 = kri_cond_or[i];

      if(!cond1) {
        return -1;
      } else if(!cond2) {
        return 1;
      }

      compared = cond1.compareTo(cond2);

      if(compared !== 0) {
        return compared;
      }
    }

    return 0;
  };

  /**
  * @public
  * @function
  * @param {String[]} prefixes -
  * @returns {Kriteria}
  */
  Kriteria.prototype.removePrefixes = function removePrefixes(prefixes) {
    var rex = null,
        condition = null,
        i = 0, l = 0;

    if(prefixes === null || prefixes === void 0 || !Array.isArray(prefixes) || prefixes.length === 0) {
      return this;
    }

    rex = new RegExp("^(" + prefixes.join("|") + ").");

    for(i = 0, l = this._conditionAnd.length; i < l; i = i + 1) {
      condition = this._conditionAnd[i];

      if(condition.criteria instanceof Kriteria) {
        condition.criteria.removePrefixes(prefixes);

      } else {
        condition.left_key = condition.left_key.replace(rex, "");
        if(condition.key_type === "key") {
          condition.right_key[0] = condition.right_key[0].replace(rex, "");
        }
      }
    }

    for(i = 0, l = this._conditionOr.length; i < l; i = i + 1) {
      condition = this._conditionOr[i];

      if(condition.criteria instanceof Kriteria) {
        condition.criteria.removePrefixes(prefixes);

      } else {
        condition.left_key = condition.left_key.replace(rex, "");
        if(condition.key_type === "key") {
          condition.right_key[0] = condition.right_key[0].replace(rex, "");
        }
      }
    }

    return this;
  };

  cxt.Kriteria = Kriteria;
  global.Kriteria = Kriteria;

}(this, (0, eval)("this").window || this));

},{"./lib/Condition.js":2,"./lib/evaluation.js":3,"./lib/getProperty.js":4,"./lib/keys_reference.js":5,"./lib/matchPrefix.js":6}],2:[function(require,module,exports){
/* Condition.js */

(function (cxt) {
  "use strict";

  /**
  * @public
  * @class
  * @param {String} left_key -
  * @param {String} operator -
  * @param {Mixed(Array<any>|any)} right_key -
  * @param {String} key_type -
  * @param {Kriteria} criteria
  * @description
  */
  var Condition = function Condition(left_key, operator, right_key, key_type, criteria) {
    this.left_key = left_key;
    this.operator = operator;
    this.right_key = (Array.isArray(right_key) || right_key === void 0 || right_key === null) ?
      right_key : [right_key];
    this.key_type = key_type;
    this.criteria = criteria;
  };

  /**
  * @public
  * @function
  * @returns {Condition}
  * @description
  */
  Condition.prototype.clone = function clone() {
    return new Condition(this.left_key, this.operator, this.right_key.concat(), this.key_type, this.criteria);
  };

  /**
  * @public
  * @function
  * @returns {Conditons}
  * @description
  */
  Condition.prototype.not = function not() {
    switch(this.operator) {
      case "eq":
        this.operator = "ne";
        break;

      case "ne":
        this.operator = "eq";
        break;

      case "lt":
        this.operator = "ge";
        break;

      case "le":
        this.operator = "gt";
        break;

      case "gt":
        this.operator = "le";
        break;

      case "ge":
        this.operator = "lt";
        break;

      case "in":
        this.operator = "not_in";
        break;

      case "not_in":
        this.operator = "in";
        break;

      case "between":
        this.operator = "not_between";
        break;

      case "not_between":
        this.operator = "between";
        break;

      case "match":
        this.operator = "not_match";
        break;

      case "not_match":
        this.operator = "match";
        break;

    }

    return this;
  };

  /**
  * @public
  * @function
  * @returns Array<Condition>
  */
  Condition.prototype.normalize = function normalize() {
    var ret = [],
        i = 0, l = 0;

    if(this.key_type === "value") {
      switch(this.operator) {
        case "in":
          for(i = 0, l = this.right_key.length; i < l; i = i + 1) {
            ret[ret.length] = new Condition(
              this.left_key, "eq", [this.right_key[i]], this.key_type, null)
            ;
          }
          break;

        case "not_in":
          for(i = 0, l = this.right_key.length; i < l; i = i + 1) {
            ret[ret.length] = new Condition(
              this.left_key, "ne", [this.right_key[i]], this.key_type, null
            );
          }
          break;

        case "between":
          ret[ret.length] = new Condition(
            this.left_key, "ge", [this.right_key[0]], this.key_type, null
          );
          ret[ret.length] = new Condition(
            this.left_key, "le", [this.right_key[1]], this.key_type, null
          );
          break;

        case "not_between":
          ret[ret.length] = new Condition(
            this.left_key, "lt", [this.right_key[0]], this.key_type, null
          );
          ret[ret.length] = new Condition(
            this.left_key, "gt", [this.right_key[1]], this.key_type, null
          );
          break;

        default:
          ret[ret.length] = this.clone();
          break;
      }

    } else {
      ret[ret.length] = this.clone();
    }

    return ret;
  };

  /**
  * @public
  * @function
  * @param {Condition} cond -
  * @returns {Number}
  *    0 - equal
  *    1 - greater
  *   -1 - less
  */
  Condition.prototype.compareTo = function compareTo(cond) {
    if(this.criteria && !cond.criteria) {
      return 1;

    } else if(!this.criteria && cond.criteria) {
      return -1;

    } else if(this.criteria && cond.criteria) {
      return this.criteria.compareTo(cond.criteria);

    } else if(this.left_key > cond.left_key) {
      return 1;

    } else if(this.left_key < cond.left_key) {
      return -1;

    } else if(this.operator > cond.operator) {
      return 1;

    } else if(this.operator < cond.operator) {
      return -1;

    } else if(this.key_type > cond.key_type) {
      return 1;

    } else if(this.key_type < cond.key_type) {
      return -1;

    } else {
      for(var i = 0, l = this.right_key.length; i < l; i = i + 1) {
        if(this.right_key[i] > cond.right_key[i]) {
          return 1;
        } else if(this.right_key[i] < cond.right_key[i]) {
          return -1;
        }
      }

      return 0;
    }
  };

  cxt.Condition = Condition;

})(this);

},{}],3:[function(require,module,exports){
/* evaluation.js */

(function (cxt){
  "use strict";

  var Condition = require('./Condition.js').Condition;

  /**
  * @public
  * @function
  * @param {String} type -
  * @param {String} left_key -
  * @param {Kriteria} criteria -
  * @returns {Object<[eq|ne|lt|le|gt|ge|in|not_in].[key|value]>|between}
  * @description
  */
  var evaluation = function evaluation(type, left_key, criteria) {
    return {
      eq: {
        key: function(value) {
          _setToCriteria(criteria, type, "eq", left_key, "key", [value]);
          return criteria;
        },
        value: function(value) {
          _setToCriteria(criteria, type, "eq", left_key, "value", [value]);
          return criteria;
        }
      },
      ne: {
        key: function(value) {
          _setToCriteria(criteria, type, "ne", left_key, "key", [value]);
          return criteria;
        },
        value: function(value) {
          _setToCriteria(criteria, type, "ne", left_key, "value", [value]);
          return criteria;
        }
      },
      lt: {
        key: function(value) {
          _setToCriteria(criteria, type, "lt", left_key, "key", [value]);
          return criteria;
        },
        value: function(value) {
          _setToCriteria(criteria, type, "lt", left_key, "value", [value]);
          return criteria;
        }
      },
      le: {
        key: function(value) {
          _setToCriteria(criteria, type, "le", left_key, "key", [value]);
          return criteria;
        },
        value: function(value) {
          _setToCriteria(criteria, type, "le", left_key, "value", [value]);
          return criteria;
        }
      },
      gt: {
        key: function(value) {
          _setToCriteria(criteria, type, "gt", left_key, "key", [value]);
          return criteria;
        },
        value: function(value) {
          _setToCriteria(criteria, type, "gt", left_key, "value", [value]);
          return criteria;
        }
      },
      ge: {
        key: function(value) {
          _setToCriteria(criteria, type, "ge", left_key, "key", [value]);
          return criteria;
        },
        value: function(value) {
          _setToCriteria(criteria, type, "ge", left_key, "value", [value]);
          return criteria;
        }
      },
      in: {
        key: function() {
          _setToCriteria(criteria, type, "in", left_key, "key", [arguments[0]]);
          return criteria;
        },
        value: function() {
          _setToCriteria(
            criteria,
            type,
            "in",
            left_key,
            "value",
            Array.isArray(arguments[0]) ? arguments[0] : [].slice.apply(arguments)
          );
          return criteria;
        }
      },
      not_in: {
        key: function() {
          _setToCriteria(criteria, type, "not_in", left_key, "key", [arguments[0]]);
          return criteria;
        },
        value: function() {
          _setToCriteria(
            criteria,
            type,
            "not_in",
            left_key,
            "value",
            Array.isArray(arguments[0]) ? arguments[0] : [].slice.apply(arguments)
          );
          return criteria;
        }
      },
      between: function(value1, value2) {
        _setToCriteria(criteria, type, "between", left_key, "value", [value1, value2]);
        return criteria;
      },
      not_between: function(value1, value2) {
        _setToCriteria(criteria, type, "not_between", left_key, "value", [value1, value2]);
        return criteria;
      },
      match: function(value) {
        var _value = value instanceof RegExp ? value :
                     value === null ? null :
                     value === void 0 ? void 0 :
                     value === "" ? "" : new RegExp(value);
        _setToCriteria(criteria, type, "match", left_key, "value", [_value]);
        return criteria;
      },
      not_match: function(value) {
        var _value = value instanceof RegExp ? value :
                     value === null ? null :
                     value === void 0 ? void 0 :
                     value === "" ? "" : new RegExp(value);
        _setToCriteria(criteria, type, "not_match", left_key, "value", [_value]);
        return criteria;
      }
    };
  };

  /**
  * @private
  * @function
  * @param {Kriteria} criteria -
  * @param {String} type -
  * @param {String} operator -
  * @param {String} key_name -
  * @param {Array<String>} values -
  * @returns {void}
  * @description
  */
  var _setToCriteria = function _setToCriteria(criteria, type, operator, key_name, key_type, values) {
    if(type.toLowerCase() === "and") {
      criteria.addAnd(new Condition(key_name, operator, values, key_type, null));

    } else if(type.toLowerCase() === "or") {
      criteria.addOr(new Condition(key_name, operator, values, key_type, null));

    } else {
      throw new Error(
        "invalid type: " + type +
        "(at key_name:" + key_name + ", key_type: " + key_type + ", operator:" + operator + ")"
      );
    }
  };

  cxt.evaluation = evaluation;

})(this);

},{"./Condition.js":2}],4:[function(require,module,exports){
/* getProperty.js */

(function (cxt) {
  'use strict';

  var getProperty = function getProperty(obj, key) {
    var keys = key.split('.'),
        ret = obj;

    for(var i = 0, l = keys.length; i < l; i += 1) {
      if(
        typeof ret === "string" ||
        ret instanceof String ||
        typeof ret === "number" ||
        ret instanceof Number
      ) {
        return void 0;

      } else if(keys[i] in ret) {
        ret = ret[keys[i]];

      } else {
        return void 0;
      }
    }

    return ret;
  };

  cxt.getProperty = getProperty;

})(this);

},{}],5:[function(require,module,exports){
/* keys_reference.js */

(function(global, cxt) {
  "use strict";

  var KeysReferenceInstance = function KeysReferenceInstance(target) {
    this._target = target;
    this._q = "'";
    this._keys = [];
  };

  KeysReferenceInstance.prototype.toString = function toString() {
    var ret = this._target,
        keys = this._keys,
        q = this._q;

    for(var i = 0, l = keys.length; i < l; i = i + 1) {
      ret = ret + "[" + q + keys[i] + q + "]";
    }

    return ret;
  };

  KeysReferenceInstance.prototype.setQuote = function setQuote(q) {
    if(isString(q)) {
      this._q = q;
    }
  };

  KeysReferenceInstance.prototype.add = function add(key) {
    this._keys[this._keys.length] = key;
  };

  var keysReference = function keysReference(obj, keys, opt) {
    var ins = new KeysReferenceInstance(obj);

    if(opt && isString(opt.q)) {
      ins.setQuote(opt.q);
    }

    if(Array.isArray(keys)) {
      for(var i = 0, l = keys.length; i < l; i = i + 1) {
        ins.add(keys[i]);
      }

    } else {
      ins.add(keys);
    }

    return ins;
  };

  var isString = function isString(obj) {
    return typeof obj === "string" || obj instanceof String;
  };

  //global.keysReference = keysReference;
  cxt.keysReference = keysReference;

}((0, eval)("this"), this));

},{}],6:[function(require,module,exports){
/* matchPrefix.js */

(function(cxt) {
  "use strict";

  /**
  * @public
  * @function
  * @param {String} str -
  * @param {String[]} prefixes -
  * @returns {Boolean}
  */
  var matchPrefix = function matchPrefix(str, prefixes) {
    if(prefixes.length === 0) {
      return true;
    }

    for(var i = 0, l = prefixes.length; i < l; i = i + 1) {
      if(str.indexOf(prefixes[i] + ".") === 0) {
        return true;
      }
    }

    return false;
  };

  cxt.matchPrefix = matchPrefix;

}(this));

},{}]},{},[1]);


text:
package org.apache.geode.internal.process;

import static org.apache.commons.lang.Validate.isTrue;
import static org.apache.commons.lang.Validate.notNull;

import java.io.InputStream;

import org.apache.commons.lang.SystemUtils;

/**
 * Reads the output stream of a Process.
 *
 * @since GemFire 7.0
 */
public abstract class ProcessStreamReader implements Runnable {

  private static final int DEFAULT_PROCESS_OUTPUT_WAIT_TIME_MILLIS = 5000;

  protected final Process process;
  protected final InputStream inputStream;
  protected final InputListener inputListener;

  private Thread thread;

  protected ProcessStreamReader(final Builder builder) {
    notNull(builder, "Invalid builder '" + builder + "' specified");

    this.process = builder.process;
    this.inputStream = builder.inputStream;

    if (builder.inputListener == null) {
      this.inputListener = new InputListener() {
        @Override
        public void notifyInputLine(String line) {
          // do nothing
        }

        @Override
        public String toString() {
          return "NullInputListener";
        }
      };
    } else {
      this.inputListener = builder.inputListener;
    }
  }

  public ProcessStreamReader start() {
    synchronized (this) {
      if (thread == null) {
        thread = new Thread(this, createThreadName());
        thread.setDaemon(true);
        thread.start();
      } else if (thread.isAlive()) {
        throw new IllegalStateException(this + " has already started");
      } else {
        throw new IllegalStateException(this + " was stopped and cannot be restarted");
      }
    }
    return this;
  }

  public ProcessStreamReader stop() {
    synchronized (this) {
      if (thread != null && thread.isAlive()) {
        thread.interrupt();
      }
    }
    return this;
  }

  public ProcessStreamReader stopAsync(final long delayMillis) {
    Runnable delayedStop = () -> {
      try {
        Thread.sleep(delayMillis);
      } catch (InterruptedException ignored) {
      } finally {
        stop();
      }
    };

    String threadName =
        getClass().getSimpleName() + " stopAfterDelay Thread @" + Integer.toHexString(hashCode());
    Thread thread = new Thread(delayedStop, threadName);
    thread.setDaemon(true);
    thread.start();
    return this;
  }

  public boolean isRunning() {
    synchronized (this) {
      if (thread != null) {
        return thread.isAlive();
      }
    }
    return false;
  }

  public ProcessStreamReader join() throws InterruptedException {
    Thread thread;
    synchronized (this) {
      thread = this.thread;
    }
    if (thread != null) {
      thread.join();
    }
    return this;
  }

  public ProcessStreamReader join(final long millis) throws InterruptedException {
    Thread thread;
    synchronized (this) {
      thread = this.thread;
    }
    if (thread != null) {
      thread.join(millis);
    }
    return this;
  }

  public ProcessStreamReader join(final long millis, final int nanos) throws InterruptedException {
    Thread thread;
    synchronized (this) {
      thread = this.thread;
    }
    if (thread != null) {
      thread.join(millis, nanos);
    }
    return this;
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder(getClass().getSimpleName());
    sb.append(" Thread").append(" #").append(System.identityHashCode(this));
    sb.append(" alive=").append(isRunning());
    sb.append(" listener=").append(inputListener);
    return sb.toString();
  }

  private String createThreadName() {
    return getClass().getSimpleName() + '@' + Integer.toHexString(hashCode());
  }

  /**
   * Defines the callback for lines of output found in the stream.
   */
  public interface InputListener {
    void notifyInputLine(final String line);
  }

  /** Default ReadingMode is BLOCKING */
  public enum ReadingMode {
    BLOCKING, NON_BLOCKING
  }

  private static String waitAndCaptureProcessStandardOutputStream(final Process process,
      final long waitTimeMilliseconds) {
    notNull(process, "Invalid process '" + process + "' specified");

    return waitAndCaptureProcessStream(process, process.getInputStream(), waitTimeMilliseconds);
  }

  public static String waitAndCaptureProcessStandardErrorStream(final Process process) {
    return waitAndCaptureProcessStandardErrorStream(process,
        DEFAULT_PROCESS_OUTPUT_WAIT_TIME_MILLIS);
  }

  public static String waitAndCaptureProcessStandardErrorStream(final Process process,
      final long waitTimeMilliseconds) {
    return waitAndCaptureProcessStream(process, process.getErrorStream(), waitTimeMilliseconds);
  }

  private static String waitAndCaptureProcessStream(final Process process,
      final InputStream processInputStream, final long waitTimeMilliseconds) {
    StringBuffer buffer = new StringBuffer();

    InputListener inputListener = line -> {
      buffer.append(line);
      buffer.append(SystemUtils.LINE_SEPARATOR);
    };

    ProcessStreamReader reader = new ProcessStreamReader.Builder(process)
        .inputStream(processInputStream).inputListener(inputListener).build();

    try {
      reader.start();

      long endTime = System.currentTimeMillis() + waitTimeMilliseconds;

      while (System.currentTimeMillis() < endTime) {
        try {
          reader.join(waitTimeMilliseconds);
        } catch (InterruptedException ignore) {
        }
      }
    } finally {
      reader.stop();
    }

    return buffer.toString();
  }

  /**
   * Builds a ProcessStreamReader.
   *
   * @since GemFire 8.2
   */
  public static class Builder {

    final Process process;
    InputStream inputStream;
    InputListener inputListener;
    long continueReadingMillis = 0;
    ReadingMode readingMode = ReadingMode.BLOCKING;

    public Builder(final Process process) {
      this.process = process;
    }

    public Builder inputStream(final InputStream inputStream) {
      this.inputStream = inputStream;
      return this;
    }

    /** InputListener callback to invoke with read data */
    public Builder inputListener(final InputListener inputListener) {
      this.inputListener = inputListener;
      return this;
    }

    /** millis to continue reading InputStream after Process terminates */
    public Builder continueReadingMillis(final long continueReadingMillis) {
      this.continueReadingMillis = continueReadingMillis;
      return this;
    }

    /** ReadingMode to use for reading InputStream */
    public Builder readingMode(final ReadingMode readingMode) {
      this.readingMode = readingMode;
      return this;
    }

    public ProcessStreamReader build() {
      notNull(process, "Invalid process '" + process + "' specified");
      notNull(inputStream, "Invalid inputStream '" + inputStream + "' specified");
      isTrue(continueReadingMillis >= 0,
          "Invalid continueReadingMillis '" + continueReadingMillis + "' specified");

      switch (readingMode) {
        case NON_BLOCKING:
          return new NonBlockingProcessStreamReader(this);
        default:
          return new BlockingProcessStreamReader(this);
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.amazonaws.services.managedblockchain.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Attributes of an Ethereum node.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class NodeEthereumAttributes implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a client.
     * Use this endpoint in client code for smart contracts when using an HTTP connection. Connections to this endpoint
     * are authenticated using Signature Version 4.
     *

     */
    private String httpEndpoint;
    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket connections from
     * a client. Use this endpoint in client code for smart contracts when using a WebSocket connection. Connections to
     * this endpoint are authenticated using Signature Version 4.
     *

     */
    private String webSocketEndpoint;

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a client.
     * Use this endpoint in client code for smart contracts when using an HTTP connection. Connections to this endpoint
     * are authenticated using Signature Version 4.
     *

     *
     * @param httpEndpoint
     *        The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a
     *        client. Use this endpoint in client code for smart contracts when using an HTTP connection. Connections to
     *        this endpoint are authenticated using Signature Version 4.
     */

    public void setHttpEndpoint(String httpEndpoint) {
        this.httpEndpoint = httpEndpoint;
    }

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a client.
     * Use this endpoint in client code for smart contracts when using an HTTP connection. Connections to this endpoint
     * are authenticated using Signature Version 4.
     *

     *
     * @return The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a
     *         client. Use this endpoint in client code for smart contracts when using an HTTP connection. Connections
     *         to this endpoint are authenticated using Signature Version 4.
     */

    public String getHttpEndpoint() {
        return this.httpEndpoint;
    }

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a client.
     * Use this endpoint in client code for smart contracts when using an HTTP connection. Connections to this endpoint
     * are authenticated using Signature Version 4.
     *

     *
     * @param httpEndpoint
     *        The endpoint on which the Ethereum node listens to run Ethereum API methods over HTTP connections from a
     *        client. Use this endpoint in client code for smart contracts when using an HTTP connection. Connections to
     *        this endpoint are authenticated using Signature Version 4.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public NodeEthereumAttributes withHttpEndpoint(String httpEndpoint) {
        setHttpEndpoint(httpEndpoint);
        return this;
    }

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket connections from
     * a client. Use this endpoint in client code for smart contracts when using a WebSocket connection. Connections to
     * this endpoint are authenticated using Signature Version 4.
     *

     *
     * @param webSocketEndpoint
     *        The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket
     *        connections from a client. Use this endpoint in client code for smart contracts when using a WebSocket
     *        connection. Connections to this endpoint are authenticated using Signature Version 4.
     */

    public void setWebSocketEndpoint(String webSocketEndpoint) {
        this.webSocketEndpoint = webSocketEndpoint;
    }

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket connections from
     * a client. Use this endpoint in client code for smart contracts when using a WebSocket connection. Connections to
     * this endpoint are authenticated using Signature Version 4.
     *

     *
     * @return The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket
     *         connections from a client. Use this endpoint in client code for smart contracts when using a WebSocket
     *         connection. Connections to this endpoint are authenticated using Signature Version 4.
     */

    public String getWebSocketEndpoint() {
        return this.webSocketEndpoint;
    }

    /**
     *

     * The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket connections from
     * a client. Use this endpoint in client code for smart contracts when using a WebSocket connection. Connections to
     * this endpoint are authenticated using Signature Version 4.
     *

     *
     * @param webSocketEndpoint
     *        The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods over WebSocket
     *        connections from a client. Use this endpoint in client code for smart contracts when using a WebSocket
     *        connection. Connections to this endpoint are authenticated using Signature Version 4.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public NodeEthereumAttributes withWebSocketEndpoint(String webSocketEndpoint) {
        setWebSocketEndpoint(webSocketEndpoint);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getHttpEndpoint() != null)
            sb.append("HttpEndpoint: ").append(getHttpEndpoint()).append(",");
        if (getWebSocketEndpoint() != null)
            sb.append("WebSocketEndpoint: ").append(getWebSocketEndpoint());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof NodeEthereumAttributes == false)
            return false;
        NodeEthereumAttributes other = (NodeEthereumAttributes) obj;
        if (other.getHttpEndpoint() == null ^ this.getHttpEndpoint() == null)
            return false;
        if (other.getHttpEndpoint() != null && other.getHttpEndpoint().equals(this.getHttpEndpoint()) == false)
            return false;
        if (other.getWebSocketEndpoint() == null ^ this.getWebSocketEndpoint() == null)
            return false;
        if (other.getWebSocketEndpoint() != null && other.getWebSocketEndpoint().equals(this.getWebSocketEndpoint()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getHttpEndpoint() == null) ? 0 : getHttpEndpoint().hashCode());
        hashCode = prime * hashCode + ((getWebSocketEndpoint() == null) ? 0 : getWebSocketEndpoint().hashCode());
        return hashCode;
    }

    @Override
    public NodeEthereumAttributes clone() {
        try {
            return (NodeEthereumAttributes) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.managedblockchain.model.transform.NodeEthereumAttributesMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
package com.twitter.finagle.netty4.http.handler

import com.twitter.finagle.netty4.http.FinagleHttpObjectAggregator
import com.twitter.util.StorageUnit
import io.netty.handler.codec.http._

/**
 * Aggregates fixed length http messages and emits [[FullHttpMessage]] downstream.
 *
 * Http message is considered fixed length if it has `Content-Length` header and
 * `Transfer-Encoding` header is not `chunked` or if we can deduce actual content
 * length to be 0 even if `Content-Length` header is not specified.
 *
 * Fixed length messages may arrive as a series of chunks (not to be confused with chunks
 * as in `Transfer-Encoding: chunked`) from the upstream handlers in pipeline. To
 * eventually build a [[com.twitter.finagle.http.Request]] object with content available
 * as [[com.twitter.finagle.http.Request.content]] or
 * [[com.twitter.finagle.http.Request.contentString]] all chunks must be stored in a
 * temporary buffer and combined together into a [[FullHttpMessage]] as soon as the last
 * chunk of the message is received.
 *
 * The `maxContentLength` determines when to aggregate chunks and when to bypass the
 * message as is. Only sufficiently small messages (smaller than `maxContentLength`) are
 * aggregated.
 *
 * Messages with `Transfer-Encoding: chunked` are always bypassed.
 */
private[http] class FixedLengthMessageAggregator(
  maxContentLength: StorageUnit,
  handleExpectContinue: Boolean = true)
    extends FinagleHttpObjectAggregator(maxContentLength.inBytes.toInt, handleExpectContinue) {
  require(maxContentLength.bytes >= 0)

  override def isStartMessage(msg: HttpObject): Boolean = msg match {
    case httpMsg: HttpMessage => shouldAggregate(httpMsg)
    case _ => false
  }

  private[this] def shouldAggregate(msg: HttpMessage): Boolean = {
    // We never dechunk 'Transfer-Encoding: chunked' messages
    if (HttpUtil.isTransferEncodingChunked(msg)) false
    else if (noContentResponse(msg)) true // No body so aggregate the LastHttpContent
    else {
      // We will dechunk a message if it has a content-length header that is less
      // than or equal to the maxContentLength parameter.
      val contentLength = HttpUtil.getContentLength(msg, -1L)

      if (contentLength != -1L) contentLength <= maxContentLength.bytes
      else { // No content-length header.

        // Requests without a transfer-encoding or content-length header cannot have a body
        // (see https://tools.ietf.org/html/rfc7230#section-3.3.3). Netty 4 will signal
        // end-of-message for these requests with an immediate follow up LastHttpContent, so
        // we aggregate it as to not end up with a chunked request and a Reader that will
        // only signal EOF that folks are probably not handling anyway.
        msg.isInstanceOf[HttpRequest]
      }
    }
  }

  private[this] def noContentResponse(msg: HttpMessage): Boolean = msg match {
    case res: HttpResponse =>
      res.status.code match {
        case 101 =>
          // The Hixie 76 websocket handshake response may have content
          !((res.headers.contains(HttpHeaderNames.SEC_WEBSOCKET_ACCEPT)) &&
            (res.headers.contains(HttpHeaderNames.UPGRADE, HttpHeaderValues.WEBSOCKET, true)))

        case code if code >= 100 && code < 200 => true
        case 204 | 205 | 304 => true
        case _ => false
      }

    case _ => false
  }
}


text:
Controls the actual Selection operation. This doesn't have any effect on content loaded as chrome, except in textboxes. A similar property 'user-focus' was proposed in early drafts of a predecessor of css3-ui but was rejected by the working group.

[Webplatform](docs.webplatform.org/wiki/css/properties/user-select "Webplatform")
[Mozilla docs](https://developer.mozilla.org/en-US/docs/Web/CSS/user-select "Mozilla")
[Caniuse](http://caniuse.com/#feat=user-select-none "Caniuse")


text:
<?php

namespace ieu\Http;

interface SessionInterface extends ParameterCollectionInterface
{
    public function start();

    public function stop();

    public function destroy();
}


text:
package org.aslak.github.merge.service;

import org.aslak.github.merge.TestUtils;
import org.aslak.github.merge.model.LocalStorage;
import org.aslak.github.merge.model.PullRequest;
import org.aslak.github.merge.service.model.Result;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class GitServiceTest {

    @Mock
    private NotificationService notification;

    @Test
    public void shouldBeAbleToPullCloneRepository() throws Exception {
        PullRequest request = TestUtils.getPullRequest();

        GitService service = new GitService(notification);
        Result<LocalStorage> storage = service.perform(request).doClone();

        Assert.assertTrue(storage.successful());
        Assert.assertTrue(storage.getResult().getLocation().exists());
    }

}


text:
from django.core.urlresolvers import reverse
from django.db import models
from venues.models import Venue

class RestaurantCuisineType(models.Model):
    name = models.CharField(max_length=50)

    def __unicode__(self):
        return self.name

class Restaurant(Venue):
    cuisine = models.ForeignKey(RestaurantCuisineType)
    price_range = models.CharField(max_length=25, blank=True)
    delivery = models.NullBooleanField()
    buffet = models.NullBooleanField()
    outdoor_seating = models.NullBooleanField()
    party_room = models.NullBooleanField()
    accepts_reservations = models.NullBooleanField()
    has_carryouts = models.NullBooleanField()
    has_kids_menu = models.NullBooleanField()
    has_wifi = models.NullBooleanField()

    def save(self, *args, **kwargs):
        self.venue_model_type = 'restaurants.restaurant'
        super(Restaurant, self).save(*args, **kwargs)


text:
[![Build Status](https://travis-ci.org/twitter/heron.svg?&branch=master)](https://travis-ci.org/twitter/heron)

![logo](website/static/img/HeronTextLogo.png)

Heron is realtime analytics platform developed by Twitter. It is the direct
successor of [Apache Storm](http://storm.apache.org), built to be backwards
compatible with Storm's [topology API](http://storm.apache.org/releases/current/Tutorial.html#topologies)
but with a wide array of architectural improvements.

http://incubator.apache.org/projects/heron.html

https://heron.incubator.apache.org (coming soon...)

### Documentation
http://heronstreaming.io (official until)

#### Heron Requirements:
 * Java JDK 1.8
 * Python 2.7
 * Bazel

## Contact

#### Mailing lists

Heron User Google Group: [heron-users@googlegroups.com](https://groups.google.com/forum/#!forum/heron-users)

Heron on Twitter: [@heronstreaming](https://twitter.com/heronstreaming)

| Name                                                                      | Scope                           |                                                                |                                                                    |                                                                           |
|:--------------------------------------------------------------------------|:--------------------------------|:---------------------------------------------------------------|:-------------------------------------------------------------------|:--------------------------------------------------------------------------|
| [user@heron.incubator.apache.org](mailto:user@heron.incubator.apache.org) | User-related discussions        | [Subscribe](mailto:user-subscribe@heron.incubator.apache.org)  | [Unsubscribe](mailto:user-unsubscribe@heron.incubator.apache.org)  | [Archives](http://mail-archives.apache.org/mod_mbox/incubator-heron-user/)|
| [dev@heron.incubator.apache.org](mailto:dev@heron.incubator.apache.org)   | Development-related discussions | [Subscribe](mailto:dev-subscribe@heron.incubator.apache.org)   | [Unsubscribe](mailto:dev-unsubscribe@heron.incubator.apache.org)   | [Archives](http://mail-archives.apache.org/mod_mbox/incubator-heron-dev/) |

#### Slack

heron slack channel at https://heronstreaming.slack.com/

You can self-register at http://heronstreaming.herokuapp.com/

## For more information:

* Official Heron documentation located at [heronstreaming.io](http://heronstreaming.io)
* Official Heron resources, including Conference & Journal Papers, Videos, Blog Posts and selected Press located at [Heron Resources](http://twitter.github.io/heron/docs/resources/)
* [Twitter Heron: Stream Processing at
  Scale](http://dl.acm.org/citation.cfm?id=2742788) (academic paper)
* [Twitter Heron: Stream Processing at
  Scale](https://www.youtube.com/watch?v=pUaFOuGgmco) (YouTube video)
* [Flying Faster with Twitter
  Heron](https://blog.twitter.com/2015/flying-faster-with-twitter-heron) (blog
  post)

## Update

We recently merged updates to run Heron natively using [Mesos](http://mesos.apache.org/) in [AWS](https://aws.amazon.com/), Mesos/[Aurora](http://aurora.apache.org/) in AWS, and locally on a laptop.

We also added beta testing for [Apache YARN](https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html) support using [Apache REEF](http://reef.apache.org/), in addition to the Simple Linux Utility for Resource Management [(SLURM)](http://slurm.schedmd.com/).

We are working to add support for [Mesosphere DC/OS](https://dcos.io/) and [Kubernetes](http://kubernetes.io/).  We will continue to post updates as we progress.

## License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0


text:
<?php

namespace OverworldGlitches;

use ALttP\Item;
use ALttP\World;
use TestCase;

/**
 * @group OverworldGlitches
 */
class HyruleCastleEscapeTest extends TestCase
{
    public function setUp(): void
    {
        parent::setUp();
        $this->world = World::factory('standard', ['difficulty' => 'test_rules', 'logic' => 'OverworldGlitches']);
        $this->collected->setChecksForWorld($this->world->id);
    }

    public function tearDown(): void
    {
        parent::tearDown();
        unset($this->world);
    }

    /**
     * @param string $location
     * @param bool $access
     * @param array $items
     * @param array $except
     *
     * @dataProvider accessPool
     */
    public function testLocation(string $location, bool $access, array $items, array $except = [])
    {
        if (count($except)) {
            $this->collected = $this->allItemsExcept($except);
        }

        $this->addCollected($items);

        $this->assertEquals($access, $this->world->getLocation($location)
            ->canAccess($this->collected));
    }

    /**
     * @param string $location
     * @param bool $access
     * @param string $item
     * @param array $items
     * @param array $except
     *
     * @dataProvider fillPool
     */
    public function testFillLocation(string $location, bool $access, string $item, array $items = [], array $except = [])
    {
        if (count($except)) {
            $this->collected = $this->allItemsExcept($except);
        }

        $this->addCollected($items);

        $this->assertEquals($access, $this->world->getLocation($location)
            ->fill(Item::get($item, $this->world), $this->collected));
    }

    public function fillPool()
    {
        return [

            ["Sanctuary", false, 'KeyH2', [], ['KeyH2']],

            ["Sewers - Secret Room - Left", false, 'KeyH2', [], ['KeyH2']],

            ["Sewers - Secret Room - Middle", false, 'KeyH2', [], ['KeyH2']],

            ["Sewers - Secret Room - Right", false, 'KeyH2', [], ['KeyH2']],

            ["Sewers - Dark Cross", true, 'KeyH2', [], ['KeyH2']],

            ["Hyrule Castle - Boomerang Chest", true, 'KeyH2', [], ['KeyH2']],

            ["Hyrule Castle - Map Chest", true, 'KeyH2', [], ['KeyH2']],

            ["Hyrule Castle - Zelda's Cell", true, 'KeyH2', [], ['KeyH2']],
        ];
    }

    public function accessPool()
    {
        return [
            ["Sanctuary", true, ['UncleSword', 'KeyH2']],

            ["Sewers - Secret Room - Left", true, ['UncleSword', 'KeyH2']],

            ["Sewers - Secret Room - Middle", true, ['UncleSword', 'KeyH2']],

            ["Sewers - Secret Room - Right", true, ['UncleSword', 'KeyH2']],

            ["Sewers - Dark Cross", true, ['UncleSword']],

            ["Hyrule Castle - Boomerang Chest", true, ['UncleSword']],

            ["Hyrule Castle - Map Chest", true, ['UncleSword']],

            ["Hyrule Castle - Zelda's Cell", true, ['UncleSword']],
        ];
    }
}


text:
package com.dtolabs.rundeck.server.plugins.services;

import com.dtolabs.rundeck.core.plugins.BasePluggableProviderService;
import com.dtolabs.rundeck.core.plugins.ServiceProviderLoader;
import com.dtolabs.rundeck.plugins.ServiceNameConstants;
import com.dtolabs.rundeck.plugins.jobs.ExecutionLifecyclePlugin;

/**
 * Provider service for ExecutionLifecyclePlugin
 * Created by rnavarro
 * Date: 9/04/19
 * Time: 01:32 PM
 */
public class ExecutionLifecyclePluginProviderService extends BasePluggableProviderService<ExecutionLifecyclePlugin> {

    public static final String SERVICE_NAME = ServiceNameConstants.ExecutionLifecycle;
    private ServiceProviderLoader rundeckServerServiceProviderLoader;

    public ExecutionLifecyclePluginProviderService() {
        super(SERVICE_NAME, ExecutionLifecyclePlugin.class);
    }

    public ServiceProviderLoader getPluginManager() {
        return getRundeckServerServiceProviderLoader();
    }

    public ServiceProviderLoader getRundeckServerServiceProviderLoader() {
        return rundeckServerServiceProviderLoader;
    }

    public void setRundeckServerServiceProviderLoader(ServiceProviderLoader rundeckServerServiceProviderLoader) {
        this.rundeckServerServiceProviderLoader = rundeckServerServiceProviderLoader;
    }

}


text:
import { ChildProcess, exec, spawn } from "child_process";
import * as debug from "debug";

// tslint:disable-next-line:no-var-requires
const ps = require("ps-node");

const log = debug("azure-functions-pack:ProcessHelper");

export class ProcessHelper {
    public static run(commands: string[], cwd: string): Promise<IProcessResults> {
        return new Promise<IProcessResults>((resolve, reject) => {
            exec(commands.join(" "), { cwd }, (err: Error, stdout: string, stderr: string) => {
                log(stdout);
                log(stderr);
                const results: IProcessResults = {
                    didError: err ? true : false,
                    error: err,
                    stderr,
                    stdout,
                };
                if (err) {
                    log(err);
                    reject(err);
                    return;
                }
                resolve(results);
            });
        });
    }

    public static killAllFunctionsHosts(): Promise<{}> {
        return new Promise((resolve, reject) => {
            ps.lookup({
                command: "dotnet",
            }, (err: any, processes: any) => {
                const promises: any[] = [];
                processes.forEach((p: any) => {
                    log(JSON.stringify(p, null, " "));
                    p.arguments.forEach((a: any) => {
                        if (a.includes("bin/Azure.Functions.Cli.dll")) {
                            promises.push(ProcessHelper.kill(p.pid));
                        }
                    });
                });
                Promise.all(promises).then(resolve).catch((e) => { log(e); resolve(); });
            });
        });
    }

    public static kill(pid: number): Promise<{}> {
        return new Promise((resolve, reject) => {
            ps.kill(pid, "SIGKILL", (e: Error) => {
                if (e) {
                    resolve(e);
                } else {
                    reject();
                }
            });
        });
    }
}

export interface IProcessResults {
    exitCode?: string;
    stdout?: string;
    stderr?: string;
    didError?: boolean;
    error?: Error;
}


text:
package io.github.repir.Strategy.Operator;

import io.github.repir.Strategy.Operator.Operator;
import io.github.repir.Strategy.Operator.OperatorExpander;
import io.github.repir.Strategy.GraphRoot;
import io.github.repir.Strategy.GraphRoot;
import io.github.htools.lib.Log;
import java.util.ArrayList;

/**
 * This feature expands itself into the Full Independence set (MRF), and is only used
 * to set the correct weight to the terms.
 * <p/>
 * @author jeroen
 */
public class SDMIndependentTerms extends OperatorExpander {

   public static Log log = new Log(SDMIndependentTerms.class);
   double weight_term = 1 - repository.configuredDouble("sdm.orderedphrases", SDMOrderedCombinations.default_weight)
                        - repository.configuredDouble("sdm.unorderedphrases", SDMUnorderedCombinations.default_weight);

   public SDMIndependentTerms(GraphRoot im, ArrayList<Operator> list) {
      super(im, list);
      //log.info("SDMTerm.weight=%f", weight_term);
   }

   @Override
   public ArrayList<Operator> replaceWith() {
      ArrayList<Operator> list = new ArrayList<Operator>();
      for (Operator f : containednodes ) {
         f.setweight(weight_term);
         list.add(f);
      }
      return list;
   }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>io.vertx</groupId>
  <artifactId>mod-couchbase-persistor</artifactId>
  <packaging>jar</packaging>
  <version>1.0.0-RC1</version>
  <name>Vert.x Couchbase Persistor Module</name>
  <url>https://github.com/jmusacchio/mod-couchbase-persistor</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
	<connection>scm:git:git@github.com:jmusacchio/mod-couchbase-persistor.git</connection>
	<developerConnection>scm:git:git@github.com:jmusacchio/mod-couchbase-persistor.git</developerConnection>
	<url>git@github.com:jmusacchio/mod-couchbase-persistor.git</url>
  </scm>
  <developers>
    <developer>
      <id>jmusacchio</id>
      <name>Juan Manuel Musacchio</name>
      <email>juan.musacchio@gmail.com</email>
    </developer>
  </developers>
  <parent>
     <groupId>org.sonatype.oss</groupId>
     <artifactId>oss-parent</artifactId>
     <version>7</version>
  </parent>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- Set pullInDeps to true if you want any modules specified in the 'includes' and 'deploys' fields
    in your mod.json to be automatically pulled in during packaging and added inside your module. Doing this means your
    module won't download and install those dependencies at run-time when they're first requested. -->
    <vertx.pullInDeps>false</vertx.pullInDeps>

    <!-- Set createFatJar to true if you want to create a fat executable jar which contains the Vert.x binaries
    along with the module so it can be run with java -jar <jarname> -->
    <vertx.createFatJar>false</vertx.createFatJar>

    <!--Vertx module name-->
    <module.name>${project.groupId}~${project.artifactId}~${project.version}</module.name>

    <!-- The directory where the module will be assembled - you can override this on the command line
    with -Dmods.directory=mydir -->
    <mods.directory>target/mods</mods.directory>

    <!--Dependency versions-->
    <vertx.version>2.1.2</vertx.version>
    <vertx.testtools.version>2.0.3-final</vertx.testtools.version>
    <junit.version>4.11</junit.version>
    <couchbase.client.version>1.4.4</couchbase.client.version>
    <commons-beanutils.version>1.8.3</commons-beanutils.version>
    <commons-lang3.version>3.3.2</commons-lang3.version>

    <!--Plugin versions-->
    <maven.compiler.plugin.version>3.0</maven.compiler.plugin.version>
    <maven.resources.plugin.version>2.6</maven.resources.plugin.version>
    <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
    <maven.vertx.plugin.version>2.0.8-final</maven.vertx.plugin.version>
    <maven.surefire.plugin.version>2.14</maven.surefire.plugin.version>
    <maven.failsafe.plugin.version>2.14</maven.failsafe.plugin.version>
    <maven.surefire.report.plugin.version>2.14</maven.surefire.report.plugin.version>
    <maven.javadoc.plugin.version>2.9</maven.javadoc.plugin.version>
    <maven.dependency.plugin.version>2.7</maven.dependency.plugin.version>
  </properties>

  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>

  <dependencies>
    <!--Vertx provided dependencies-->
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <version>${vertx.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-platform</artifactId>
      <version>${vertx.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-hazelcast</artifactId>
      <version>${vertx.version}</version>
      <scope>provided</scope>
    </dependency>
    <!--Test dependencies-->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>testtools</artifactId>
      <version>${vertx.testtools.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
    	<groupId>com.couchbase.client</groupId>
    	<artifactId>couchbase-client</artifactId>
    	<version>${couchbase.client.version}</version>
  	</dependency>

  	<dependency>
    	<groupId>commons-beanutils</groupId>
    	<artifactId>commons-beanutils-core</artifactId>
    	<version>${commons-beanutils.version}</version>
  	</dependency>

	<dependency>
    	<groupId>org.apache.commons</groupId>
    	<artifactId>commons-lang3</artifactId>
    	<version>${commons-lang3.version}</version>
  	</dependency>

    <!-- Add any other dependencies that you want packaged into your module (in the lib dir) here
    as 'compile' dependencies. Here is an example
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>1.3</version>
      <scope>compile</scope>
    </dependency>
    -->

  </dependencies>

  <build>
    <plugins>

      <!-- The vert.x Maven plugin -->
      <plugin>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-maven-plugin</artifactId>
        <version>${maven.vertx.plugin.version}</version>
        <!--
        You can specify extra config to the plugin as required here
        <configuration>
           <configFile>/path/to/MyVerticle.conf</configFile>
           <instances>1</instances>
           <classpath>src/main/resources/:src/test/resources/:target/classes/:target/test-classes/</classpath>
        </configuration>
        -->
        <!-- Make sure that the plugin uses the vert.x versions from this pom.xml not from its own pom.xml -->
        <dependencies>
          <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-platform</artifactId>
            <version>${vertx.version}</version>
          </dependency>
          <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
            <version>${vertx.version}</version>
          </dependency>
          <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-hazelcast</artifactId>
            <version>${vertx.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>PullInDeps</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>pullInDeps</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Other plugins required by the build -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin.version}</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven.resources.plugin.version}</version>
        <executions>
          <execution>
            <id>copy-mod-to-target</id>
            <phase>process-classes</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <overwrite>true</overwrite>
              <outputDirectory>${mods.directory}/${module.name}</outputDirectory>
              <resources>
                <resource>
                  <directory>target/classes</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven.dependency.plugin.version}</version>
        <executions>
          <execution>
            <id>copy-mod-dependencies-to-target</id>
            <phase>process-classes</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${mods.directory}/${module.name}/lib</outputDirectory>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
          <execution>
            <id>copy-mod-dependencies-to-target-dependencies</id>
            <phase>process-classes</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>target/dependencies</outputDirectory>
              <includeScope>runtime</includeScope>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.plugin.version}</version>
        <configuration>
          <includes>
            <include>**/unit/*Test*.java</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven.failsafe.plugin.version}</version>
        <configuration>
          <systemProperties>
            <property>
              <name>vertx.mods</name>
              <value>${mods.directory}</value>
            </property>
          </systemProperties>
          <includes>
            <include>**/integration/**/*Test*</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${maven.surefire.report.plugin.version}</version>
        <executions>
          <execution>
            <id>generate-test-report</id>
            <phase>test</phase>
            <goals>
              <goal>report-only</goal>
            </goals>
          </execution>
          <execution>
            <id>generate-integration-test-report</id>
            <phase>integration-test</phase>
            <goals>
              <goal>failsafe-report-only</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/mod.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>assemble</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
	    <groupId>org.sonatype.plugins</groupId>
	    <artifactId>nexus-staging-maven-plugin</artifactId>
	    <version>1.6.2</version>
	    <extensions>true</extensions>
	    <configuration>
	      <serverId>ossrh</serverId>
	      <nexusUrl>https://oss.sonatype.org/</nexusUrl>
	      <autoReleaseAfterClose>true</autoReleaseAfterClose>
	    </configuration>
      </plugin>

      <plugin>
      	<groupId>org.apache.maven.plugins</groupId>
      	<artifactId>maven-source-plugin</artifactId>
      	<version>2.2.1</version>
      	<executions>
          <execution>
          	<id>attach-sources</id>
          	<goals>
              <goal>jar-no-fork</goal>
          	</goals>
          </execution>
      	</executions>
      </plugin>

      <plugin>
      	<groupId>org.apache.maven.plugins</groupId>
      	  <artifactId>maven-javadoc-plugin</artifactId>
      	  <version>2.9.1</version>
      	  <executions>
        	<execution>
          	  <id>attach-javadocs</id>
          		<goals>
              	<goal>jar</goal>
          	</goals>
        	</execution>
      	  </executions>
      </plugin>

      <plugin>
      	<groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-gpg-plugin</artifactId>
	    <version>1.5</version>
	      <executions>
	        <execution>
	          <id>sign-artifacts</id>
	          <phase>verify</phase>
	          <goals>
	            <goal>sign</goal>
	          </goals>
	        </execution>
	      </executions>
      </plugin>

    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${maven.surefire.report.plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven.javadoc.plugin.version}</version>
        <configuration>
          <aggregate>true</aggregate>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

  <distributionManagement>
	<snapshotRepository>
		<id>ossrh</id>
		<name>Sonatype Nexus snapshot repository</name>
		<url>https://oss.sonatype.org/content/repositories/snapshots</url>
	</snapshotRepository>
	<repository>
		<id>ossrh</id>
		<name>Sonatype Nexus release repository</name>
		<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
	</repository>
  </distributionManagement>

</project>


text:
author: napbuf
comments: true
date: 2010-07-04 18:28:00+00:00
layout: post
slug: acceptada-a-la-universitat-de-beihang-buaa-2
title: ACCEPTADA a la Universitat de Beihang (BUAA)
wordpress_id: 57
categories:
- Xina
- 'Xina: Preparatius'
---

Després de més de 3 mesos, per fi rebo la resposta esperada: acceptada a la Universitat de Beihang. Ja m'han assignat un tutor i sembla que tot es va posant a lloc.
Quan vaig rebre el e-mail, un cop acabats els exàmens finals, no podia esborrar el somriure de la meva cara. Ara llegeixo el mail, i tampoc m'hi diuen massa res, però va ser més el què significava que el què hi deia en sí.

_"__Hola Laura,_
_Vas a recibir la carta de admisión de la Universidad Beihang sobre el mediado mes de julio. Por favor nos comunicamos  durante este tiempo, qué te parece? _

_Justamente hoy me ha dado el nombre y el contacto de tu tutor de la BUAA. Puedes a contactar directamente con él para presentarte. Me han comentado de que el profesor Xu ahora se encuentra fuera del país, él te va a contestar cuando pueda._

_No dudes en poner el contacto conmigo para otras consultas,_

_Un saludo, ..."_

Això vol dir que d'aquí un parell de mesets estaré a Beijing envoltada de chinitos!!! Quan em poso a pensar-ho sèriament m'agafa el canguelis de pensar l'ho lluny que estaré de casa, però és una aventura que em motiva moltíssim i que fa temps que volia fer, i ara que en tinc la oportunitat vull aprofitar-la tant com el cos em demani.

Per altra banda, també veig tota la feina que em queda per fer abans de marxar, i alhora totes les coses que s'han anat quedant per fer durant el curs que vull fer ara a l'estiu, i com que no soc una persona organitzada i més aviat "gossa", no sé si arribaré a temps a preparar-ho tot; però sigui com sigui, al setembre estaré allà, el què està clar és que el món no s'aturarà per deixar que arribi a temps a fer-ho tot...

El divendres també vaig rebre un mail de la Berenice, dient que demà rebria un mail on convocaven una reunió durant la setmana per posar-nos al dia de tràmits a fer aquí i allà i suposo que orientar-nos una mica. Després de tres mesos, ja era hora!!!

Sembla que a partir d'ara les coses s'aniran succeint més ràpid, o almenys, això espero!!! Intentaré tenir el blog més actiu que els darrers dies, però és que realment no hi havien novetats...


text:
package org.artifactory.ui.rest.service.admin.configuration.licenses;

import org.artifactory.addon.AddonsManager;
import org.artifactory.addon.license.LicensesAddon;
import org.artifactory.api.context.ContextHelper;
import org.artifactory.api.license.LicenseInfo;
import org.artifactory.rest.common.service.ArtifactoryRestRequest;
import org.artifactory.rest.common.service.RestResponse;
import org.artifactory.rest.common.service.RestService;
import org.artifactory.ui.rest.model.admin.configuration.licenses.DeleteLicensesModel;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @author Chen Keinan
 */
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class DeleteArtifactLicenseService<T extends DeleteLicensesModel> implements RestService<T> {
    @Override
    public void execute(ArtifactoryRestRequest<T> request, RestResponse response) {
        T model = request.getImodel();
        for (String licenseId : model.getLicenseskeys()) {
            // get license addon
            LicensesAddon licensesAddon = ContextHelper.get().beanForType(AddonsManager.class).addonByType(
                    LicensesAddon.class);
            // delete artifact license
            LicenseInfo licenseInfo = licensesAddon.getLicenseByName(licenseId);
            licensesAddon.deleteLicenseInfo(licenseInfo);
        }
        if(model.getLicenseskeys().size()>1){
            response.info("Successfully removed "+model.getLicenseskeys().size()+" licenses");
        }else if(model.getLicenseskeys().size()==1){
            response.info("Successfully removed license '" + model.getLicenseskeys().get(0) + "'");
        }
    }
}


text:
<?php

/**
 * Doctrine_Ticket_1562_TestCase
 *
 * @package     Doctrine
 * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
 * @category    Object Relational Mapping
 * @link        www.doctrine-project.org
 * @since       1.0
 * @version     $Revision$
 */
class Doctrine_Ticket_1562_TestCase extends Doctrine_UnitTestCase
{
    public function prepareTables()
    {
        $this->tables[] = 'Ticket_1562_User';
        parent::prepareTables();
    }

    public function testTest()
    {
        $table = Doctrine_Core::getTable('Ticket_1562_User');
        $this->assertEqual(get_class($table), 'Ticket_1562_UserTable');
        $user = new Ticket_1562_User();
        $this->assertEqual($user->getTestAccessor(), 'Ticket_1562_Template::getTestAccessor');
        $this->assertEqual($table->getTestAccessor(), 'Ticket_1562_Template::getTestAccessorTableProxy');

        try {
            $user->invalidMethod();
            $this->fail();
        } catch (Exception $e) {
            $this->pass();
        }

        try {
            $table->getTestAccessor2();
        } catch (Exception $e) {
            if ($e->getMessage() == 'Test') {
                $this->pass();
            } else {
                $this->fail('Exception thrown should have had a message of test');
            }
        }
    }
}

class Ticket_1562_User extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->hasColumn('username', 'string', 255);
        $this->hasColumn('password', 'string', 255);
    }

    public function setUp()
    {
        $this->actAs('Ticket_1562_Template');
    }
}

class Ticket_1562_UserTable extends Doctrine_Table
{

}

class Ticket_1562_Template extends Doctrine_Template
{
    public function getTestAccessor()
    {
        return __METHOD__;
    }

    public function getTestAccessorTableProxy()
    {
        return __METHOD__;
    }

    public function getTestAccessor2TableProxy()
    {
        throw new Doctrine_Exception('Test');
    }
}


text:
import { IStringOptions } from "../options";
import XmlNode from "./XmlNode";
/**
 * Represents an XML attribute-list declaration in a document type definition.
 *
 * An XML attribute-list declaration is structured as follows, where `{text}`
 * is the text of the declaration:
 *
 * ```xml
 * <!ATTLIST {text}>
 * ```
 *
 * The `{text}` value is a property of this node.
 *
 * XmlDtdAttlist nodes cannot have any children.
 */
export default class XmlDtdAttlist extends XmlNode {
    private _text;
    /**
     * Initializes a new instance of the {@link XmlDtdAttlist} class.
     *
     * @param {string} text The text associated with the XML attribute-list
     *                      declaration.
     */
    constructor(text: string);
    /**
     * Gets the text associated with the XML attribute-list declaration.
     *
     * @return {string} The text associated with the XML attribute-list
     *                  declaration.
     */
    /**
     * Sets the text associated with the XML attribute-list declaration.
     *
     * @param {string} text The text associated with the XML attribute-list
     *                      declaration.
     */
    text: string;
    /**
     * Throws an exception since {@link XmlDtdAttlist} nodes cannot have any
     * children.
     */
    children(): XmlNode[];
    /**
     * Throws an exception since {@link XmlDtdAttlist} nodes cannot have any
     * children.
     */
    insertChild(node: XmlNode, index?: number): XmlNode;
    /**
     * Throws an exception since {@link XmlDtdAttlist} nodes cannot have any
     * children.
     */
    removeChild(node: XmlNode): boolean;
    /**
     * Throws an exception since {@link XmlDtdAttlist} nodes cannot have any
     * children.
     */
    removeChildAtIndex(index: number): XmlNode;
    /**
     * Returns an XML string representation of this node.
     *
     * @param {IStringOptions} [options] Formatting options for the string
     *                                  representation.
     *
     * @returns {string} An XML string representation of this node.
     */
    toString(options?: IStringOptions): string;
}


text:
package za.co.lynnwoodpark.evisitorbook;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class MyService extends Service {

  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    return Service.START_NOT_STICKY;
  }

  @Override
  public IBinder onBind(Intent intent) {
    return null;
  }
}


text:
namespace bitwave {
namespace core {

    class BitData;

    // a repository store all BitData
    class BitRepository : private NotCopyable
    {
    public:
        typedef std::tr1::shared_ptr<BitData> BitDataPtr;

        BitRepository();
        ~BitRepository();

        // get current listen port(host)
        short GetListenPort() const;

        // set the bitwave listen port(host)
        void SetListenPort(short port);

        // create a BitData from torrent_file
        BitDataPtr CreateBitData(const std::string& torrent_file);

        // get a BitData by Sha1Value, if not existed return a empty ptr
        BitDataPtr GetBitData(const Sha1Value& info_hash) const;

        // get all BitDataPtrs
        void GetAllBitData(std::vector<BitDataPtr>& data) const;

    private:
        typedef std::map<Sha1Value, BitDataPtr> BitDataMap;

        short listen_port_;
        BitDataMap bitdata_map_;
    };

} // namespace core
} // namespace bitwave

#endif // BIT_REPOSITORY_H


text:
taskName = "Occurrences of word";

function Main(bufferElement) {
// Input
    var text = "Write a function with JavaScript that finds all the occurrences of word in a text", // Change value to TEST
        word = "javascript",
        sensitive = false,
        occurrences = 0;
// Solution
    function searchWord (text, word, sensitive) {
        var words = text.split(" "),
            counter = 0;
        if (sensitive) {
            for (var i = 0; i < words.length; i++) {
                if (words[i] === word) {
                    counter++;
                }
            }
        }
        else {
            for (var i = 0; i < words.length; i++) {
                if (words[i].toLowerCase() === word.toLowerCase()) {
                    counter++;
                }
            }
        }

        return counter;
    }
// Output
    WriteLine("Occurrences of word in a text: " + searchWord(text, word, sensitive));
}