"ZAPHNATH-PAANEAH "the name which Pharaoh gave to Joseph when he raised him to the rank of prime minister or grand vizier of the kingdom(Genesis 41:45). This is a pure Egyptian word, and has been variously explained. Some think it means “creator,” or “preserver of life.” Brugsch interprets it as “governor of the district of the place of life”, i.e., of Goshen, the chief city of which was Pithom, “the place of life.” Others explain it as meaning “a revealer of secrets,” or “the man to whom secrets are revealed.”
"ZAPHNATH-PAANEAH "the name which Pharaoh gave to Joseph when he raised him to the rank of prime minister or grand vizier of the kingdom(Genesis 41:45). This is a pure Egyptian word, and has been variously explained. Some think it means “creator,” or “preserver of life.” Brugsch interprets it as “governor of the district of the place of life”, i.e., of Goshen, the chief city of which was Pithom, “the place of life.” Others explain it as meaning “a revealer of secrets,” or “the man to whom secrets are revealed.”


START VR
Seems like something went wrong.
...
Camera up degrees
-
+
Camera down degrees
-
+
Camera left degrees
-
+
Camera right degrees
-
+
Camera translate X
-
+
Camera translate Y
-
+
Camera translate Z
-
+
Camera tilt X
-
+
Camera tilt Y
-
+
Camera tilt Z
-
+
Serialize Scene


