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
42
votes
6 answers

Database choice for large data volume?

I'm about to start a new project which should have a rather large database. The number of tables will not be large (<15), majority of data (99%) will be contained in one big table, which is almost insert/read only (no updates). The estimated amount…
Marko
  • 30,263
  • 18
  • 74
  • 108
42
votes
5 answers

How to evaluate functions in GDB?

I wonder why evaluate function doesn't work in gdb? In my source file I include, when debugging in gdb, these examples are wrong evaluations. (gdb) p pow(3,2) $10 = 1 (gdb) p pow(3,3) $11 = 1 (gdb) p sqrt(9) $12 = 0
Tim
  • 1
  • 141
  • 372
  • 590
41
votes
4 answers

When is "NOT" not a negation?

Why do both of the following return zero? Surely the second is a negation of the first? I am using SQL Server 2008. DECLARE @a VARCHAR(10) = NULL , @b VARCHAR(10) = 'a' SELECT CASE WHEN ( ( @a IS NULL AND @b IS…
ChrisN
  • 530
  • 5
  • 13
41
votes
7 answers

How is if statement evaluated in c++?

Is if ( c ) the same as if ( c == 0 ) in C++?
derrdji
  • 12,661
  • 21
  • 68
  • 78
35
votes
4 answers

Is it possible to execute a string in MySQL?

I have to convert a MSSQL stored proc that passes a varchar that is a query: INSERT INTO Results EXEC (@Expresion); This isn't working. I'm pretty sure that EXEC and EXECUTE aren't MySQL commands, but CALL doesn't work either. Does anyone know…
aarona
  • 35,986
  • 41
  • 138
  • 186
35
votes
3 answers

Math in Vim search-and-replace

I have a file with times (minutes and seconds), which looks approximately as follows: 02:53 rest of line 1... 03:10 rest of line 2... 05:34 rest of line 3... 05:35 rest of line 4... 10:02 rest of line 5... ... I would like to replace the time by…
Philippe
  • 9,582
  • 4
  • 39
  • 59
33
votes
3 answers

How do you evaluate a string as a clojure expression?

How would I get something similar to the following?: (evaluate-text "(+ 1 2)") ; resolves to 3
Nick Orton
  • 3,563
  • 2
  • 21
  • 28
32
votes
6 answers

Why does 1+++2 = 3?

How does Python evaluate the expression 1+++2? How many ever + I put in between, it is printing 3 as the answer. Please can anyone explain this behavior And for 1--2 it is printing 3 and for 1---2 it is printing -1
udpsunil
  • 1,375
  • 2
  • 16
  • 29
32
votes
3 answers

What is the relationship between unboxed types and strictness?

Unboxed types, like Int#, and strict functions, like f (!x) = ..., are something different, but I see conceptual similarity - they disallow thunks/laziness in some way. If Haskell was a strict language like Ocaml, every function would be strict and…
sdcvvc
  • 25,343
  • 4
  • 66
  • 102
31
votes
1 answer

Idris eager evaluation

In Haskell, I might implement if like this: if' True x y = x if' False x y = y spin 0 = () spin n = spin (n - 1) This behaves how I expect: haskell> if' True (spin 1000000) () -- takes a moment haskell> if' False (spin 1000000) () --…
Snowball
  • 11,102
  • 3
  • 34
  • 51
30
votes
6 answers

Does Java have an "is kind of class" test method

I have a baseclass, Statement, which several other classes inherit from, named IfStatement, WhereStatement, etc... What is the best way to perform a test in an if statement to determine which sort of Statement class an instance is derived from?
Heat Miser
  • 19,438
  • 7
  • 35
  • 38
29
votes
1 answer

Does C# guarantee evaluation order of branched nested expressions?

C# handles both nested and chained expressions, obviously. If the nesting and/or chaining is linear then it's evident what order the expressions are evaluated in: Foo(Bar(Baz().Bop())) can only evaluate in the following…
Brondahl
  • 7,402
  • 5
  • 45
  • 74
29
votes
6 answers

Evaluate object to a boolean

Consider the following: class MyClass { private $var1 = "apple"; private $var2 = "orange"; } $obj = new MyClass(); if($obj) { // do this } else { // do that } PHP evaluates my object to true because it has member variables. Can this…
Niko Efimov
  • 2,183
  • 3
  • 20
  • 30
29
votes
3 answers

How to build a lift chart (a.k.a gains chart) in Python?

I just created a model using scikit-learn which estimates the probability of how likely a client will respond to some offer. Now I'm trying to evaluate my model. For that I want to plot the lift chart. I understand the concept of lift, but I'm…
Abhishek Arora
  • 944
  • 2
  • 10
  • 16
27
votes
2 answers

How does seq force functions?

Background This question arises from a challenge Brent Yorgey posed at OPLSS: write a function f :: (Int -> Int) -> Bool that distinguishes f undefined from f (\x -> undefined). All of our answers either used seq or something like bang patterns that…
acfoltzer
  • 5,588
  • 31
  • 48
1
2
3
88 89