Questions tagged [evaluate]

execution of evaluations of expressions or evaluation functions. Use tag evaluation for rules, algorithms, and strategies of the evaluation.

What is it?

Evaluation is about rules, algorithms and strategies used for the evaluation of expressions or the computation of evaluation functions.

This tag may should be used for the execution of evaluations.

Related tags

  • Prefer the tag if the question is about rules, algorithms and strategies used for the evaluation of expressions or the computation of evaluation functions.
  • For more specific questions use tag

See also:

470 questions
269
votes
7 answers

How can I pass variable into an evaluate function?

I'm trying to pass a variable into a page.evaluate() function in Puppeteer, but when I use the following very simplified example, the variable evalVar is undefined. I can't find any examples to build on, so I need help passing that variable into the…
Cat Burston
  • 2,833
  • 2
  • 12
  • 10
132
votes
9 answers

Why does PHP consider 0 to be equal to a string?

I have the following piece of code: $item['price'] = 0; /* Code to get item information goes in here */ if($item['price'] == 'e') { $item['price'] = -1; } It is intended to initialize the item price to 0 and then get information about it. If…
Sérgio Domingues
  • 1,487
  • 2
  • 10
  • 10
122
votes
13 answers

Evaluating string "3*(4+2)" yield int 18

Is there a function the .NET framework that can evaluate a numeric expression contained in a string and return the result? F.e.: string mystring = "3*(2+4)"; int result = EvaluateExpression(mystring); Console.Writeln(result); // Outputs 18 Is there…
sindre j
  • 4,404
  • 5
  • 31
  • 32
90
votes
9 answers

How to turn a string formula into a "real" formula?

I have 0,4*A1 in a cell (as a string). How can convert this "string formula" into a real formula and calculate its value, in another cell?
Cloaky
  • 1,065
  • 2
  • 10
  • 11
51
votes
5 answers

How do I evaluate expressions while debugging in VS Code?

I am using vscode to build my golang gin project. I go to debugging mod and can not do evaluate expressions. I want to go some line and evaluate that see what happened in that monent. Like eclipse ctrl+shift+i or idea ctrl+alt+f8 Quick evaluate…
石荒人
  • 753
  • 1
  • 6
  • 11
44
votes
7 answers

What is the difference between model.fit() an model.evaluate() in Keras?

I am using Keras with TensorFlow backend to train CNN models. What is the between model.fit() and model.evaluate()? Which one should I ideally use? (I am using model.fit() as of now). I know the utility of model.fit() and model.predict(). But I am…
Abhijit Balaji
  • 1,870
  • 4
  • 17
  • 40
42
votes
13 answers

Is there a way to evaluate a formula that is stored in a cell?

In a Google Docs spreadsheet, I'm looking for something like =EVAL(A1) where A1 is set to "=1+2". I found out that in MS Excel there is an EVALUATE() function (which seems a bit tricky to use properly). But I could not find anything similar in…
20
votes
3 answers

Rails ERb best practices (<% %> vs <% -%> vs <%- -%>)

What is the recommended use of ERb in Rails when it comes to <% %> (evaluate Ruby code), <% -%> (evaluate Ruby code, suppress the trailing newline) and <%- -%> (evaluate Ruby code, suppress the trailing newline and leading space)? It seems like <%-…
jrdioko
  • 32,230
  • 28
  • 81
  • 120
16
votes
9 answers

How to Write a Boolean Expression Evaluator in C?

Suppose I have a string such as this in a text file: (((var1 AND var2 AND var3) OR var4) AND ((var5 OR var6) AND var7)) After parsing this into the C program and the vars are handled and set correctly it will end up looking something like…
user105033
  • 18,800
  • 19
  • 58
  • 69
16
votes
2 answers

How do I profile code when using knitr?

I am trying to institute a workflow to answer SO questions using knitr and render_markdown(strict = T ) to format my answers and / questions. Recently I was trying to run profiling on some code using profr and due to the implementation of knitr,…
mnel
  • 113,303
  • 27
  • 265
  • 254
16
votes
6 answers

What is easiest way to calculate an infix expression using C language?

Suppose the user inputs an infix expression as a string? What could be the easiest ( By easiest I mean the shortest) way to evaluate the result of that expression using C language? Probable ways are converting it to a postfix then by using…
Biswajyoti Das
  • 7,881
  • 11
  • 34
  • 26
14
votes
2 answers

How to use a formula written as a string in another cell [evaluate for Google Spreadsheet]

I read several old posts about Google Spreadsheet missing the evaluate function. There is any solution in 2016? The easiest example. 'A1' contains the following string: UNIQUE(C1:C5) 'B1' I want to evaluate in it the unique formula written in…
soneangel
  • 621
  • 3
  • 10
  • 22
13
votes
7 answers

PHP use string as operator

Say I have a string, $char. $char == "*". I also have two variables, $a and $b, which equal "4" and "5" respectively. How do I get the result of $a $char $b, ie 4 * 5 ? Thanks :)
Fela Maslen
  • 2,022
  • 3
  • 25
  • 46
12
votes
2 answers

What is the difference between DOMXPath::evaluate and DOMXPath::query?

Trying to decide which is more appropriate for my use case... After comparing the documentation for these methods, my vague understanding is evaluate returns a typed result but query doesn't. Furthermore, the query example includes looping through…
Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
12
votes
10 answers

Boolean Expression Evaluation in Java

I'm looking for a relatively simpler (when compared with writing a parser) way to evaluate boolean expressions in Java, and I do not want to use the JEP library. I have a String expression like: (x > 4 || x < 8 && p > 6) and my aim is to replace the…
TJ-
  • 14,085
  • 12
  • 59
  • 90
1
2 3
31 32