Questions tagged [evaluation]

Anything related to evaluation of expressions, i.e. the process used to determine the value of expressions in a running program.

What is it?

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

Related tags

  • The tag may be used more specifically for the execution or invocation of evaluations.
  • For more specific questions use tags such as for example

See also:

1334 questions
6
votes
2 answers

Why is evaluation of this python code block disabled in emacs org mode?

In a python source block in org-mode, after hitting C-c C-c, emacs says Evaluation of python source block is disabled Could anyone explain why?
sinestandly
  • 131
  • 2
  • 8
6
votes
1 answer

Evaluation of a small math type language that supports one variable

I have written the parser that reads the string input. That works. I have also written the evaluator that spits out the result. But there is one small detail that I'm having trouble implementing. Look at the following example: +(sw+(2,2),sr) The…
Algific
  • 1,470
  • 2
  • 18
  • 33
6
votes
2 answers

F# lazy eval from stream reader?

I'm running into a bug in my code that makes me think that I don't really understand some of the details about F# and lazy evaluation. I know that F# evaluates eagerly and therefore am somewhat perplexed by the following function: // Open a file,…
Kevin Won
  • 7,156
  • 5
  • 36
  • 54
6
votes
3 answers

Minimax algorithm: Cost/evaluation function?

A school project has me writing a Date game in C++ (example at http://www.cut-the-knot.org/Curriculum/Games/Date.shtml) where the computer player must implement a Minimax algorithm with alpha-beta pruning. Thus far, I understand what the goal is…
Dave
  • 305
  • 1
  • 3
  • 10
6
votes
1 answer

R: Evaluate an expression in a data frame with arguments that are passed as an object

I want to write a function that evaluates an expression in a data frame, but one that does so using expressions that may or may not contain user-defined objects. I think the magic word is "non-standard evaluation", but I cannot quite figure it out…
SimonG
  • 4,701
  • 3
  • 20
  • 31
6
votes
1 answer

tic tac toe using alpha beta prunning in java

I am trying to play tic tac toe using iterative Alpha-Beta prunning, I have one second limit for a move but for some reason it doesnt work well. I modified the regular alpha-beta code so instead of returning alpha or beta, it returns a state (which…
Lena
6
votes
3 answers

Strange conversion in Python logic expressions

I noticed a strange behavior of Python 2.7 logic expressions: >>> 0 and False 0 >>> False and 0 False >>> 1 and False False >>> False and 1 False and with True in place of False >>> 0 and True 0 >>> True and 0 0 >>> 1 and True True >>> True and…
Bartłomiej Szałach
  • 2,393
  • 3
  • 30
  • 50
6
votes
1 answer

PowerShell: What is the difference between 1234 and (1234)?

I was hoping that someone could help me out with the following: Function Get-FormattedNameValuePair([string] $name, [object] $value) { return "$("{0,-24}" -f $name) : $("{0,15:N2}" -f $value)" } Write-Output (Get-FormattedNameValuePair -name…
Mike Rosenblum
  • 12,027
  • 6
  • 48
  • 64
6
votes
3 answers

Pros and cons of Java Portlets?

I have a project in which my client is asking me to use portlets 1.0 spec and Websphere Portal Server 6.0. I haven't worked with portlets before but what I've heard of them always have been bad critiques. What are the reasons besides the obvious of…
victor hugo
  • 35,514
  • 12
  • 68
  • 79
6
votes
4 answers

Defined argument evaluation order leads to sub-optimal code?

It is a known fact that argument evaluation order in c and c++ are not defined: for example: foo(a(),b()) In the above call it is up to the implementation of the compiler to decide which order of evaluation to pick and hence forth which function to…
sasidhar
  • 7,523
  • 15
  • 49
  • 75
6
votes
4 answers

Cluster quality measures

Does Matlab provide any facility for evaluating clustering methods? (cluster compactness and cluster separation. ....) Or is there any toolbox for it?
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173
5
votes
5 answers

PHP empty var == 0?

In php 5 $my_var = ""; if ($my_var == 0) { echo "my_var equals 0"; } Why it evaluates true? Is there some reference in php.net about it?
JohnA
  • 1,875
  • 8
  • 28
  • 34
5
votes
3 answers

What is the trade-off between Lazy and Strict/Eager evaluation?

So this concept of lazy evaluation gets thrown around a lot especially when reading about functional programming, java streams, etc. Streams are lazy; computation on the source data is only performed when the terminal operation is initiated, and…
Harsha Limaye
  • 915
  • 9
  • 29
5
votes
2 answers

Is this possible to create an operator that evaluates argument left-to-right in OCaml

When you define an operator such as let (++) a b = a :: b When you do let v = foo a ++ bar b bar is evaluated before foo. A workaround is to use let expression, i.e. let e1 = foo a in let e2 = bar b in e1 ++ e2 However, sometimes it'd be handy…
Butanium
  • 726
  • 5
  • 19
5
votes
2 answers

aggregation inside "case when" - What's the executing order?

Why does this simple query result in a "division by zero" Error? select case when b > 0 then sum(a / b) end from (values (1,1),(2,1),(1,0),(2,0)) t (a,b) group by b I would expect the output: case 3 NULL The only explanation I have…
ArcticLord
  • 3,999
  • 3
  • 27
  • 47