| 1 | package net.mooctest; | |
| 2 | ||
| 3 | /** | |
| 4 | * ExpressionParser provides methods for evaluating mathematical expressions, | |
| 5 | * specifically tailored for parsing with this library. ExpressionParser | |
| 6 | * supports basic arithmetic operators, parenthesized expressions, variable | |
| 7 | * substitution as well as basic functions. | |
| 8 | */ | |
| 9 | public class ExpressionParser extends MathParser { | |
| 10 | ||
| 11 | /** | |
| 12 | * Regex which matches a number. It may be signed or use scientific notation. | |
| 13 | */ | |
| 14 | protected static final String numberRegex = "(([+-]?)\\d+(\\.\\d+)?([eE](-?)\\d+)?)"; | |
| 15 | ||
| 16 | /** | |
| 17 | * Regex which matches a signed number. It may use scientific notation. | |
| 18 | */ | |
| 19 | protected static final String signedNumberRegex = "([+-]\\d+(\\.\\d+)?([eE](-?)\\d+)?)"; | |
| 20 | ||
| 21 | /** | |
| 22 | * Regex which matches an assignment statement. It is simply a word, followed by | |
| 23 | * an equals sign (=) and an expression. | |
| 24 | */ | |
| 25 | protected static final String assignmentRegex = "(\\s+)?(\\w+)(\\s+)(=)(.*)"; | |
| 26 | ||
| 27 | /** | |
| 28 | * Array of supported operators. The operators are arranged in their order of | |
| 29 | * precedence. Thus, operators to the left will be evaluated before those to the | |
| 30 | * right. | |
| 31 | */ | |
| 32 | protected static final String[] operators = { "^", "%", "/", "*", "+", "-" }; | |
| 33 | ||
| 34 | /** | |
| 35 | * Array of variables maintained by an ExpressionParser object. The first String | |
| 36 | * in each line stores the variable name, whicle the second stores the value. | |
| 37 | */ | |
| 38 | public String[][] variables; | |
| 39 | ||
| 40 | /** | |
| 41 | * Index of the last variable in the 'variables' array. Elements in the | |
| 42 | * 'variables' array after this index are all blank, so they are not parsed | |
| 43 | * during expression evaluation. | |
| 44 | */ | |
| 45 | public int numberOfVars; | |
| 46 | ||
| 47 | /** | |
| 48 | * Constructor of ExpressionParser. This constructor initializes the variable | |
| 49 | * cache with the specified maximum size. | |
| 50 | * | |
| 51 | * @param maxVars | |
| 52 | * the maximum number of variables to be stored | |
| 53 | */ | |
| 54 | public ExpressionParser(int maxVars) { | |
| 55 | variables = new String[maxVars][2]; | |
| 56 | numberOfVars = 0; | |
| 57 | } | |
| 58 | ||
| 59 | /** | |
| 60 | * Adds a variable to the variable cache. This method accepts the variable name, | |
| 61 | * as well as the String each occurrence is to be substituted with. | |
| 62 | * | |
| 63 | * @param name | |
| 64 | * the name of the variable | |
| 65 | * @param value | |
| 66 | * the value the variable holds | |
| 67 | */ | |
| 68 | public void addVariable(String name, String value) { | |
| 69 | /* Loop through the stored variables */ | |
| 70 |
3
1. addVariable : changed conditional boundary → KILLED 2. addVariable : Changed increment from 1 to -1 → KILLED 3. addVariable : negated conditional → KILLED |
for (int i = 0; i < numberOfVars; i++) { |
| 71 | /* If the variable already exists, simply update the value */ | |
| 72 |
1
1. addVariable : negated conditional → KILLED |
if (variables[i][0].equals(name)) { |
| 73 | variables[i][1] = value; | |
| 74 | return; | |
| 75 | } | |
| 76 | } | |
| 77 | /* | |
| 78 | * Create a new variable by storing the name and value in the variables array, | |
| 79 | * then update numberOfVars | |
| 80 | */ | |
| 81 | variables[numberOfVars][0] = name; | |
| 82 | variables[numberOfVars][1] = value; | |
| 83 |
1
1. addVariable : Replaced integer addition with subtraction → KILLED |
numberOfVars++; |
| 84 | } | |
| 85 | ||
| 86 | /** | |
| 87 | * Evaluates a String representation of a mathematical expression into a number | |
| 88 | * (stored as a String). | |
| 89 | * | |
| 90 | * @param exp | |
| 91 | * the expression to be evaluated | |
| 92 | * @return the result after evaluating the expression | |
| 93 | * @throws cn.edu.nju.ise.math.NullExpressionException | |
| 94 | * thrown when the expression is empty | |
| 95 | * @throws cn.edu.nju.ise.math.ExpressionParserException | |
| 96 | * thrown when the expression cannot be parsed | |
| 97 | */ | |
| 98 | public String evaluate(String exp) throws ExpressionParserException { | |
| 99 | String result = exp; | |
| 100 |
1
1. evaluate : negated conditional → KILLED |
if (exp.trim().length() == 0) { |
| 101 | /* Throw an Exception if the expression is blank */ | |
| 102 | throw new NullExpressionException(); | |
| 103 |
1
1. evaluate : negated conditional → KILLED |
} else if (isNumber(exp)) { |
| 104 | /* If the expression is already a number, there is nothing to evaluate */ | |
| 105 |
1
1. evaluate : mutated return of Object value for net/mooctest/ExpressionParser::evaluate to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return "" + Double.parseDouble(exp); |
| 106 |
1
1. evaluate : negated conditional → KILLED |
} else if (exp.matches(assignmentRegex)) { |
| 107 | /* | |
| 108 | * If the expression is an assignment statement, interpret everything before the | |
| 109 | * equals sign (=) as the variable name. The rest is simply another expression, | |
| 110 | * which is also the value of the variable. | |
| 111 | */ | |
| 112 | String varName = exp.substring(0, exp.indexOf("=")).trim(); | |
| 113 |
1
1. evaluate : Replaced integer addition with subtraction → KILLED |
String varValue = evaluate(exp.substring(exp.indexOf("=") + 1)); |
| 114 | ||
| 115 | /* | |
| 116 | * Add the variable in the cache, then use the value of the variable as the | |
| 117 | * evaluated result | |
| 118 | */ | |
| 119 |
1
1. evaluate : removed call to net/mooctest/ExpressionParser::addVariable → KILLED |
addVariable(varName, varValue); |
| 120 | exp = varValue; | |
| 121 | } else { | |
| 122 | /* | |
| 123 | * Replace all variables with their values, solve everything within parenthesis, | |
| 124 | * then Solve all functions | |
| 125 | */ | |
| 126 | exp = parseVariables(exp); | |
| 127 | exp = parseParenthesis(exp); | |
| 128 | exp = parseFunctions(exp); | |
| 129 | ||
| 130 | /* | |
| 131 | * The expression is now simply a collection of numbers and arithmetic | |
| 132 | * operators. Finish off the process by solving each operation, following the | |
| 133 | * BODMAS rule. | |
| 134 | */ | |
| 135 | exp = parseOperators(exp); | |
| 136 | } | |
| 137 | ||
| 138 | try { | |
| 139 | /* Check if the result is a valid number */ | |
| 140 | result = "" + Double.parseDouble(exp); | |
| 141 | } catch (Exception e) { | |
| 142 | /* Throw an Exception if the result is not a number */ | |
| 143 | throw new ExpressionParserException(exp); | |
| 144 | } | |
| 145 |
1
1. evaluate : mutated return of Object value for net/mooctest/ExpressionParser::evaluate to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return result; |
| 146 | } | |
| 147 | ||
| 148 | /** | |
| 149 | * Substitutes all instances of the variables in the cache with their values. A | |
| 150 | * variable name present in the expression must be enclosed within angled | |
| 151 | * brackets (<, >) in order to be recognized. | |
| 152 | * For example, if x = 10.0, then all instances of | |
| 153 | * <x> will be replaced with 10.0 | |
| 154 | * | |
| 155 | * @param exp | |
| 156 | * the expression to be parsed | |
| 157 | * @return the expression after substituting known values of variables stored in | |
| 158 | * the cache | |
| 159 | * @throws cn.edu.nju.ise.math.VariableNotFoundException | |
| 160 | * thrown when an unrecognized variable name is found in the | |
| 161 | * expression | |
| 162 | */ | |
| 163 | ||
| 164 | protected String parseVariables(String exp) throws VariableNotFoundException { | |
| 165 | /* | |
| 166 | * Loop through the variable cache, checking for occurrences of the variables | |
| 167 | * (enclosed within angled brackets)(<var_name>) | |
| 168 | */ | |
| 169 |
3
1. parseVariables : changed conditional boundary → KILLED 2. parseVariables : Changed increment from 1 to -1 → KILLED 3. parseVariables : negated conditional → KILLED |
for (int i = 0; i < numberOfVars; i++) { |
| 170 | /* Replace all instances of the variable with its value directly */ | |
| 171 | exp = exp.replaceAll("<(\\s+)?" + variables[i][0] + "(\\s+)?>", variables[i][1]); | |
| 172 | } | |
| 173 | ||
| 174 | /* | |
| 175 | * Check if any unrecognized variables are present. This can be done very simply | |
| 176 | * as the presence of angled brackets (<>) indicates an unreplaced variable. | |
| 177 | */ | |
| 178 | int start = exp.indexOf("<"); | |
| 179 | int end = exp.indexOf(">"); | |
| 180 |
4
1. parseVariables : changed conditional boundary → SURVIVED 2. parseVariables : negated conditional → KILLED 3. parseVariables : negated conditional → KILLED 4. parseVariables : negated conditional → KILLED |
if (start != -1 && end != -1 && start < end) { |
| 181 | /* | |
| 182 | * Extract the unreplaced variable name, which is clearly in between the angled | |
| 183 | * brackets, then throw an Exception. | |
| 184 | */ | |
| 185 |
1
1. parseVariables : Replaced integer addition with subtraction → SURVIVED |
throw new VariableNotFoundException(exp, exp.substring(start, end + 1)); |
| 186 | } | |
| 187 | ||
| 188 | /* | |
| 189 | * Adjust the number spacing before passing the expression back to the evaluater | |
| 190 | */ | |
| 191 | exp = adjustNumberSpacing(exp); | |
| 192 |
1
1. parseVariables : mutated return of Object value for net/mooctest/ExpressionParser::parseVariables to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return exp.trim(); |
| 193 | } | |
| 194 | ||
| 195 | /** | |
| 196 | * Substitutes expressions within parenthesis ((, )) | |
| 197 | * with their results. This ensures that while evaluating an expression | |
| 198 | * containing parenthesized parts, those parenthesized parts are evaluated | |
| 199 | * first. This is done so that ExpressionParser follows the BODMAS rule. | |
| 200 | * | |
| 201 | * @param exp | |
| 202 | * the expression to be parsed | |
| 203 | * @return the expression such that all parenthesized parts have been evaluated | |
| 204 | * @throws cn.edu.nju.ise.math.UnmatchedBracketsException | |
| 205 | * thrown when brackets in the expression are not closed | |
| 206 | * @throws cn.edu.nju.ise.math.ExpressionParserException | |
| 207 | * thrown if the parenthesized sections cannot be parsed | |
| 208 | */ | |
| 209 | ||
| 210 | protected String parseParenthesis(String exp) throws ExpressionParserException { | |
| 211 | String result = ""; | |
| 212 | /* | |
| 213 | * Buffer the extreme ends with spaces, to make sure no Exceptions are thrown | |
| 214 | * while extracting portions of the expression. | |
| 215 | */ | |
| 216 | exp = " " + exp + " "; | |
| 217 | ||
| 218 | /* | |
| 219 | * Continue replacing parenthesized sections as long as a parenthesis is present | |
| 220 | */ | |
| 221 |
1
1. parseParenthesis : negated conditional → KILLED |
while (exp.indexOf("(") != -1) { |
| 222 | /* Store the indices of the opening and closing parenthesis */ | |
| 223 | int start = exp.indexOf("("); | |
| 224 | int end = indexOfMatchingBracket(exp, start, '(', ')'); | |
| 225 | /* | |
| 226 | * The enclosed section is simply another expression. Pass it to the evaluater | |
| 227 | */ | |
| 228 |
1
1. parseParenthesis : Replaced integer addition with subtraction → KILLED |
result = evaluate(exp.substring(start + 1, end)); |
| 229 | ||
| 230 | /* | |
| 231 | * This is a special case. Make sure that ' -(some_expression) ' is interpreted | |
| 232 | * as the negative of that expression. | |
| 233 | */ | |
| 234 |
2
1. parseParenthesis : Replaced integer subtraction with addition → KILLED 2. parseParenthesis : negated conditional → KILLED |
if (exp.charAt(start - 1) == '-') { |
| 235 | /* Multiply the enclosed section by -1, then evaluate the result */ | |
| 236 | result = " ( -1 * ( " + result + " ) ) "; | |
| 237 |
1
1. parseParenthesis : Changed increment from -1 to 1 → KILLED |
start--; |
| 238 | } | |
| 239 | ||
| 240 | /* | |
| 241 | * Graft the evaluated parenthesized portion back into the original expression | |
| 242 | */ | |
| 243 |
1
1. parseParenthesis : Replaced integer addition with subtraction → KILLED |
exp = exp.substring(0, start) + " " // before the opening bracket |
| 244 | + result + " " // evaluated part | |
| 245 | + exp.substring(end + 1); // after the closing bracket | |
| 246 | } | |
| 247 | /* | |
| 248 | * Adjust the number spacing before passing the expression back to the evaluater | |
| 249 | */ | |
| 250 | exp = adjustNumberSpacing(exp); | |
| 251 |
1
1. parseParenthesis : mutated return of Object value for net/mooctest/ExpressionParser::parseParenthesis to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return exp.trim(); |
| 252 | } | |
| 253 | ||
| 254 | /** | |
| 255 | * Substitutes all occurrences of supported mathematical functions with their | |
| 256 | * result. A function must be present in the expression in the following format | |
| 257 | * : function_name[function_argument], where the function argument | |
| 258 | * can also be an expression. The function name must be exactly 3 characters | |
| 259 | * long, and be immediately followed by a sqaure bracket ([). | |
| 260 | * | |
| 261 | * @param exp | |
| 262 | * the expression to be parsed | |
| 263 | * @return the expression such that all instances of functions are evaluated | |
| 264 | * @throws cn.edu.nju.ise.math.MissingOperandException | |
| 265 | * thrown if there is no function argument | |
| 266 | * @throws cn.edu.nju.ise.math.FunctionNotFoundException | |
| 267 | * thrown when an unrecognized function name is found in the | |
| 268 | * expression | |
| 269 | * @throws cn.edu.nju.ise.math.UnmatchedBracketsException | |
| 270 | * thrown when a square bracket is not closed | |
| 271 | * @throws cn.edu.nju.ise.math.ExpressionParserException | |
| 272 | * thrown if the function argument cannot be parsed | |
| 273 | */ | |
| 274 | protected String parseFunctions(String exp) throws ExpressionParserException { | |
| 275 | String result = ""; | |
| 276 | String func = ""; | |
| 277 | double x = 0.0; | |
| 278 | /* | |
| 279 | * Buffer the extreme ends with spaces, to make sure no Exceptions are thrown | |
| 280 | * while extracting portions of the expression. | |
| 281 | */ | |
| 282 | exp = " " + exp + " "; | |
| 283 | try { | |
| 284 | /* | |
| 285 | * This is another special case. Make sure that expressions of the form | |
| 286 | * 'number!' are interpreted as the factorial of that number. This can be done | |
| 287 | * simply by replacing all such cases with the expression 'fct[number]', as | |
| 288 | * 'fct[]' is a valid function name and can be calculated later. | |
| 289 | */ | |
| 290 | exp = exp.replaceAll(numberRegex + "\\s+!", " fct[$1] "); | |
| 291 | ||
| 292 | /* | |
| 293 | * Continue evaluating functions as long as square brackets ([]) are present. | |
| 294 | * Here, a function is reperssented in the format 'fnc[expression]'. Thus, the | |
| 295 | * presence of square brackets ([]) implies that a function is present. | |
| 296 | */ | |
| 297 |
1
1. parseFunctions : negated conditional → KILLED |
while (exp.indexOf("[") != -1) { |
| 298 | /* Store the indices of the opening and closing square brackets */ | |
| 299 | int start = exp.indexOf("["); | |
| 300 | int end = indexOfMatchingBracket(exp, start, '[', ']'); | |
| 301 | ||
| 302 | /* | |
| 303 | * Here, all function names are exactly 3 characters long. Thus, the function | |
| 304 | * name is simply the 3 characters preceding the opening bracket. | |
| 305 | */ | |
| 306 |
1
1. parseFunctions : Replaced integer subtraction with addition → KILLED |
func = exp.substring(start - 3, start); |
| 307 | ||
| 308 | /* | |
| 309 | * The section enclosed within the brackets is also an expression. Evaluate it, | |
| 310 | * and check whether it is a number. This will be the function argument. | |
| 311 | */ | |
| 312 |
1
1. parseFunctions : Replaced integer addition with subtraction → KILLED |
x = Double.parseDouble(evaluate(exp.substring(start + 1, end))); |
| 313 | ||
| 314 | /* Pass the function name and argument to a function solver */ | |
| 315 | result = "" + solveUnaryFunction(func, x); | |
| 316 | ||
| 317 | /* | |
| 318 | * This is a special case similar to that in parseParenthesis(String). Make sure | |
| 319 | * that ' -fnc[some_expression] ' is interpreted as the negative of the result | |
| 320 | * of that function. | |
| 321 | */ | |
| 322 |
2
1. parseFunctions : Replaced integer subtraction with addition → KILLED 2. parseFunctions : negated conditional → KILLED |
if (exp.charAt(start - 4) == '-') { |
| 323 | /* Multiply the enclosed section by -1, then evaluate the result */ | |
| 324 | result = evaluate(" ( -1 * ( " + result + " ) ) "); | |
| 325 |
1
1. parseFunctions : Changed increment from -1 to 1 → KILLED |
start--; |
| 326 | } | |
| 327 | /* Graft the evaluated portion back into the original expression */ | |
| 328 |
2
1. parseFunctions : Replaced integer subtraction with addition → KILLED 2. parseFunctions : Replaced integer addition with subtraction → KILLED |
exp = exp.substring(0, start - 3) + " " // before the function |
| 329 | + result + " " // evaluated part | |
| 330 | + exp.substring(end + 1); // after the function | |
| 331 | } | |
| 332 | } catch (NullExpressionException e) { | |
| 333 | /* Throw an Exceeption if the function is missing its argument */ | |
| 334 | throw new MissingOperandException(exp, func + "[]"); | |
| 335 | } catch (FunctionNotFoundException e) { | |
| 336 | /* Throw an Exception if an extracted function name is unsupported */ | |
| 337 | throw new FunctionNotFoundException(exp, func); | |
| 338 | } catch (ExpressionParserException e) { | |
| 339 | /* Pass on any Exceptions encountered while evaluating the argument */ | |
| 340 | throw e; | |
| 341 | } catch (Exception e) { | |
| 342 | /* Pass on any other Exceptions as ExpressionParserExceptions */ | |
| 343 | throw new ExpressionParserException(exp); | |
| 344 | } | |
| 345 | /* | |
| 346 | * Adjust the number spacing before passing the expression back to the evaluater | |
| 347 | */ | |
| 348 | exp = adjustNumberSpacing(exp); | |
| 349 |
1
1. parseFunctions : mutated return of Object value for net/mooctest/ExpressionParser::parseFunctions to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return exp.trim(); |
| 350 | } | |
| 351 | ||
| 352 | /** | |
| 353 | * Substitutes all binary expressions involving arithmetic operators with their | |
| 354 | * result. Operations are performed following the BODMAS rule. The resultant | |
| 355 | * parsed String is free of all operators, thus containing only numbers. See | |
| 356 | * {@link cn.edu.nju.ise.math.MathParser#solveBinaryOperation(double, String, double)} | |
| 357 | * for a list of supported operators. See {@link #operators}, which defines the | |
| 358 | * order of operations. | |
| 359 | * | |
| 360 | * @param exp | |
| 361 | * the expression to be parsed | |
| 362 | * @return the expression such that all arithmetic operations have been carried | |
| 363 | * out | |
| 364 | * @throws cn.edu.nju.ise.math.MissingOperandException | |
| 365 | * thrown if a binary operator is missing an operand | |
| 366 | */ | |
| 367 | protected String parseOperators(String exp) throws MissingOperandException { | |
| 368 | int leftIndex, rightIndex; | |
| 369 | ||
| 370 | try { | |
| 371 | /* | |
| 372 | * This code addresses a small problem in directly implementing BODMAS. | |
| 373 | * Expressions like (1 - 2 + 3) will mistakenly evaluate to (-4) if the addition | |
| 374 | * is done first, disregarding the minus sign before the (2). Eliminate this | |
| 375 | * problem by changing all instances of subtraction to addition of the second | |
| 376 | * operand's negative form. Thus, the minus sign acting as an operator now | |
| 377 | * becomes part of the number itself, and all ambiguity disappears. | |
| 378 | */ | |
| 379 |
1
1. parseOperators : negated conditional → TIMED_OUT |
while (exp.matches("(.*)" + numberRegex + "\\s+-\\s+" + numberRegex + "(.*)")) { |
| 380 | exp = exp.replaceAll(numberRegex + "\\s+-\\s+" + numberRegex, " $1 + -($6) "); | |
| 381 | exp = parseParenthesis(exp); | |
| 382 | } | |
| 383 | } catch (Exception e) { | |
| 384 | /* | |
| 385 | * Something went seriously wrong - the expressions in the 'try' block were | |
| 386 | * valid | |
| 387 | */ | |
| 388 |
1
1. parseOperators : removed call to java/io/PrintStream::print → SURVIVED |
System.out.print("You should never see this message. If you do, please inform the author."); |
| 389 |
1
1. parseOperators : removed call to java/lang/Exception::printStackTrace → SURVIVED |
e.printStackTrace(); |
| 390 | } | |
| 391 | ||
| 392 | /* Split the expression into a stack of operators and operands */ | |
| 393 | String[] stack = exp.split("\\s+"); | |
| 394 | ||
| 395 | /* Loop through all supported operators (in order) */ | |
| 396 | for (String op : operators) { | |
| 397 | /* Loop through the stack, searching for a match with the operator */ | |
| 398 |
3
1. parseOperators : changed conditional boundary → KILLED 2. parseOperators : Changed increment from 1 to -1 → KILLED 3. parseOperators : negated conditional → KILLED |
for (int i = 0; i < stack.length; i++) { |
| 399 |
1
1. parseOperators : negated conditional → KILLED |
if (stack[i].equals(op)) { |
| 400 | leftIndex = rightIndex = i; | |
| 401 | /* Keep on searching before the operator until a valid operand is found */ | |
| 402 |
3
1. parseOperators : changed conditional boundary → SURVIVED 2. parseOperators : negated conditional → KILLED 3. parseOperators : negated conditional → KILLED |
while (leftIndex >= 0 && !isNumber(stack[leftIndex])) |
| 403 |
1
1. parseOperators : Changed increment from -1 to 1 → KILLED |
leftIndex--; |
| 404 | /* Keep on searching after the operator until a valid operand is found */ | |
| 405 |
3
1. parseOperators : changed conditional boundary → SURVIVED 2. parseOperators : negated conditional → KILLED 3. parseOperators : negated conditional → KILLED |
while (rightIndex < stack.length && !isNumber(stack[rightIndex])) |
| 406 |
1
1. parseOperators : Changed increment from 1 to -1 → KILLED |
rightIndex++; |
| 407 | try { | |
| 408 | /* Get the operands */ | |
| 409 | double left = Double.parseDouble(stack[leftIndex]); | |
| 410 | double right = Double.parseDouble(stack[rightIndex]); | |
| 411 | /* | |
| 412 | * Pass the operands and the operator to an operator solver, then replace the | |
| 413 | * operator with the result. Also remove the operands. | |
| 414 | */ | |
| 415 | stack[i] = "" + solveBinaryOperation(left, op, right); | |
| 416 | stack[leftIndex] = stack[rightIndex] = ""; | |
| 417 | } catch (Exception e) { | |
| 418 | /* Throw an Exception if there is a missing operand */ | |
| 419 | throw new MissingOperandException(exp, op); | |
| 420 | } | |
| 421 | } | |
| 422 | } | |
| 423 | } | |
| 424 | exp = ""; | |
| 425 | ||
| 426 | /* Recombine the stack into the solved expression */ | |
| 427 | for (String s : stack) { | |
| 428 | exp += s; | |
| 429 | } | |
| 430 |
1
1. parseOperators : mutated return of Object value for net/mooctest/ExpressionParser::parseOperators to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return exp.trim(); |
| 431 | } | |
| 432 | ||
| 433 | /** | |
| 434 | * Adjusts the spacings between numbers, variables, functions, operators, etc in | |
| 435 | * an expression. Each number will be enclosed withhin a 'buffer' of spaces. | |
| 436 | * Instances of signed numbers immediately following anothoer number will be | |
| 437 | * interpreted as their sum. ( 1 -1 is simply | |
| 438 | * 1 + -1) | |
| 439 | * | |
| 440 | * @param exp | |
| 441 | * the expression to be parsed | |
| 442 | * @return the expression with adjusted spacing | |
| 443 | */ | |
| 444 | protected static String adjustNumberSpacing(String exp) { | |
| 445 | /* Make sure numbers are all spaced out from other symbols */ | |
| 446 | exp = exp.replaceAll(numberRegex, " $0 "); | |
| 447 | /* | |
| 448 | * Make sure the sign in signed numbers is also considered during | |
| 449 | * addition/subtraction | |
| 450 | */ | |
| 451 | exp = exp.replaceAll(numberRegex + "\\s+" + signedNumberRegex, " $1 + $6 "); | |
| 452 |
1
1. adjustNumberSpacing : mutated return of Object value for net/mooctest/ExpressionParser::adjustNumberSpacing to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return exp; |
| 453 | } | |
| 454 | ||
| 455 | /** | |
| 456 | * Finds the index of a matching closing bracket in a String, given the index of | |
| 457 | * the opening one. This method can also be given any characters as opening and | |
| 458 | * closing brackets. Nesting of brackets has also been dealt with. | |
| 459 | * | |
| 460 | * @param str | |
| 461 | * the String containing the brackets | |
| 462 | * @param pos | |
| 463 | * the index of the opening bracket | |
| 464 | * @param open | |
| 465 | * the character to be recognized as an opening bracket | |
| 466 | * @param close | |
| 467 | * the character to be recognized as a closing bracket | |
| 468 | * @return the index of the matching closing bracket | |
| 469 | * @throws cn.edu.nju.ise.math.UnmatchedBracketsException | |
| 470 | * thrown if the specified opening bracket is unclosed | |
| 471 | */ | |
| 472 | protected static int indexOfMatchingBracket(String str, int pos, char open, char close) | |
| 473 | throws UnmatchedBracketsException { | |
| 474 | int tmp = pos; | |
| 475 | /* Loop through the String, forward from the position of the opening bracket */ | |
| 476 |
3
1. indexOfMatchingBracket : changed conditional boundary → KILLED 2. indexOfMatchingBracket : Changed increment from 1 to -1 → KILLED 3. indexOfMatchingBracket : negated conditional → KILLED |
while (++pos < str.length()) { |
| 477 | /* Exit the loop as soon as a closing bracket is found */ | |
| 478 |
1
1. indexOfMatchingBracket : negated conditional → KILLED |
if (str.charAt(pos) == close) |
| 479 |
1
1. indexOfMatchingBracket : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return pos; |
| 480 | /* | |
| 481 | * If another opening bracket is found, it becomes clear that bracketed | |
| 482 | * expressions have been nested. Thus, the next closing bracket will not match | |
| 483 | * the bracket we have targeted. In order to return the correct bracket, simply | |
| 484 | * skip everything within the nested portion. This is done by calling | |
| 485 | * indexOfMatchingBracket(String, int, char, char) recursively. | |
| 486 | */ | |
| 487 |
1
1. indexOfMatchingBracket : negated conditional → KILLED |
if (str.charAt(pos) == open) |
| 488 | pos = indexOfMatchingBracket(str, pos, open, close); | |
| 489 | } | |
| 490 |
2
1. indexOfMatchingBracket : changed conditional boundary → SURVIVED 2. indexOfMatchingBracket : negated conditional → KILLED |
if (pos >= str.length()) { |
| 491 | /* Throw an Exception if a matching bracket is not present */ | |
| 492 | throw new UnmatchedBracketsException(str, tmp); | |
| 493 | } | |
| 494 |
1
1. indexOfMatchingBracket : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return pos; |
| 495 | } | |
| 496 | } | |
Mutations | ||
| 70 |
1.1 2.2 3.3 |
|
| 72 |
1.1 |
|
| 83 |
1.1 |
|
| 100 |
1.1 |
|
| 103 |
1.1 |
|
| 105 |
1.1 |
|
| 106 |
1.1 |
|
| 113 |
1.1 |
|
| 119 |
1.1 |
|
| 145 |
1.1 |
|
| 169 |
1.1 2.2 3.3 |
|
| 180 |
1.1 2.2 3.3 4.4 |
|
| 185 |
1.1 |
|
| 192 |
1.1 |
|
| 221 |
1.1 |
|
| 228 |
1.1 |
|
| 234 |
1.1 2.2 |
|
| 237 |
1.1 |
|
| 243 |
1.1 |
|
| 251 |
1.1 |
|
| 297 |
1.1 |
|
| 306 |
1.1 |
|
| 312 |
1.1 |
|
| 322 |
1.1 2.2 |
|
| 325 |
1.1 |
|
| 328 |
1.1 2.2 |
|
| 349 |
1.1 |
|
| 379 |
1.1 |
|
| 388 |
1.1 |
|
| 389 |
1.1 |
|
| 398 |
1.1 2.2 3.3 |
|
| 399 |
1.1 |
|
| 402 |
1.1 2.2 3.3 |
|
| 403 |
1.1 |
|
| 405 |
1.1 2.2 3.3 |
|
| 406 |
1.1 |
|
| 430 |
1.1 |
|
| 452 |
1.1 |
|
| 476 |
1.1 2.2 3.3 |
|
| 478 |
1.1 |
|
| 479 |
1.1 |
|
| 487 |
1.1 |
|
| 490 |
1.1 2.2 |
|
| 494 |
1.1 |


