text:
(function() {
"use strict";

var jStat = jstat;

FormulaParser = (function() {
  /*
   * Generated by PEG.js 0.7.0.
   *
   * http://pegjs.majda.cz/
   */

  function quote(s) {
    /*
     * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a
     * string literal except for the closing quote character, backslash,
     * carriage return, line separator, paragraph separator, and line feed.
     * Any character may appear in the form of an escape sequence.
     *
     * For portability, we also escape escape all control and non-ASCII
     * characters. Note that "\0" and "\v" escape sequences are not used
     * because JSHint does not like the first and IE the second.
     */
    return '"' + s
      .replace(/\\/g, '\\\\') // backslash
      .replace(/"/g, '\\"') // closing quote character
      .replace(/\x08/g, '\\b') // backspace
      .replace(/\t/g, '\\t') // horizontal tab
      .replace(/\n/g, '\\n') // line feed
      .replace(/\f/g, '\\f') // form feed
      .replace(/\r/g, '\\r') // carriage return
      .replace(/[\x00-\x07\x0B\x0E-\x1F\x80-\uFFFF]/g, escape) + '"';
  }

  var result = {
    /*
     * Parses the input with a generated parser. If the parsing is successfull,
     * returns a value explicitly or implicitly specified by the grammar from
     * which the parser was generated (see |PEG.buildParser|). If the parsing is
     * unsuccessful, throws |PEG.parser.SyntaxError| describing the error.
     */
    parse: function(input, startRule) {
      var parseFunctions = {
        "ArithmeticOperator": parse_ArithmeticOperator,
        "ArithmeticExpression": parse_ArithmeticExpression,
        "Atom": parse_Atom,
        "ParenExpression": parse_ParenExpression,
        "Number": parse_Number,
        "String": parse_String,
        "FunctionCall": parse_FunctionCall,
        "Range": parse_Range,
        "Arguments": parse_Arguments,
        "ArgumentList": parse_ArgumentList,
        "Variable": parse_Variable,
        "IdentifierVariable": parse_IdentifierVariable,
        "Identifier": parse_Identifier,
        "IdentifierName": parse_IdentifierName,
        "IdentifierStart": parse_IdentifierStart,
        "IdentifierPart": parse_IdentifierPart,
        "AlphaNumeric": parse_AlphaNumeric,
        "Alpha": parse_Alpha,
        "Digits": parse_Digits,
        "Digit": parse_Digit,
        "__": parse___,
        "WhiteSpace": parse_WhiteSpace
      };

      if (startRule !== undefined) {
        if (parseFunctions[startRule] === undefined) {
          throw new Error("Invalid rule name: " + quote(startRule) + ".");
        }
      } else {
        startRule = "ArithmeticExpression";
      }

      var pos = {
        offset: 0,
        line: 1,
        column: 1,
        seenCR: false
      };
      var reportFailures = 0;
      var rightmostFailuresPos = {
        offset: 0,
        line: 1,
        column: 1,
        seenCR: false
      };
      var rightmostFailuresExpected = [];

      function padLeft(input, padding, length) {
        var result = input;

        var padLength = length - input.length;
        for (var i = 0; i < padLength; i++) {
          result = padding + result;
        }

        return result;
      }

      function escape(ch) {
        var charCode = ch.charCodeAt(0);
        var escapeChar;
        var length;

        if (charCode <= 0xFF) {
          escapeChar = 'x';
          length = 2;
        } else {
          escapeChar = 'u';
          length = 4;
        }

        return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length);
      }

      function clone(object) {
        var result = {};
        for (var key in object) {
          result[key] = object[key];
        }
        return result;
      }

      function advance(pos, n) {
        var endOffset = pos.offset + n;

        for (var offset = pos.offset; offset < endOffset; offset++) {
          var ch = input.charAt(offset);
          if (ch === "\n") {
            if (!pos.seenCR) {
              pos.line++;
            }
            pos.column = 1;
            pos.seenCR = false;
          } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
            pos.line++;
            pos.column = 1;
            pos.seenCR = true;
          } else {
            pos.column++;
            pos.seenCR = false;
          }
        }

        pos.offset += n;
      }

      function matchFailed(failure) {
        if (pos.offset < rightmostFailuresPos.offset) {
          return;
        }

        if (pos.offset > rightmostFailuresPos.offset) {
          rightmostFailuresPos = clone(pos);
          rightmostFailuresExpected = [];
        }

        rightmostFailuresExpected.push(failure);
      }

      function parse_ArithmeticOperator() {
        var result0;

        if (input.charCodeAt(pos.offset) === 42) {
          result0 = "*";
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("\"*\"");
          }
        }
        if (result0 === null) {
          if (input.charCodeAt(pos.offset) === 47) {
            result0 = "/";
            advance(pos, 1);
          } else {
            result0 = null;
            if (reportFailures === 0) {
              matchFailed("\"/\"");
            }
          }
          if (result0 === null) {
            if (input.charCodeAt(pos.offset) === 43) {
              result0 = "+";
              advance(pos, 1);
            } else {
              result0 = null;
              if (reportFailures === 0) {
                matchFailed("\"+\"");
              }
            }
            if (result0 === null) {
              if (input.charCodeAt(pos.offset) === 45) {
                result0 = "-";
                advance(pos, 1);
              } else {
                result0 = null;
                if (reportFailures === 0) {
                  matchFailed("\"-\"");
                }
              }
              if (result0 === null) {
                if (input.charCodeAt(pos.offset) === 94) {
                  result0 = "^";
                  advance(pos, 1);
                } else {
                  result0 = null;
                  if (reportFailures === 0) {
                    matchFailed("\"^\"");
                  }
                }
                if (result0 === null) {
                  if (input.charCodeAt(pos.offset) === 61) {
                    result0 = "=";
                    advance(pos, 1);
                  } else {
                    result0 = null;
                    if (reportFailures === 0) {
                      matchFailed("\"=\"");
                    }
                  }
                  if (result0 === null) {
                    if (input.charCodeAt(pos.offset) === 38) {
                      result0 = "&";
                      advance(pos, 1);
                    } else {
                      result0 = null;
                      if (reportFailures === 0) {
                        matchFailed("\"&\"");
                      }
                    }
                    if (result0 === null) {
                      if (input.charCodeAt(pos.offset) === 60) {
                        result0 = "<";
                        advance(pos, 1);
                      } else {
                        result0 = null;
                        if (reportFailures === 0) {
                          matchFailed("\"<\"");
                        }
                      }
                      if (result0 === null) {
                        if (input.charCodeAt(pos.offset) === 62) {
                          result0 = ">";
                          advance(pos, 1);
                        } else {
                          result0 = null;
                          if (reportFailures === 0) {
                            matchFailed("\">\"");
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        return result0;
      }

      function parse_ArithmeticExpression() {
        var result0, result1, result2, result3, result4, result5;
        var pos0, pos1, pos2;

        pos0 = clone(pos);
        pos1 = clone(pos);
        result0 = parse_Atom();
        if (result0 !== null) {
          result1 = [];
          pos2 = clone(pos);
          result2 = parse___();
          if (result2 !== null) {
            result3 = parse_ArithmeticOperator();
            if (result3 !== null) {
              result4 = parse___();
              if (result4 !== null) {
                result5 = parse_Atom();
                if (result5 !== null) {
                  result2 = [result2, result3, result4, result5];
                } else {
                  result2 = null;
                  pos = clone(pos2);
                }
              } else {
                result2 = null;
                pos = clone(pos2);
              }
            } else {
              result2 = null;
              pos = clone(pos2);
            }
          } else {
            result2 = null;
            pos = clone(pos2);
          }
          while (result2 !== null) {
            result1.push(result2);
            pos2 = clone(pos);
            result2 = parse___();
            if (result2 !== null) {
              result3 = parse_ArithmeticOperator();
              if (result3 !== null) {
                result4 = parse___();
                if (result4 !== null) {
                  result5 = parse_Atom();
                  if (result5 !== null) {
                    result2 = [result2, result3, result4, result5];
                  } else {
                    result2 = null;
                    pos = clone(pos2);
                  }
                } else {
                  result2 = null;
                  pos = clone(pos2);
                }
              } else {
                result2 = null;
                pos = clone(pos2);
              }
            } else {
              result2 = null;
              pos = clone(pos2);
            }
          }
          if (result1 !== null) {
            result0 = [result0, result1];
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, head, tail) {
            var result = [head],
              oper;

            for (var i = 0; i < tail.length; i += 1) {
              oper = tail[i][1];

              oper = oper.replace('=', '==');
              oper = oper.replace('&', '+""+');

              result.push(oper);
              result.push(tail[i][3]);
            }

            return result.join("");
          })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_Atom() {
        var result0;

        result0 = parse_ParenExpression();
        if (result0 === null) {
          result0 = parse_Number();
          if (result0 === null) {
            result0 = parse_Range();
            if (result0 === null) {
              result0 = parse_FunctionCall();
              if (result0 === null) {
                result0 = parse_Variable();
                if (result0 === null) {
                  result0 = parse_String();
                }
              }
            }
          }
        }
        return result0;
      }

      function parse_ParenExpression() {
        var result0, result1, result2;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        if (input.charCodeAt(pos.offset) === 40) {
          result0 = "(";
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("\"(\"");
          }
        }
        if (result0 !== null) {
          result1 = parse_ArithmeticExpression();
          if (result1 !== null) {
            if (input.charCodeAt(pos.offset) === 41) {
              result2 = ")";
              advance(pos, 1);
            } else {
              result2 = null;
              if (reportFailures === 0) {
                matchFailed("\")\"");
              }
            }
            if (result2 !== null) {
              result0 = [result0, result1, result2];
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, expression) {
            return "(" + expression + ")";
          })(pos0.offset, pos0.line, pos0.column, result0[1]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_Number() {
        var result0, result1, result2, result3, result4, result5;
        var pos0, pos1, pos2;

        pos0 = clone(pos);
        pos1 = clone(pos);
        if (/^[0-9]/.test(input.charAt(pos.offset))) {
          result1 = input.charAt(pos.offset);
          advance(pos, 1);
        } else {
          result1 = null;
          if (reportFailures === 0) {
            matchFailed("[0-9]");
          }
        }
        if (result1 !== null) {
          result0 = [];
          while (result1 !== null) {
            result0.push(result1);
            if (/^[0-9]/.test(input.charAt(pos.offset))) {
              result1 = input.charAt(pos.offset);
              advance(pos, 1);
            } else {
              result1 = null;
              if (reportFailures === 0) {
                matchFailed("[0-9]");
              }
            }
          }
        } else {
          result0 = null;
        }
        if (result0 !== null) {
          if (input.charCodeAt(pos.offset) === 37) {
            result1 = "%";
            advance(pos, 1);
          } else {
            result1 = null;
            if (reportFailures === 0) {
              matchFailed("\"%\"");
            }
          }
          if (result1 !== null) {
            result0 = [result0, result1];
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, digits) {
            console.log(parseFloat(digits.join("").replace(/,/g, "").replace(/%/g, ""), 10));
            return parseFloat(digits.join("").replace(/,/g, "").replace(/%/g, ""), 10) / 100.0;
          })(pos0.offset, pos0.line, pos0.column, result0);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        if (result0 === null) {
          pos0 = clone(pos);
          pos1 = clone(pos);
          if (input.charCodeAt(pos.offset) === 45) {
            result0 = "-";
            advance(pos, 1);
          } else {
            result0 = null;
            if (reportFailures === 0) {
              matchFailed("\"-\"");
            }
          }
          result0 = result0 !== null ? result0 : "";
          if (result0 !== null) {
            if (/^[0-9]/.test(input.charAt(pos.offset))) {
              result2 = input.charAt(pos.offset);
              advance(pos, 1);
            } else {
              result2 = null;
              if (reportFailures === 0) {
                matchFailed("[0-9]");
              }
            }
            if (result2 !== null) {
              result1 = [];
              while (result2 !== null) {
                result1.push(result2);
                if (/^[0-9]/.test(input.charAt(pos.offset))) {
                  result2 = input.charAt(pos.offset);
                  advance(pos, 1);
                } else {
                  result2 = null;
                  if (reportFailures === 0) {
                    matchFailed("[0-9]");
                  }
                }
              }
            } else {
              result1 = null;
            }
            if (result1 !== null) {
              pos2 = clone(pos);
              if (input.charCodeAt(pos.offset) === 46) {
                result2 = ".";
                advance(pos, 1);
              } else {
                result2 = null;
                if (reportFailures === 0) {
                  matchFailed("\".\"");
                }
              }
              if (result2 !== null) {
                if (/^[0-9]/.test(input.charAt(pos.offset))) {
                  result4 = input.charAt(pos.offset);
                  advance(pos, 1);
                } else {
                  result4 = null;
                  if (reportFailures === 0) {
                    matchFailed("[0-9]");
                  }
                }
                if (result4 !== null) {
                  result3 = [];
                  while (result4 !== null) {
                    result3.push(result4);
                    if (/^[0-9]/.test(input.charAt(pos.offset))) {
                      result4 = input.charAt(pos.offset);
                      advance(pos, 1);
                    } else {
                      result4 = null;
                      if (reportFailures === 0) {
                        matchFailed("[0-9]");
                      }
                    }
                  }
                } else {
                  result3 = null;
                }
                if (result3 !== null) {
                  result2 = [result2, result3];
                } else {
                  result2 = null;
                  pos = clone(pos2);
                }
              } else {
                result2 = null;
                pos = clone(pos2);
              }
              result2 = result2 !== null ? result2 : "";
              if (result2 !== null) {
                pos2 = clone(pos);
                if (input.charCodeAt(pos.offset) === 101) {
                  result3 = "e";
                  advance(pos, 1);
                } else {
                  result3 = null;
                  if (reportFailures === 0) {
                    matchFailed("\"e\"");
                  }
                }
                if (result3 !== null) {
                  if (/^[0-9]/.test(input.charAt(pos.offset))) {
                    result5 = input.charAt(pos.offset);
                    advance(pos, 1);
                  } else {
                    result5 = null;
                    if (reportFailures === 0) {
                      matchFailed("[0-9]");
                    }
                  }
                  if (result5 !== null) {
                    result4 = [];
                    while (result5 !== null) {
                      result4.push(result5);
                      if (/^[0-9]/.test(input.charAt(pos.offset))) {
                        result5 = input.charAt(pos.offset);
                        advance(pos, 1);
                      } else {
                        result5 = null;
                        if (reportFailures === 0) {
                          matchFailed("[0-9]");
                        }
                      }
                    }
                  } else {
                    result4 = null;
                  }
                  if (result4 !== null) {
                    result3 = [result3, result4];
                  } else {
                    result3 = null;
                    pos = clone(pos2);
                  }
                } else {
                  result3 = null;
                  pos = clone(pos2);
                }
                result3 = result3 !== null ? result3 : "";
                if (result3 !== null) {
                  result0 = [result0, result1, result2, result3];
                } else {
                  result0 = null;
                  pos = clone(pos1);
                }
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
          if (result0 !== null) {
            result0 = (function(offset, line, column, digits) {
              return parseFloat(digits.join("").replace(/,/g, ""), 10);
            })(pos0.offset, pos0.line, pos0.column, result0);
          }
          if (result0 === null) {
            pos = clone(pos0);
          }
        }
        return result0;
      }

      function parse_String() {
        var result0, result1, result2;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        if (input.charCodeAt(pos.offset) === 34) {
          result0 = "\"";
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("\"\\\"\"");
          }
        }
        if (result0 !== null) {
          if (/^[^'"\n]/.test(input.charAt(pos.offset))) {
            result2 = input.charAt(pos.offset);
            advance(pos, 1);
          } else {
            result2 = null;
            if (reportFailures === 0) {
              matchFailed("[^'\"\\n]");
            }
          }
          if (result2 !== null) {
            result1 = [];
            while (result2 !== null) {
              result1.push(result2);
              if (/^[^'"\n]/.test(input.charAt(pos.offset))) {
                result2 = input.charAt(pos.offset);
                advance(pos, 1);
              } else {
                result2 = null;
                if (reportFailures === 0) {
                  matchFailed("[^'\"\\n]");
                }
              }
            }
          } else {
            result1 = null;
          }
          if (result1 !== null) {
            if (input.charCodeAt(pos.offset) === 34) {
              result2 = "\"";
              advance(pos, 1);
            } else {
              result2 = null;
              if (reportFailures === 0) {
                matchFailed("\"\\\"\"");
              }
            }
            if (result2 !== null) {
              result0 = [result0, result1, result2];
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, str) {
            return '"' + str.join("") + '"';
          })(pos0.offset, pos0.line, pos0.column, result0[1]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        if (result0 === null) {
          pos0 = clone(pos);
          pos1 = clone(pos);
          if (input.charCodeAt(pos.offset) === 39) {
            result0 = "'";
            advance(pos, 1);
          } else {
            result0 = null;
            if (reportFailures === 0) {
              matchFailed("\"'\"");
            }
          }
          if (result0 !== null) {
            if (/^[^'"\n]/.test(input.charAt(pos.offset))) {
              result2 = input.charAt(pos.offset);
              advance(pos, 1);
            } else {
              result2 = null;
              if (reportFailures === 0) {
                matchFailed("[^'\"\\n]");
              }
            }
            if (result2 !== null) {
              result1 = [];
              while (result2 !== null) {
                result1.push(result2);
                if (/^[^'"\n]/.test(input.charAt(pos.offset))) {
                  result2 = input.charAt(pos.offset);
                  advance(pos, 1);
                } else {
                  result2 = null;
                  if (reportFailures === 0) {
                    matchFailed("[^'\"\\n]");
                  }
                }
              }
            } else {
              result1 = null;
            }
            if (result1 !== null) {
              if (input.charCodeAt(pos.offset) === 39) {
                result2 = "'";
                advance(pos, 1);
              } else {
                result2 = null;
                if (reportFailures === 0) {
                  matchFailed("\"'\"");
                }
              }
              if (result2 !== null) {
                result0 = [result0, result1, result2];
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
          if (result0 !== null) {
            result0 = (function(offset, line, column, str) {
              return '"' + str.join("") + '"';
            })(pos0.offset, pos0.line, pos0.column, result0[1]);
          }
          if (result0 === null) {
            pos = clone(pos0);
          }
          if (result0 === null) {
            pos0 = clone(pos);
            if (input.substr(pos.offset, 2) === "''") {
              result0 = "''";
              advance(pos, 2);
            } else {
              result0 = null;
              if (reportFailures === 0) {
                matchFailed("\"''\"");
              }
            }
            if (result0 !== null) {
              result0 = (function(offset, line, column) {
                return '""';
              })(pos0.offset, pos0.line, pos0.column);
            }
            if (result0 === null) {
              pos = clone(pos0);
            }
            if (result0 === null) {
              pos0 = clone(pos);
              if (input.substr(pos.offset, 2) === "\"\"") {
                result0 = "\"\"";
                advance(pos, 2);
              } else {
                result0 = null;
                if (reportFailures === 0) {
                  matchFailed("\"\\\"\\\"\"");
                }
              }
              if (result0 !== null) {
                result0 = (function(offset, line, column) {
                  return '""';
                })(pos0.offset, pos0.line, pos0.column);
              }
              if (result0 === null) {
                pos = clone(pos0);
              }
            }
          }
        }
        return result0;
      }

      function parse_FunctionCall() {
        var result0, result1, result2, result3;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        result0 = parse___();
        if (result0 !== null) {
          result1 = parse_Identifier();
          if (result1 !== null) {
            result2 = parse___();
            if (result2 !== null) {
              result3 = parse_Arguments();
              if (result3 !== null) {
                result0 = [result0, result1, result2, result3];
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, name, arguments) {
            return "Formula." + name + arguments;
          })(pos0.offset, pos0.line, pos0.column, result0[1], result0[3]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_Range() {
        var result0, result1, result2, result3, result4;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        result0 = parse_Identifier();
        if (result0 !== null) {
          result1 = parse___();
          if (result1 !== null) {
            if (input.charCodeAt(pos.offset) === 58) {
              result2 = ":";
              advance(pos, 1);
            } else {
              result2 = null;
              if (reportFailures === 0) {
                matchFailed("\":\"");
              }
            }
            if (result2 !== null) {
              result3 = parse___();
              if (result3 !== null) {
                result4 = parse_Identifier();
                if (result4 !== null) {
                  result0 = [result0, result1, result2, result3, result4];
                } else {
                  result0 = null;
                  pos = clone(pos1);
                }
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, start, end) {

            // Taken from https://github.com/joshatjben/excelFormulaUtilitiesJS
            // and modified for Excellent

            var startRow = parseInt(start.match(/[0-9]+/gi)[0]),
              startCol = start.match(/[A-Z]+/gi)[0],
              startColDec = fromBase26(startCol),

              endRow = parseInt(end.match(/[0-9]+/gi)[0]),
              endCol = end.match(/[A-Z]+/gi)[0],
              endColDec = fromBase26(endCol),

              // Total rows and cols
              totalRows = endRow - startRow + 1,
              totalCols = fromBase26(endCol) - fromBase26(startCol) + 1,

              // Loop vars
              curCol = 0,
              curRow = 1,
              curCell = "",
              retVal = [];

            for (; curRow <= totalRows; curRow += 1) {
              for (; curCol < totalCols; curCol += 1) {
                // Get the current cell id
                curCell = toBase26(startColDec + curCol) + "" + (startRow + curRow - 1);
                retVal.push("this." + curCell);
              }
              curCol = 0;
            }

            return "[" + retVal.join(",") + "]";
          })(pos0.offset, pos0.line, pos0.column, result0[0], result0[4]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_Arguments() {
        var result0, result1, result2, result3, result4;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        if (input.charCodeAt(pos.offset) === 40) {
          result0 = "(";
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("\"(\"");
          }
        }
        if (result0 !== null) {
          result1 = parse___();
          if (result1 !== null) {
            result2 = parse_ArgumentList();
            result2 = result2 !== null ? result2 : "";
            if (result2 !== null) {
              result3 = parse___();
              if (result3 !== null) {
                if (input.charCodeAt(pos.offset) === 41) {
                  result4 = ")";
                  advance(pos, 1);
                } else {
                  result4 = null;
                  if (reportFailures === 0) {
                    matchFailed("\")\"");
                  }
                }
                if (result4 !== null) {
                  result0 = [result0, result1, result2, result3, result4];
                } else {
                  result0 = null;
                  pos = clone(pos1);
                }
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, arguments) {
            if (arguments.length > 0) {
              return "(" + arguments.join(",") + ")";
            } else {
              return "()";
            }
          })(pos0.offset, pos0.line, pos0.column, result0[2]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_ArgumentList() {
        var result0, result1, result2, result3, result4, result5;
        var pos0, pos1, pos2;

        pos0 = clone(pos);
        pos1 = clone(pos);
        result0 = parse_ArithmeticExpression();
        if (result0 !== null) {
          result1 = [];
          pos2 = clone(pos);
          result2 = parse___();
          if (result2 !== null) {
            if (input.charCodeAt(pos.offset) === 44) {
              result3 = ",";
              advance(pos, 1);
            } else {
              result3 = null;
              if (reportFailures === 0) {
                matchFailed("\",\"");
              }
            }
            if (result3 !== null) {
              result4 = parse___();
              if (result4 !== null) {
                result5 = parse_ArithmeticExpression();
                if (result5 !== null) {
                  result2 = [result2, result3, result4, result5];
                } else {
                  result2 = null;
                  pos = clone(pos2);
                }
              } else {
                result2 = null;
                pos = clone(pos2);
              }
            } else {
              result2 = null;
              pos = clone(pos2);
            }
          } else {
            result2 = null;
            pos = clone(pos2);
          }
          while (result2 !== null) {
            result1.push(result2);
            pos2 = clone(pos);
            result2 = parse___();
            if (result2 !== null) {
              if (input.charCodeAt(pos.offset) === 44) {
                result3 = ",";
                advance(pos, 1);
              } else {
                result3 = null;
                if (reportFailures === 0) {
                  matchFailed("\",\"");
                }
              }
              if (result3 !== null) {
                result4 = parse___();
                if (result4 !== null) {
                  result5 = parse_ArithmeticExpression();
                  if (result5 !== null) {
                    result2 = [result2, result3, result4, result5];
                  } else {
                    result2 = null;
                    pos = clone(pos2);
                  }
                } else {
                  result2 = null;
                  pos = clone(pos2);
                }
              } else {
                result2 = null;
                pos = clone(pos2);
              }
            } else {
              result2 = null;
              pos = clone(pos2);
            }
          }
          if (result1 !== null) {
            result0 = [result0, result1];
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, head, tail) {
            var result = [head];
            for (var i = 0; i < tail.length; i++) {
              result.push(tail[i][3]);
            }
            return result;
          })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_Variable() {
        var result0, result1, result2, result3;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        if (input.charCodeAt(pos.offset) === 39) {
          result0 = "'";
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("\"'\"");
          }
        }
        if (result0 !== null) {
          result1 = parse_AlphaNumeric();
          if (result1 !== null) {
            if (input.substr(pos.offset, 2) === "'!") {
              result2 = "'!";
              advance(pos, 2);
            } else {
              result2 = null;
              if (reportFailures === 0) {
                matchFailed("\"'!\"");
              }
            }
            if (result2 !== null) {
              result3 = parse_IdentifierVariable();
              if (result3 !== null) {
                result0 = [result0, result1, result2, result3];
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, workbook, name) {
            return "self.workbook['" + workbook.join("") + "']." + name;
          })(pos0.offset, pos0.line, pos0.column, result0[1], result0[3]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        if (result0 === null) {
          pos0 = clone(pos);
          pos1 = clone(pos);
          result0 = parse_Identifier();
          if (result0 !== null) {
            if (input.charCodeAt(pos.offset) === 33) {
              result1 = "!";
              advance(pos, 1);
            } else {
              result1 = null;
              if (reportFailures === 0) {
                matchFailed("\"!\"");
              }
            }
            if (result1 !== null) {
              result2 = parse_IdentifierVariable();
              if (result2 !== null) {
                result0 = [result0, result1, result2];
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
          } else {
            result0 = null;
            pos = clone(pos1);
          }
          if (result0 !== null) {
            result0 = (function(offset, line, column, workbook, name) {
              return "self.workbook['" + workbook + "']." + name;
            })(pos0.offset, pos0.line, pos0.column, result0[0], result0[2]);
          }
          if (result0 === null) {
            pos = clone(pos0);
          }
          if (result0 === null) {
            pos0 = clone(pos);
            pos1 = clone(pos);
            if (input.charCodeAt(pos.offset) === 45) {
              result0 = "-";
              advance(pos, 1);
            } else {
              result0 = null;
              if (reportFailures === 0) {
                matchFailed("\"-\"");
              }
            }
            if (result0 !== null) {
              result1 = parse_IdentifierVariable();
              if (result1 !== null) {
                result0 = [result0, result1];
              } else {
                result0 = null;
                pos = clone(pos1);
              }
            } else {
              result0 = null;
              pos = clone(pos1);
            }
            if (result0 !== null) {
              result0 = (function(offset, line, column, name) {
                return "-this." + name;
              })(pos0.offset, pos0.line, pos0.column, result0[1]);
            }
            if (result0 === null) {
              pos = clone(pos0);
            }
            if (result0 === null) {
              pos0 = clone(pos);
              result0 = parse_IdentifierVariable();
              if (result0 !== null) {
                result0 = (function(offset, line, column, name) {
                  return "this." + name;
                })(pos0.offset, pos0.line, pos0.column, result0);
              }
              if (result0 === null) {
                pos = clone(pos0);
              }
            }
          }
        }
        return result0;
      }

      function parse_IdentifierVariable() {
        var result0;
        var pos0;

        pos0 = clone(pos);
        result0 = parse_Identifier();
        if (result0 !== null) {
          result0 = (function(offset, line, column, name) {
            return name;
          })(pos0.offset, pos0.line, pos0.column, result0);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_Identifier() {
        var result0;
        var pos0;

        pos0 = clone(pos);
        result0 = parse_IdentifierName();
        if (result0 !== null) {
          result0 = (function(offset, line, column, name) {
            return name
          })(pos0.offset, pos0.line, pos0.column, result0);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_IdentifierName() {
        var result0, result1, result2;
        var pos0, pos1;

        pos0 = clone(pos);
        pos1 = clone(pos);
        result0 = parse_IdentifierStart();
        if (result0 !== null) {
          result1 = [];
          result2 = parse_IdentifierPart();
          while (result2 !== null) {
            result1.push(result2);
            result2 = parse_IdentifierPart();
          }
          if (result1 !== null) {
            result0 = [result0, result1];
          } else {
            result0 = null;
            pos = clone(pos1);
          }
        } else {
          result0 = null;
          pos = clone(pos1);
        }
        if (result0 !== null) {
          result0 = (function(offset, line, column, start, parts) {
            return start + parts.join("");
          })(pos0.offset, pos0.line, pos0.column, result0[0], result0[1]);
        }
        if (result0 === null) {
          pos = clone(pos0);
        }
        return result0;
      }

      function parse_IdentifierStart() {
        var result0;

        result0 = parse_Alpha();
        if (result0 === null) {
          if (input.charCodeAt(pos.offset) === 36) {
            result0 = "$";
            advance(pos, 1);
          } else {
            result0 = null;
            if (reportFailures === 0) {
              matchFailed("\"$\"");
            }
          }
          if (result0 === null) {
            if (input.charCodeAt(pos.offset) === 95) {
              result0 = "_";
              advance(pos, 1);
            } else {
              result0 = null;
              if (reportFailures === 0) {
                matchFailed("\"_\"");
              }
            }
          }
        }
        return result0;
      }

      function parse_IdentifierPart() {
        var result0;

        result0 = parse_IdentifierStart();
        if (result0 === null) {
          result0 = parse_Digit();
        }
        return result0;
      }

      function parse_AlphaNumeric() {
        var result0, result1;

        result0 = [];
        if (input.charCodeAt(pos.offset) === 38) {
          result1 = "&";
          advance(pos, 1);
        } else {
          result1 = null;
          if (reportFailures === 0) {
            matchFailed("\"&\"");
          }
        }
        if (result1 === null) {
          if (input.charCodeAt(pos.offset) === 45) {
            result1 = "-";
            advance(pos, 1);
          } else {
            result1 = null;
            if (reportFailures === 0) {
              matchFailed("\"-\"");
            }
          }
          if (result1 === null) {
            if (input.charCodeAt(pos.offset) === 95) {
              result1 = "_";
              advance(pos, 1);
            } else {
              result1 = null;
              if (reportFailures === 0) {
                matchFailed("\"_\"");
              }
            }
            if (result1 === null) {
              if (input.charCodeAt(pos.offset) === 32) {
                result1 = " ";
                advance(pos, 1);
              } else {
                result1 = null;
                if (reportFailures === 0) {
                  matchFailed("\" \"");
                }
              }
              if (result1 === null) {
                if (/^[a-z]/.test(input.charAt(pos.offset))) {
                  result1 = input.charAt(pos.offset);
                  advance(pos, 1);
                } else {
                  result1 = null;
                  if (reportFailures === 0) {
                    matchFailed("[a-z]");
                  }
                }
                if (result1 === null) {
                  if (/^[A-Z]/.test(input.charAt(pos.offset))) {
                    result1 = input.charAt(pos.offset);
                    advance(pos, 1);
                  } else {
                    result1 = null;
                    if (reportFailures === 0) {
                      matchFailed("[A-Z]");
                    }
                  }
                }
              }
            }
          }
        }
        while (result1 !== null) {
          result0.push(result1);
          if (input.charCodeAt(pos.offset) === 38) {
            result1 = "&";
            advance(pos, 1);
          } else {
            result1 = null;
            if (reportFailures === 0) {
              matchFailed("\"&\"");
            }
          }
          if (result1 === null) {
            if (input.charCodeAt(pos.offset) === 45) {
              result1 = "-";
              advance(pos, 1);
            } else {
              result1 = null;
              if (reportFailures === 0) {
                matchFailed("\"-\"");
              }
            }
            if (result1 === null) {
              if (input.charCodeAt(pos.offset) === 95) {
                result1 = "_";
                advance(pos, 1);
              } else {
                result1 = null;
                if (reportFailures === 0) {
                  matchFailed("\"_\"");
                }
              }
              if (result1 === null) {
                if (input.charCodeAt(pos.offset) === 32) {
                  result1 = " ";
                  advance(pos, 1);
                } else {
                  result1 = null;
                  if (reportFailures === 0) {
                    matchFailed("\" \"");
                  }
                }
                if (result1 === null) {
                  if (/^[a-z]/.test(input.charAt(pos.offset))) {
                    result1 = input.charAt(pos.offset);
                    advance(pos, 1);
                  } else {
                    result1 = null;
                    if (reportFailures === 0) {
                      matchFailed("[a-z]");
                    }
                  }
                  if (result1 === null) {
                    if (/^[A-Z]/.test(input.charAt(pos.offset))) {
                      result1 = input.charAt(pos.offset);
                      advance(pos, 1);
                    } else {
                      result1 = null;
                      if (reportFailures === 0) {
                        matchFailed("[A-Z]");
                      }
                    }
                  }
                }
              }
            }
          }
        }
        return result0;
      }

      function parse_Alpha() {
        var result0;

        if (/^[a-zA-Z]/.test(input.charAt(pos.offset))) {
          result0 = input.charAt(pos.offset);
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("[a-zA-Z]");
          }
        }
        return result0;
      }

      function parse_Digits() {
        var result0, result1;

        result0 = [];
        result1 = parse_Digit();
        while (result1 !== null) {
          result0.push(result1);
          result1 = parse_Digit();
        }
        return result0;
      }

      function parse_Digit() {
        var result0;

        if (/^[0-9]/.test(input.charAt(pos.offset))) {
          result0 = input.charAt(pos.offset);
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("[0-9]");
          }
        }
        return result0;
      }

      function parse___() {
        var result0, result1;

        result0 = [];
        result1 = parse_WhiteSpace();
        while (result1 !== null) {
          result0.push(result1);
          result1 = parse_WhiteSpace();
        }
        return result0;
      }

      function parse_WhiteSpace() {
        var result0;

        reportFailures++;
        if (/^[ \t\r\n]/.test(input.charAt(pos.offset))) {
          result0 = input.charAt(pos.offset);
          advance(pos, 1);
        } else {
          result0 = null;
          if (reportFailures === 0) {
            matchFailed("[ \\t\\r\\n]");
          }
        }
        reportFailures--;
        if (reportFailures === 0 && result0 === null) {
          matchFailed("whitespace");
        }
        return result0;
      }

      function cleanupExpected(expected) {
        expected.sort();

        var lastExpected = null;
        var cleanExpected = [];
        for (var i = 0; i < expected.length; i++) {
          if (expected[i] !== lastExpected) {
            cleanExpected.push(expected[i]);
            lastExpected = expected[i];
          }
        }
        return cleanExpected;
      }

      // From https://github.com/joshatjben/excelFormulaUtilitiesJS
      // Modified for Excellent

      // This was Modified from a function at http://en.wikipedia.org/wiki/Hexavigesimal
      // Pass in the base 26 string, get back integer
      var fromBase26 = function(number) {

        "use strict";

        number = number.toUpperCase();

        var s = 0,
          i, dec = 0;

        if (number !== null && typeof number !== "undefined" && number.length > 0) {
          for (i = 0; i < number.length; i += 1) {
            s = number.charCodeAt(number.length - i - 1) - "A".charCodeAt(0);
            dec += (Math.pow(26, i)) * (s + 1);
          }
        }

        return dec - 1;
      };

      var toBase26 = function(value) {

        "use strict";

        value = Math.abs(value);

        var converted = "",
          iteration = false,
          remainder;

        // Repeatedly divide the number by 26 and convert the
        // remainder into the appropriate letter.
        do {
          remainder = value % 26;

          // Compensate for the last letter of the series being corrected on 2 or more iterations.
          if (iteration && value < 25) {
            remainder -= 1;
          }

          converted = String.fromCharCode((remainder + 'A'.charCodeAt(0))) + converted;
          value = Math.floor((value - remainder) / 26);

          iteration = true;
        } while (value > 0);

        return converted;
      };

      var result = parseFunctions[startRule]();

      /*
       * The parser is now in one of the following three states:
       *
       * 1. The parser successfully parsed the whole input.
       *
       *    - |result !== null|
       *    - |pos.offset === input.length|
       *    - |rightmostFailuresExpected| may or may not contain something
       *
       * 2. The parser successfully parsed only a part of the input.
       *
       *    - |result !== null|
       *    - |pos.offset < input.length|
       *    - |rightmostFailuresExpected| may or may not contain something
       *
       * 3. The parser did not successfully parse any part of the input.
       *
       *   - |result === null|
       *   - |pos.offset === 0|
       *   - |rightmostFailuresExpected| contains at least one failure
       *
       * All code following this comment (including called functions) must
       * handle these states.
       */
      if (result === null || pos.offset !== input.length) {
        var offset = Math.max(pos.offset, rightmostFailuresPos.offset);
        var found = offset < input.length ? input.charAt(offset) : null;
        var errorPosition = pos.offset > rightmostFailuresPos.offset ? pos : rightmostFailuresPos;

        throw new this.SyntaxError(
          cleanupExpected(rightmostFailuresExpected),
          found,
          offset,
          errorPosition.line,
          errorPosition.column
        );
      }

      return result;
    },

    /* Returns the parser source code. */
    toSource: function() {
      return this._source;
    }
  };

  /* Thrown when a parser encounters a syntax error. */

  result.SyntaxError = function(expected, found, offset, line, column) {
    function buildMessage(expected, found) {
      var expectedHumanized, foundHumanized;

      switch (expected.length) {
        case 0:
          expectedHumanized = "end of input";
          break;
        case 1:
          expectedHumanized = expected[0];
          break;
        default:
          expectedHumanized = expected.slice(0, expected.length - 1).join(", ") + " or " + expected[expected.length - 1];
      }

      foundHumanized = found ? quote(found) : "end of input";

      return "Expected " + expectedHumanized + " but " + foundHumanized + " found.";
    }

    this.name = "SyntaxError";
    this.expected = expected;
    this.found = found;
    this.message = buildMessage(expected, found);
    this.offset = offset;
    this.line = line;
    this.column = column;
  };

  result.SyntaxError.prototype = Error.prototype;

  return result;
})();

var Excellent = Excellent || {};

Excellent.Util = (function() {
  'use strict';

  var self = {};

  // Variation of code I found on
  // http://davidwalsh.name/convert-xml-json
  self.xmlToJson = function(xml) {

    var obj = {},
      i, old, attribute, item;

    if (xml.nodeType === 1 && xml.attributes.length > 0) { // element

      obj['@'] = {};

      for (i = 0; i < xml.attributes.length; i += 1) {
        attribute = xml.attributes.item(i);
        obj['@'][attribute.nodeName] = attribute.nodeValue;
      }
    } else if (xml.nodeType === 3) { // text
      obj = xml.nodeValue;
    }

    if (xml.hasChildNodes()) {
      for (i = 0; i < xml.childNodes.length; i += 1) {

        item = xml.childNodes.item(i);

        if (obj[item.nodeName] === undefined) {
          obj[item.nodeName] = self.xmlToJson(item);
        } else {
          if (obj[item.nodeName].push === undefined) {
            old = obj[item.nodeName];
            obj[item.nodeName] = [];
            obj[item.nodeName].push(old);
          }
          obj[item.nodeName].push(self.xmlToJson(item));
        }

      }
    }
    return obj;
  };

  self.fromBase26 = function(number) {
    number = number.toUpperCase();

    var s = 0,
      i, dec = 0;

    if (number !== null && number !== undefined && number.length > 0) {
      for (i = 0; i < number.length; i += 1) {
        s = number.charCodeAt(number.length - i - 1) - 'A'.charCodeAt(0);
        dec += (Math.pow(26, i)) * (s + 1);
      }
    }

    return dec - 1;
  };

  self.toBase26 = function(value) {
    value = Math.abs(value);

    var converted = '',
      iteration = false,
      remainder;

    // Repeatedly divide the number by 26 and convert the
    // remainder into the appropriate letter.
    do {
      remainder = value % 26;

      // Compensate for the last letter of the series being corrected on 2 or more iterations.
      if (iteration && value < 25) {
        remainder -= 1;
      }

      converted = String.fromCharCode((remainder + 'A'.charCodeAt(0))) + converted;
      value = Math.floor((value - remainder) / 26);

      iteration = true;
    } while (value > 0);

    return converted;
  };

  self.isNumber = function(n) {
    return !isNaN(parseFloat(n)) && isFinite(n);
  };

  self.getRowFromCell = function(val) {
    return parseInt(val.match(/[0-9]+/gi)[0], 10) - 1;
  };

  self.getColFromCell = function(val) {
    val = val.match(/[A-Z]+/gi)[0];
    return Excellent.Util.fromBase26(val);
  };

  self.each = function(obj, iterator, context) {
    if (obj === null || obj === undefined) {
      return;
    }

    var key, breaker = {};

    if (obj.forEach === Array.prototype.forEach) {
      obj.forEach(iterator, context);
    } else {

      for (key in obj) {
        if (obj.hasOwnProperty(key)) {
          if (iterator.call(context, obj[key], key, obj) === breaker) {
            return;
          }
        }
      }
    }
  };

  return self;
}());

if (typeof exports !== 'undefined') {
  exports.Excellent = Excellent;
}

var Excellent = Excellent || {};

if (typeof exports !== 'undefined') {
  var Excellent = require('./excellent.util.js').Excellent,
    Formula = require('formulajs');
}

var Formula = Formula || {};

Formula.VLOOKUP = function(needle, index, exactmatch) {
  'use strict';

  var i, row;

  index = index || 0;
  exactmatch = exactmatch || false;
  for (i = 0; i < this.length; i += 1) {
    row = this[i];

    if ((exactmatch && row[0] === needle) || row[0].toLowerCase().indexOf(needle.toLowerCase()) !== -1) {
      return (index < row.length ? row[index] : row);
    }
  }
  return null;
};

Formula.MATCH = function(needle, searchArray, exactmatch) {
  'use strict';

  var i, item;

  exactmatch = exactmatch || false;
  for (i = 0; i < searchArray.length; i += 1) {
    item = searchArray[i];

    if ((exactmatch && item === needle) || String(item).toLowerCase() === String(needle).toLowerCase()) {
      return item;
    }
  }
  return null;
};

Formula.INDEX = function(searchArray, index) {
  'use strict';

  return searchArray[index];
};

Excellent.Workbook = function() {
  'use strict';

  var self = {};

  self.workbook = {};
  self.currentSheet = {};
  self.type = "";
  self.fileVersion = "";

  self.addSheet = function(sheetName) {
    if (!self.workbook.hasOwnProperty(sheetName)) {
      self.workbook[sheetName] = {};
    }

    self.currentSheet = self.workbook[sheetName];
    self.currentSheet.variables = [];
    self.currentSheet.functions = [];
    self.currentSheet.rows = [];
    return this;
  };

  self.setType = function(type) {
    self.type = type;
    return this;
  };

  self.setFileVersion = function(fileVersion) {
    self.fileVersion = fileVersion;
    return this;
  };

  self.addCellVal = function(cellName, cellVal) {
    var sheet, row, col, val;

    self.currentSheet['_' + cellName] = cellVal;
    self.currentSheet.variables.push(cellName);

    sheet = self.currentSheet;

    if (sheet[cellName]) {
      return;
    }

    Object.defineProperty(sheet, cellName, {
      get: function() {
        return sheet['_' + cellName];
      },
      set: function(val) {
        sheet['_' + cellName] = val;
      }
    });

    row = Excellent.Util.getRowFromCell(cellName);
    col = Excellent.Util.getColFromCell(cellName);

    if (self.currentSheet.rows[row] === undefined) {
      self.currentSheet.rows[row] = [];
    }

    self.currentSheet.rows[row][col] = {
      index: cellName
    };

    val = sheet['_' + cellName];

    self.currentSheet.rows[row][col] = {
      index: cellName,
      value: val
    };

    return this;
  };

  self.addCellFunc = function(cellName, cellVal) {
    var sheet, row, col, func;

    self.currentSheet['_' + cellName] = cellVal;
    self.currentSheet.functions.push(cellName);

    sheet = self.currentSheet;

    if (sheet[cellName]) {
      return;
    }

    Object.defineProperty(sheet, cellName, {
      get: function() {
        return eval(sheet['_' + cellName]);
      },
      set: function(val) {
        sheet['_' + cellName] = val;
      }
    });

    row = Excellent.Util.getRowFromCell(cellName);
    col = Excellent.Util.getColFromCell(cellName);

    if (self.currentSheet.rows[row] === undefined) {
      self.currentSheet.rows[row] = [];
    }

    func = sheet['_' + cellName];

    self.currentSheet.rows[row][col] = {
      index: cellName,
      value: func
    };

    return this;
  };

  self.getRawWorkbook = function() {
    return self.workbook;
  };

  self.zeroOutNullRows = function() {
    var sheet, cell;

    for (sheet in self.workbook) {
      if (self.workbook.hasOwnProperty(sheet)) {
        self.workbook[sheet].rows.forEach(function(line, lineIndex) {
          line.forEach(function(c, rowIndex) {
            if (c === null) {
              self.workbook[sheet].rows[lineIndex][rowIndex] = 0;
            }
          });
        });
      }
    }

    for (sheet in self.workbook) {
      if (self.workbook.hasOwnProperty(sheet)) {
        for (cell in self.workbook[sheet]) {
          if (self.workbook[sheet].hasOwnProperty(cell)) {
            if (self.workbook[sheet][cell] === null) {
              self.workbook[sheet][cell] = 0;
            }
          }
        }
      }
    }
  };

  return self;
};

if (typeof exports !== 'undefined') {
  exports.Excellent = Excellent;
}

// var workbook = { "Sheet1":
//    [ [ "Name", "Age", "Days", "Holidays", "Left" ],
//        [ "John", 45, 134, 7, "[function] this.B2 - this.C2;" ],
//        [ "Abe", 81, 23, 1, "[function] this.B3 - this.C3;" ],
//        [ "Mike", 92, 12, 2, "[function] this.B4 - this.C4;" ],
//        [ "Tonto", 54, 132, 3, "[function] this.B5 - this.C5;" ] ] };

var Excellent = Excellent || {};

if (typeof exports !== 'undefined') {
  var Excellent = require('./excellent.workbook.js').Excellent;
}

Excellent.Loader = function() {
  'use strict';

  var self = {};

  self.load = function(json) {

    var workbook = new Excellent.Workbook(),
      currentSheet = {};

    function isFunction(n) {
      return n !== null && n !== undefined && !Excellent.Util.isNumber(n) && (n.lastIndexOf('[function]', 0) === 0);
    }

    function getVal(valData) {
      var retVal = valData;

      if (isFunction(valData)) {
        retVal = valData.replace('[function]', '');
      }
      return retVal;
    }

    function addRow(rowData, rowId) {
      var cellName, cellVal, i;

      if (rowData === null || rowData === undefined) {
        return;
      }

      for (i = 0; i < rowData.length; i += 1) {

        cellName = String(Excellent.Util.toBase26(i) + (rowId + 1));
        cellVal = getVal(rowData[i]);

        if (isFunction(rowData[i])) {
          currentSheet.addCellFunc(cellName, cellVal);
        } else {
          currentSheet.addCellVal(cellName, cellVal);
        }
      }
    }

    function addCells(sheetData) {
      var i;

      for (i = 0; i < sheetData.length; i += 1) {
        addRow(sheetData[i], i);
      }
    }

    function addSheets() {
      var sheetName;

      for (sheetName in json) {
        if (json.hasOwnProperty(sheetName)) {
          currentSheet = workbook.addSheet(sheetName);
          addCells(json[sheetName]);
        }
      }
    }

    addSheets();

    return workbook;

  };

  self.unload = function(excellentObject) {
    var json = {},
      workbook = excellentObject.workbook;

    function loadJson() {
      var sheet, currentSheet, variable, row, col, i;

      for (sheet in workbook) {
        if (workbook.hasOwnProperty(sheet)) {
          json[sheet] = [];

          currentSheet = workbook[sheet];

          for (i = 0; i < currentSheet.variables.length; i += 1) {
            variable = currentSheet.variables[i];
            row = Excellent.Util.getRowFromCell(variable);
            col = Excellent.Util.getColFromCell(variable);

            if (json[sheet][row] === undefined) {
              json[sheet][row] = [];
            }

            json[sheet][row][col] = currentSheet['_' + variable];
          }

          for (i = 0; i < currentSheet.functions.length; i += 1) {
            variable = currentSheet.functions[i];
            row = Excellent.Util.getRowFromCell(variable);
            col = Excellent.Util.getColFromCell(variable);

            if (json[sheet][row] === undefined) {
              json[sheet][row] = [];
            }
            json[sheet][row][col] = '[function]' + currentSheet['_' + variable];
          }
        }
      }

      for (sheet in json) {
        if (json.hasOwnProperty(sheet)) {
          for (i = 0; i < json[sheet].length; i += 1) {
            if (json[sheet][i] === undefined) {
              json[sheet][i] = [];
            }
          }
        }
      }
    }

    loadJson();

    return json;
  };

  return self;
};

if (typeof exports !== 'undefined') {
  exports.Excellent = Excellent;
}

var Excellent = Excellent || {};

if (typeof exports !== 'undefined') {
  var Excellent = require('./excellent.workbook.js').Excellent,
    JSZip = require('jszip'),
    FormulaParser = require('./excellent.parser.js');
}

if (typeof DOMParser === 'undefined') {
  var DOMParser = require('xmldom').DOMParser;
}

Array.prototype.contains = function(v) {
  'use strict';

  var i;

  for (i = 0; i < this.length; i += 1) {
    if (this[i] === v) {
      return true;
    }
  }
  return false;
};

Array.prototype.unique = function() {
  'use strict';

  var i, arr = [];
  for (i = 0; i < this.length; i += 1) {
    if (!arr.contains(this[i])) {
      arr.push(this[i]);
    }
  }
  return arr;
};

Excellent.Xlsx = function() {
  'use strict';

  var self = {},
    workbook = new Excellent.Workbook();

  var XlsxStrings = (function() {
    var stringList = [];

    function getText(data) {
      var retVal = '';

      if (data.t !== undefined) {
        retVal = data.t['#text'];
      } else {
        // TODO: Handle nested data
        retVal = '';
      }

      return retVal;
    }

    function populateList(xmlString) {
      var xml, json, tmpList, si;

      xml = new DOMParser().parseFromString(xmlString, 'text/xml');
      json = Excellent.Util.xmlToJson(xml);

      tmpList = [];

      si = json.sst.si;
      Excellent.Util.each(si, function(data) {
        tmpList.push(getText(data));
      });

      stringList = tmpList;
    }

    function getListItem(id) {
      return stringList[id];
    }

    return {
      set: function(xmlData) {
        populateList(xmlData);
      },
      get: function(id) {
        return getListItem(id);
      }
    };
  }());

  function XlsxSheet(xmlString) {
    var self = {},
      sheetData,
      xml,
      json;

    xml = new DOMParser().parseFromString(xmlString, 'text/xml');

    json = Excellent.Util.xmlToJson(xml);
    sheetData = json.worksheet.sheetData;

    function matchesCell(str, cell) {
      return str.indexOf(cell) > -1;
    }

    function buildFunction(formula) {
      var output = '';

      // We are going to cheat a bit and remove
      // some simple excelisms

      // remove excess spaces
      formula = formula.trim();

      // old excel formula sometimes are written as
      // +formula
      // rather than
      // =formula
      // remove it!
      if (formula && formula.substring(0, 1) === '+') {
        formula = formula.substring(1);
      }

      output = FormulaParser.parse(formula);
      output = output.trim();
      return output;
    }

    // Very, very ugly.  Still working this out.
    // Almost there, then code cleanup.
    // Wow. This is ugly.  Really, almost there on this one, then
    // I will clean up the code.
    function populateSharedFormulas(c) {
      var shared,
        ref,
        si,

        matches,
        func;

      shared = c.f['@'];

      func = c.f['#text'];

      if (shared === undefined || func === undefined || shared.t !== 'shared') {
        return;
      }

      ref = shared.ref;

      si = shared.si;

      if (ref === undefined || si === undefined) {
        return;
      }

      // We are going to treat all of the refs as ranges
      if (ref.split(':').length !== 2) {
        ref = ref + ':' + ref;
      }

      // Pull out all of the variables.
      matches = func.match(/[A-Z]+[1-9][0-9]*/g).unique();

      var refData = ref.split(':'),
        start = refData[0],
        end = refData[1],

        startRow = parseInt(start.match(/[0-9]+/gi)[0], 10),
        startCol = start.match(/[A-Z]+/gi)[0],
        startColDec = Excellent.Util.fromBase26(startCol),

        endRow = parseInt(end.match(/[0-9]+/gi)[0], 10),
        endCol = end.match(/[A-Z]+/gi)[0],

        // Total rows and cols
        totalRows = endRow - startRow + 1,
        totalCols = Excellent.Util.fromBase26(endCol) - Excellent.Util.fromBase26(startCol) + 1,

        // Loop vars
        matchIter,
        curRow,
        curCol,
        curCell = '',
        match,
        matchRow,
        matchCol,
        matchColDec,
        matchCell = '',
        sharedFormulas = {},

        matchFullCol,
        matchFullRow,

        matchCellStart,
        matchCellStartReplace,

        matchCellEnd,
        matchCellEndReplace,

        matchSkipStart,
        matchSkipEnd;

      for (curRow = 1; curRow <= totalRows; curRow += 1) {

        for (curCol = 0; curCol < totalCols; curCol += 1) {

          // Get the current cell id
          curCell = String(Excellent.Util.toBase26(startColDec + curCol) + (startRow + curRow - 1));

          for (matchIter = 0; matchIter < matches.length; matchIter += 1) {

            match = matches[matchIter];
            matchRow = parseInt(match.match(/[0-9]+/gi)[0], 10);
            matchCol = match.match(/[A-Z]+/gi)[0];
            matchColDec = Excellent.Util.fromBase26(matchCol);

            matchFullCol = Excellent.Util.toBase26(matchColDec + curCol);
            matchFullRow = (matchRow + curRow - 1);

            matchCell = String(matchFullCol + matchFullRow);
            matchCellStart = String('$' + matchFullCol + matchFullRow);
            matchCellStartReplace = String('$' + matchCol + matchFullRow);

            matchCellEnd = matchFullCol + '$' + matchFullRow;
            matchCellEndReplace = matchFullCol + '$' + matchRow;

            matchSkipStart = String('$' + matchCol + matchRow);
            matchSkipEnd = matchCol + '$' + matchRow;

            if (sharedFormulas[curCell] === undefined) {
              sharedFormulas[curCell] = func;
            }

            if (matchesCell(sharedFormulas[curCell], matchSkipStart)) {
              continue;
            }

            if (matchesCell(sharedFormulas[curCell], matchSkipEnd)) {
              continue;
            }

            if (matchesCell(sharedFormulas[curCell], matchCellStart)) {
              matchCell = matchCellStartReplace;
            } else if (matchesCell(sharedFormulas[curCell], matchCellEnd)) {
              matchCell = matchCellEndReplace;
            }

            sharedFormulas[curCell] = sharedFormulas[curCell].replace(match, matchCell);
          }

        }
        curCol = 0;
      }

      Excellent.Util.each(sharedFormulas, function(columnText, columnValue) {
        workbook.addCellFunc(columnValue, buildFunction(columnText.replace(/\$/g, '')));
      });

      return sharedFormulas;
    }

    // This code is pretty ugly.  Going to clean it up as soon as
    // I get the various Excel types worked out.
    function buildColumn(c) {
      var columnId,
        columnValue,
        columnType;

      if (c === undefined) {
        return;
      }

      columnId = c['@'];
      if (columnId === undefined) {
        return;
      }

      columnValue = columnId.r; // Column ID: A2, A3, etc
      columnType = columnId.t; // shared text?

      if (c.f !== undefined && c.f['@'] !== undefined && c.f['@'].t === 'shared') {
        populateSharedFormulas(c);
      } else if (columnType === 's') { // shared string
        workbook.addCellVal(columnValue, XlsxStrings.get(parseInt(c.v['#text'], 10)));
      } else if (c.f !== undefined && c.f['#text'] !== undefined) { // function
        workbook.addCellFunc(columnValue, buildFunction(c.f['#text'].replace(/\$/g, '')));
      } else if (c.v !== undefined) { // value
        if (Excellent.Util.isNumber(c.v['#text'])) {
          workbook.addCellVal(columnValue, parseFloat(c.v['#text']));
        } else {
          workbook.addCellVal(columnValue, c.v['#text']);
        }
      }
    }

    function buildColumns(columns) {
      Excellent.Util.each(columns, function(c) {
        buildColumn(c);
      });
    }

    self.load = function() {
      Excellent.Util.each(sheetData, function(data) {
        Excellent.Util.each(data, function(column) {
          if (column.c === undefined || column.c.length === undefined) {
            buildColumns([column.c]);
          } else {
            buildColumns(column.c);
          }
        });
      });
    };

    return self;
  }

  function XlsxWorkbook(xmlString, zipLib) {
    var self = {},

      xml,
      zip,
      json;

    xml = new DOMParser().parseFromString(xmlString, 'text/xml');
    zip = zipLib;
    json = Excellent.Util.xmlToJson(xml).workbook;

    function buildFileVersion() {
      var attrs, fileVersion;

      attrs = json.fileVersion['@'];
      fileVersion = attrs.lastEdited + '.' + attrs.lowestEdited + '.' + attrs.rupBuild;

      workbook.setType(attrs.appName).setFileVersion(fileVersion);
    }

    function buildSheet(s) {
      var sheetId, sheetName, xlsxSheet;

      sheetId = s['r:id'].replace('rId', '');

      sheetName = 'xl/worksheets/sheet' + sheetId + '.xml';
      xlsxSheet = new XlsxSheet(zip.file(sheetName).asText());
      xlsxSheet.load();
    }

    function buildSheets() {
      var sheets = json.sheets.sheet;

      Excellent.Util.each(sheets, function(s) {

        if (s === undefined) {
          return;
        }

        if (s['@'] !== undefined) {
          s = s['@'];
        }

        workbook.addSheet(s.name);
        buildSheet(s);
      });
    }

    self.load = function() {
      buildFileVersion();
      buildSheets();
    };

    return self;
  }

  self.load = function(xlsxFile) {
    function extractFiles(zipFile) {
      var zip, stringZip, xlsxWorkbook;

      zip = new JSZip(zipFile);

      stringZip = zip.file('xl/sharedStrings.xml');
      if (stringZip !== null) {
        XlsxStrings.set(stringZip.asText());
      }

      xlsxWorkbook = new XlsxWorkbook(zip.file('xl/workbook.xml').asText(), zip);
      xlsxWorkbook.load();

      return workbook;
    }
    return extractFiles(xlsxFile);
  };

  return self;
};

if (typeof exports !== 'undefined') {
  exports.Excellent = Excellent;
}

var Excellent = Excellent || {};

if (typeof exports !== 'undefined') {
  var Excellent = require('./excellent.workbook.js').Excellent,
    JSZip = require('jszip');
}

if (typeof DOMParser === 'undefined') {
  var DOMParser = require('xmldom').DOMParser;
}

Array.prototype.contains = function(v) {
  'use strict';

  var i;

  for (i = 0; i < this.length; i += 1) {
    if (this[i] === v) {
      return true;
    }
  }
  return false;
};

Array.prototype.unique = function() {
  'use strict';

  var i, arr = [];
  for (i = 0; i < this.length; i += 1) {
    if (!arr.contains(this[i])) {
      arr.push(this[i]);
    }
  }
  return arr;
};

Excellent.XlsxSimple = function() {
  'use strict';

  var self = {},
    workbook = new Excellent.Workbook();

  var XlsxStrings = (function() {
    var stringList = [];

    function getText(data) {
      var retVal = '';

      if (data.t !== undefined) {
        retVal = data.t['#text'];
      } else {
        // TODO: Handle nested data
      }

      return retVal;
    }

    function populateList(xmlString) {
      var xml, json, tmpList, si;

      xml = new DOMParser().parseFromString(xmlString, 'text/xml');
      json = Excellent.Util.xmlToJson(xml);

      tmpList = [];

      si = json.sst.si;
      Excellent.Util.each(si, function(data) {
        tmpList.push(getText(data));
      });

      stringList = tmpList;
    }

    function getListItem(id) {
      return stringList[id];
    }

    return {
      set: function(xmlData) {
        populateList(xmlData);
      },
      get: function(id) {
        return getListItem(id);
      }
    };
  }());

  function XlsxSheet(xmlString) {
    var self = {};

    var sheetData, xml, json;

    xml = new DOMParser().parseFromString(xmlString, 'text/xml');

    json = Excellent.Util.xmlToJson(xml);
    sheetData = json.worksheet.sheetData;

    // This code is pretty ugly.  Going to clean it up as soon as
    // I get the various Excel types worked out.
    function buildColumn(c) {
      var columnId,
        columnValue,
        columnType;

      if (c === undefined) {
        return;
      }

      columnId = c['@'];
      if (columnId === undefined) {
        return;
      }

      columnValue = columnId.r; // Column ID: A2, A3, etc
      columnType = columnId.t; // shared text?

      if (columnType === 's') { // shared string
        workbook.addCellVal(columnValue, XlsxStrings.get(parseInt(c.v['#text'], 10)));
      } else if (c.v !== undefined) { // value
        if (Excellent.Util.isNumber(c.v['#text'])) {
          workbook.addCellVal(columnValue, parseFloat(c.v['#text']));
        } else {
          workbook.addCellVal(columnValue, c.v['#text']);
        }
      }
    }

    function buildColumns(columns) {
      Excellent.Util.each(columns, function(c) {
        buildColumn(c);
      });
    }

    self.load = function() {
      Excellent.Util.each(sheetData, function(data) {
        Excellent.Util.each(data, function(column) {
          if (column.c === undefined || column.c.length === undefined) {
            buildColumns([column.c]);
          } else {
            buildColumns(column.c);
          }
        });
      });
    };

    return self;
  }

  function XlsxWorkbook(xmlString, zipLib) {
    var self = {},

      xml,
      zip,
      json;

    xml = new DOMParser().parseFromString(xmlString, 'text/xml');
    zip = zipLib;
    json = Excellent.Util.xmlToJson(xml).workbook;

    function buildFileVersion() {
      var attrs, fileVersion;

      attrs = json.fileVersion['@'];
      fileVersion = attrs.lastEdited + '.' + attrs.lowestEdited + '.' + attrs.rupBuild;

      workbook.setType(attrs.appName).setFileVersion(fileVersion);
    }

    function buildSheet(s) {
      var sheetId, sheetName, xlsxSheet;

      sheetId = s['r:id'].replace('rId', '');

      sheetName = 'xl/worksheets/sheet' + sheetId + '.xml';
      xlsxSheet = new XlsxSheet(zip.file(sheetName).asText());
      xlsxSheet.load();
    }

    function buildSheets() {
      var sheets = json.sheets.sheet;

      Excellent.Util.each(sheets, function(s) {

        if (s === undefined) {
          return;
        }

        if (s['@'] !== undefined) {
          s = s['@'];
        }

        workbook.addSheet(s.name);
        buildSheet(s);
      });
    }

    self.load = function() {
      buildFileVersion();
      buildSheets();
    };

    return self;
  }

  self.load = function(xlsxFile) {

    function extractFiles(zipFile) {
      var zip,
        stringZip,
        xlsxWorkbook;

      zip = new JSZip(zipFile);

      stringZip = zip.file('xl/sharedStrings.xml');
      if (stringZip !== null) {
        XlsxStrings.set(stringZip.asText());
      }

      xlsxWorkbook = new XlsxWorkbook(zip.file('xl/workbook.xml').asText(), zip);
      xlsxWorkbook.load();

      return workbook;
    }

    return extractFiles(xlsxFile);
  };

  return self;

};

if (typeof exports !== 'undefined') {
  exports.Excellent = Excellent;
}

})();


text:
<?php namespace Indatus\Dispatcher;

/**
 * @author Ben Kuhl <bkuhl@indatus.com>
 */

use Mockery as m;
use TestCase;

class TestQueue extends TestCase
{
    public function testQueue()
    {
        $item = m::mock('Indatus\Dispatcher\QueueItem');

        $queue = new Queue();
        $this->assertEquals(0, $queue->size());
        $queue->add($item);
        $this->assertEquals(1, $queue->size());
        $this->assertEquals([$item], $queue->flush());
        $this->assertEquals(0, $queue->size());
    }
}

redpajama_set_name: RedPajamaGithub


text:
The provided components for Programming Languages and IDEs

Common Concepts

    Integrated Debug, Trace, and Logging for efficiency in Maintenance

    UTALM as a Low-Cost TDD Environment

    Unit-Tests with make

    How to test small sized adhoc-tools

    How apply hierarchical tests

HowTo

    Test documentation automation

    Create persistent reference data for regression tests

    How apply hierarchical tests

    How to structure release planning

Development Environments

    Eclipse Integration


text:
{% extends "web/base.html" %}
{% block title %}NB FAQ{% endblock %}
{% block css %}
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet" ></link>
{% endblock %}
{% block style %}
span.ui-icon {
display: inline-block;
}
{% endblock %}
{% block js %}

{% endblock %}
{% block content %}

Frequently Asked Questions about NB

  For Students

  For Instructors

      {% endblock %}


text:
<!DOCTYPE html>

        <meta name="viewport"
              content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
        <meta charset="UTF-8">
        <title>AutoComplete</title>
        <link rel="stylesheet" href="../../main.css">
        <link rel="stylesheet" href="/examples/doc.css">

Email AutoComplete

                <input id="email" type="text" class="form-control">


text:
package universum.studios.android.fragment;

import android.util.Log;

import org.junit.Test;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

import universum.studios.android.logging.Logger;
import universum.studios.android.logging.SimpleLogger;
import universum.studios.android.test.local.RobolectricTestCase;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;

/**
 * @author Martin Albedinsky
 */
public final class FragmentsLoggingTest extends RobolectricTestCase {

	@SuppressWarnings("unused") private static final String LOG_TAG = "LoggingTest";

	@Override public void afterTest() throws Exception {
		super.afterTest();
		// Ensure that the logging class has default logger.
		FragmentsLogging.setLogger(null);
	}

	@Test(expected = IllegalAccessException.class)
	public void testInstantiation() throws Exception {
		// Act:
		FragmentsLogging.class.newInstance();
	}

	@Test(expected = InvocationTargetException.class)
	public void testInstantiationWithAccessibleConstructor() throws Exception {
		// Arrange:
		final Constructor<FragmentsLogging> constructor = FragmentsLogging.class.getDeclaredConstructor();
		constructor.setAccessible(true);
		// Act:
		constructor.newInstance();
	}

	@Test public void testDefaultLogger() {
		// Act:
		final Logger logger = FragmentsLogging.getLogger();
		// Assert:
		assertThat(logger, is(notNullValue()));
		assertThat(logger.getLogLevel(), is(Log.ASSERT));
	}

	@Test public void testLogger() {
		// Arrange:
		final Logger logger = new SimpleLogger(Log.DEBUG);
		// Act:
		FragmentsLogging.setLogger(logger);
		assertThat(FragmentsLogging.getLogger(), is(logger));
		FragmentsLogging.setLogger(null);
		assertThat(FragmentsLogging.getLogger(), is(notNullValue()));
	}

	@Test public void testV() {
		// Arrange:
		final Logger mockLogger = mock(Logger.class);
		FragmentsLogging.setLogger(mockLogger);
		// Act:
		FragmentsLogging.v(LOG_TAG, "message.verbose");
		FragmentsLogging.v(LOG_TAG, "message.verbose", null);
		// Assert:
		verify(mockLogger).v(LOG_TAG, "message.verbose");
		verify(mockLogger).v(LOG_TAG, "message.verbose", null);
		verifyNoMoreInteractions(mockLogger);
	}

	@Test public void testD() {
		// Arrange:
		final Logger mockLogger = mock(Logger.class);
		FragmentsLogging.setLogger(mockLogger);
		// Act:
		FragmentsLogging.d(LOG_TAG, "message.debug");
		FragmentsLogging.d(LOG_TAG, "message.debug", null);
		// Assert:
		verify(mockLogger).d(LOG_TAG, "message.debug");
		verify(mockLogger).d(LOG_TAG, "message.debug", null);
		verifyNoMoreInteractions(mockLogger);
	}

	@Test public void testI() {
		// Arrange:
		final Logger mockLogger = mock(Logger.class);
		FragmentsLogging.setLogger(mockLogger);
		// Act:
		FragmentsLogging.i(LOG_TAG, "message.info");
		FragmentsLogging.i(LOG_TAG, "message.info", null);
		// Assert:
		verify(mockLogger).i(LOG_TAG, "message.info");
		verify(mockLogger).i(LOG_TAG, "message.info", null);
		verifyNoMoreInteractions(mockLogger);
	}

	@Test public void testW() {
		// Arrange:
		final Logger mockLogger = mock(Logger.class);
		FragmentsLogging.setLogger(mockLogger);
		// Act:
		FragmentsLogging.w(LOG_TAG, "message.warn");
		FragmentsLogging.w(LOG_TAG, "message.warn", null);
		FragmentsLogging.w(LOG_TAG, (Throwable) null);
		// Assert:
		verify(mockLogger).w(LOG_TAG, "message.warn");
		verify(mockLogger).w(LOG_TAG, "message.warn", null);
		verify(mockLogger).w(LOG_TAG, (Throwable) null);
		verifyNoMoreInteractions(mockLogger);
	}

	@Test public void testE() {
		// Arrange:
		final Logger mockLogger = mock(Logger.class);
		FragmentsLogging.setLogger(mockLogger);
		// Act:
		FragmentsLogging.e(LOG_TAG, "message.error");
		FragmentsLogging.e(LOG_TAG, "message.error", null);
		// Assert:
		verify(mockLogger).e(LOG_TAG, "message.error");
		verify(mockLogger).e(LOG_TAG, "message.error", null);
		verifyNoMoreInteractions(mockLogger);
	}

	@Test public void testWTF() {
		// Arrange:
		final Logger mockLogger = mock(Logger.class);
		FragmentsLogging.setLogger(mockLogger);
		// Act:
		FragmentsLogging.wtf(LOG_TAG, "message.wtf");
		FragmentsLogging.wtf(LOG_TAG, "message.wtf", null);
		FragmentsLogging.wtf(LOG_TAG, (Throwable) null);
		// Assert:
		verify(mockLogger).wtf(LOG_TAG, "message.wtf");
		verify(mockLogger).wtf(LOG_TAG, "message.wtf", null);
		verify(mockLogger).wtf(LOG_TAG, (Throwable) null);
		verifyNoMoreInteractions(mockLogger);
	}
}


text:
package org.jboss.weld.bean.builtin;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Set;

import jakarta.enterprise.context.spi.CreationalContext;
import jakarta.enterprise.inject.spi.AnnotatedParameter;
import jakarta.enterprise.inject.spi.AnnotatedType;
import jakarta.enterprise.inject.spi.InjectionPoint;
import jakarta.enterprise.inject.spi.InterceptionFactory;

import org.jboss.weld.injection.InterceptionFactoryImpl;
import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.collections.ImmutableSet;
import org.jboss.weld.util.reflection.Reflections;

/**
 *
 * @author Martin Kouba
 *
 * @param <T>
 */
public class InterceptionFactoryBean extends AbstractStaticallyDecorableBuiltInBean<InterceptionFactory<?>> {

    private static final Set<Type> TYPES = ImmutableSet.<Type> of(InterceptionFactory.class, Object.class);

    public InterceptionFactoryBean(BeanManagerImpl beanManager) {
        super(beanManager, Reflections.<Class<InterceptionFactory<?>>> cast(InterceptionFactory.class));
    }

    @Override
    protected InterceptionFactory<?> newInstance(InjectionPoint ip, CreationalContext<InterceptionFactory<?>> creationalContext) {
        AnnotatedParameter<?> annotatedParameter = (AnnotatedParameter<?>) ip.getAnnotated();
        ParameterizedType parameterizedType = (ParameterizedType) annotatedParameter.getBaseType();
        AnnotatedType<?> annotatedType = beanManager.createAnnotatedType(Reflections.getRawType(parameterizedType.getActualTypeArguments()[0]));
        return InterceptionFactoryImpl.of(beanManager, creationalContext, annotatedType);
    }

    @Override
    public Set<Type> getTypes() {
        return TYPES;
    }

    @Override
    public String toString() {
        return "Implicit Bean [" + InterceptionFactory.class.getName() + "] with qualifiers [@Default]";
    }

}


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

namespace JellyDb.Core.Sql.Dml
{
    public class ByteArrayTerm :ValueTerm<byte[]>
    {
        public override byte[] Value
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }
    }
}


text:
package alicloud

import (
	"fmt"
	"log"
	"regexp"

	"github.com/alibaba/terraform-provider/alicloud/connectivity"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
	"github.com/hashicorp/terraform/helper/schema"
)

func dataSourceAlicloudInstances() *schema.Resource {
	return &schema.Resource{
		Read: dataSourceAlicloudInstancesRead,

		Schema: map[string]*schema.Schema{
			"ids": {
				Type:     schema.TypeList,
				Optional: true,
				Elem:     &schema.Schema{Type: schema.TypeString},
				ForceNew: true,
				MinItems: 1,
			},
			"name_regex": {
				Type:         schema.TypeString,
				Optional:     true,
				ValidateFunc: validateNameRegex,
				ForceNew:     true,
			},
			"image_id": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			"status": {
				Type:         schema.TypeString,
				Optional:     true,
				ValidateFunc: validateInstanceStatus,
				ForceNew:     true,
			},
			"vpc_id": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			"vswitch_id": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},
			"availability_zone": &schema.Schema{
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},

			"tags": tagsSchema(),

			"output_file": {
				Type:     schema.TypeString,
				Optional: true,
				ForceNew: true,
			},

			// Computed values
			"instances": {
				Type:     schema.TypeList,
				Computed: true,
				Elem: &schema.Resource{
					Schema: map[string]*schema.Schema{
						"id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"region_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"availability_zone": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"status": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"name": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"instance_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"vpc_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"vswitch_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"image_id": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"private_ip": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"public_ip": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"eip": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"description": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"security_groups": {
							Type:     schema.TypeList,
							Computed: true,
							Elem:     &schema.Schema{Type: schema.TypeString},
						},
						"key_name": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"creation_time": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"instance_charge_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"internet_charge_type": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"internet_max_bandwidth_out": {
							Type:     schema.TypeInt,
							Computed: true,
						},
						"spot_strategy": {
							Type:     schema.TypeString,
							Computed: true,
						},
						"disk_device_mappings": {
							Type:     schema.TypeList,
							Computed: true,
							//Set:      imageDiskDeviceMappingHash,
							Elem: &schema.Resource{
								Schema: map[string]*schema.Schema{
									"device": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"size": {
										Type:     schema.TypeInt,
										Computed: true,
									},
									"category": {
										Type:     schema.TypeString,
										Computed: true,
									},
									"type": {
										Type:     schema.TypeString,
										Computed: true,
									},
								},
							},
						},
						"tags": tagsSchema(),
					},
				},
			},
		},
	}
}
func dataSourceAlicloudInstancesRead(d *schema.ResourceData, meta interface{}) error {
	client := meta.(*connectivity.AliyunClient)

	args := ecs.CreateDescribeInstancesRequest()
	args.Status = d.Get("status").(string)

	if v, ok := d.GetOk("ids"); ok && len(v.([]interface{})) > 0 {
		args.InstanceIds = convertListToJsonString(v.([]interface{}))
	}
	if v, ok := d.GetOk("vpc_id"); ok && v.(string) != "" {
		args.VpcId = v.(string)
	}
	if v, ok := d.GetOk("vswitch_id"); ok && v.(string) != "" {
		args.VSwitchId = v.(string)
	}
	if v, ok := d.GetOk("availability_zone"); ok && v.(string) != "" {
		args.ZoneId = v.(string)
	}
	if v, ok := d.GetOk("tags"); ok {
		var tags []ecs.DescribeInstancesTag

		for key, value := range v.(map[string]interface{}) {
			tags = append(tags, ecs.DescribeInstancesTag{
				Key:   key,
				Value: value.(string),
			})
		}
		args.Tag = &tags
	}

	var allInstances []ecs.Instance
	args.PageSize = requests.NewInteger(PageSizeLarge)
	args.PageNumber = requests.NewInteger(1)

	for {
		raw, err := client.WithEcsClient(func(ecsClient *ecs.Client) (interface{}, error) {
			return ecsClient.DescribeInstances(args)
		})
		if err != nil {
			return err
		}
		resp, _ := raw.(*ecs.DescribeInstancesResponse)
		if resp == nil || len(resp.Instances.Instance) < 1 {
			break
		}

		allInstances = append(allInstances, resp.Instances.Instance...)

		if len(resp.Instances.Instance) < PageSizeLarge {
			break
		}

		args.PageNumber = args.PageNumber + requests.NewInteger(1)
	}

	var filteredInstancesTemp []ecs.Instance

	nameRegex, ok := d.GetOk("name_regex")
	imageId, okImg := d.GetOk("image_id")
	if (ok && nameRegex.(string) != "") || (okImg && imageId.(string) != "") {
		var r *regexp.Regexp
		if nameRegex != "" {
			r = regexp.MustCompile(nameRegex.(string))
		}
		for _, inst := range allInstances {
			if r != nil && !r.MatchString(inst.InstanceName) {
				continue
			}
			if imageId.(string) != "" && inst.ImageId != imageId.(string) {
				continue
			}
			filteredInstancesTemp = append(filteredInstancesTemp, inst)
		}
	} else {
		filteredInstancesTemp = allInstances
	}

	if len(filteredInstancesTemp) < 1 {
		return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.")
	}

	log.Printf("[DEBUG] alicloud_instances - Instances found: %#v", filteredInstancesTemp)

	return instancessDescriptionAttributes(d, filteredInstancesTemp, meta)
}

// populate the numerous fields that the instance description returns.
func instancessDescriptionAttributes(d *schema.ResourceData, instances []ecs.Instance, meta interface{}) error {
	var ids []string
	var s []map[string]interface{}
	for _, inst := range instances {
		mapping := map[string]interface{}{
			"id":                         inst.InstanceId,
			"region_id":                  inst.RegionId,
			"availability_zone":          inst.ZoneId,
			"status":                     inst.Status,
			"name":                       inst.InstanceName,
			"instance_type":              inst.InstanceType,
			"vpc_id":                     inst.VpcAttributes.VpcId,
			"vswitch_id":                 inst.VpcAttributes.VSwitchId,
			"image_id":                   inst.ImageId,
			"description":                inst.Description,
			"security_groups":            inst.SecurityGroupIds.SecurityGroupId,
			"eip":                        inst.EipAddress.IpAddress,
			"key_name":                   inst.KeyPairName,
			"spot_strategy":              inst.SpotStrategy,
			"creation_time":              inst.CreationTime,
			"instance_charge_type":       inst.InstanceChargeType,
			"internet_charge_type":       inst.InternetChargeType,
			"internet_max_bandwidth_out": inst.InternetMaxBandwidthOut,
			// Complex types get their own functions
			"disk_device_mappings": instanceDisksMappings(d, inst.InstanceId, meta),
			"tags":                 tagsToMap(inst.Tags.Tag),
		}
		if len(inst.InnerIpAddress.IpAddress) > 0 {
			mapping["private_ip"] = inst.InnerIpAddress.IpAddress[0]
		} else {
			mapping["private_ip"] = inst.VpcAttributes.PrivateIpAddress.IpAddress[0]
		}
		if len(inst.PublicIpAddress.IpAddress) > 0 {
			mapping["public_ip"] = inst.PublicIpAddress.IpAddress[0]
		} else {
			mapping["public_ip"] = inst.VpcAttributes.NatIpAddress
		}

		log.Printf("[DEBUG] alicloud_instance - adding instance mapping: %v", mapping)
		ids = append(ids, inst.InstanceId)
		s = append(s, mapping)
	}

	d.SetId(dataResourceIdHash(ids))
	if err := d.Set("instances", s); err != nil {
		return err
	}

	// create a json file in current directory and write data source to it.
	if output, ok := d.GetOk("output_file"); ok && output.(string) != "" {
		writeToFile(output.(string), s)
	}
	return nil
}

//Returns a mapping of instance disks
func instanceDisksMappings(d *schema.ResourceData, instanceId string, meta interface{}) []map[string]interface{} {
	client := meta.(*connectivity.AliyunClient)
	req := ecs.CreateDescribeDisksRequest()
	req.InstanceId = instanceId

	raw, err := client.WithEcsClient(func(ecsClient *ecs.Client) (interface{}, error) {
		return ecsClient.DescribeDisks(req)
	})

	if err != nil {
		log.Printf("[ERROR] DescribeDisks for instance got error: %#v", err)
		return nil
	}
	resp, _ := raw.(*ecs.DescribeDisksResponse)
	if resp == nil || len(resp.Disks.Disk) < 1 {
		return nil
	}

	var s []map[string]interface{}

	for _, v := range resp.Disks.Disk {
		mapping := map[string]interface{}{
			"device":   v.Device,
			"size":     v.Size,
			"category": v.Category,
			"type":     v.Type,
		}

		log.Printf("[DEBUG] alicloud_instances - adding disk device mapping: %v", mapping)
		s = append(s, mapping)
	}

	return s
}


text:
/*
 * TestFX
 * ruicouto in 12/jan/2017
 */
package testfx;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 *
 * @author ruicouto
 */
public class TestFX extends Application {

    @Override
    public void start(Stage stage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
        Scene scene = new Scene(root);
        stage.setScene(scene);
        stage.show();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }

}


text:
(function () {
	'use strict';

	/**
	 * @ngdoc function
	 * @name app.test:adminpollTest
	 * @description
	 * # adminpollTest
	 * Test of the app
	 */

	describe('adminpoll test', function () {
		var controller = null, $scope = null;

		beforeEach(function () {
			module('openaudit');
		});

		beforeEach(inject(function ($controller, $rootScope) {
			$scope = $rootScope.$new();
			controller = $controller('AdminpollCtrl', {
				$scope: $scope
			});
		}));

		it('Should controller must be defined', function () {
			expect(controller).toBeDefined();
		});

	});
})();