Scheduler App
John Smith
Edit Profile
Logout
Appointment to be cancelled:
Decemeber 27, 2016 1:00PM
Treatment X
Employee Name
Reason For Cancellation:
Cancel


approximate number of women who develop breast cancer every year
of women who get breast cancer have a family member diagnosed
of women will survive breast cancer if found in the early stages
of women will survive breast cancer if found in the early stages
(Powered by Watson Discovery News)
Below are the Top persons who are mentioned on the news articles about Breast Cancer.
Below are the Top Organizations which are mentioned on the news articles about Breast Cancer.
Below are the Top Locations which are mentioned on the news articles about Breast Cancer.
Below are the Top Drugs which are mentioned on the news articles about Breast Cancer.
Below are the Top Facilities which are mentioned on the news articles about Breast Cancer.
(Powered by Watson Discovery News)
The first-in-class molecule shuts down oestrogen- sensitive breast cancer in a new way, researchers said.>>Know more
Breast Cancer Diagnoses Brings 2 Tulsa Women Together Breast Cancer Diagnoses Brings 2 Tulsa Women Together>>Know more
To recognize a recurrence of breast cancer, it is important to understand your personal risk that cancer may return, as well as keeping an eye out for additional warning signs.>>Know more
The 2017 Big Wigs - Under the Big Top reveal party at L'auberge Casino and Hotel was a hit Thursday night. Local 33's Chad Sabadie co-hosted the 2nd annual event with Matt Moscona, introducing this year's group of Big Wigs, who are raising money for Komen Baton Rouge and the fight against Breast Cancer>>Know more
Print Women Rally For Monserrate Over 100 East Elmhurst and Corona women went to an event held at the Silver Spoon Diner near LeFrak City to show their support for Hiram Monserrate’s campaign for the 21st City Council District seat.>>Know more
Other LORELEI: Taselisib boosts breast tumor shrinkage Adding taselisib to letrozole before surgery significantly improved outcomes for patients with early breast cancer that was both estrogen receptor positive and HER2-negative (ER+/HER2-).>>Know more
The Delaware Breast Cancer Coalition’s Peer Mentor Support Program is offering free, ongoing, one-on-one emotional support and resources to those newly diagnosed with breast cancer by trained breast cancer survivors.>>Know more
. * Cancer Facts & Figures 2017