Questions tagged [expression]

Combination of several programming symbols and values intending to produce a result

An expression is code before it gets evaluated. That is, evaluating an expression will give you a result.

Expressions can consists of combinations of variables, constants, operators, function calls, or whatever constructs are available in that language.

Many s have an expression data type, and an evaluation function (often called eval), where calling eval(an_expression) will calculate a result.

Related tags

7598 questions
2
votes
1 answer

Used normal text in combination with normal text in plot

UPDATE: I actually found the solution myself, see below. In R I want to add a label to a plot containing both subscript and normal text. To be more precise, I would like to use mtext() (or any other method that does the trick) to add a text below a…
SeeDoubleYou
  • 1,253
  • 2
  • 15
  • 25
2
votes
3 answers

Regular expression to select from X to Y

I have the folowing HTML:

Some text

...
Now how can I write regular expression to match all text from Template Start to Template End here it…
jasin_89
  • 1,993
  • 7
  • 30
  • 41
2
votes
3 answers

Resolving LINQ Parameters that were passed to method in which LINQ Expression is

I am working on LINQ to SQL translator. It should translate LINQ queries to SQL. I am focused on creating WHERE part of the query. I am traversing LINQ Expression tree and then I get to a problem that I can't get to the value of actual parameter…
gljivar
  • 440
  • 7
  • 19
2
votes
2 answers

How to use an expression in function from other function in julia

When I try those code below: function f(x) Meta.parse("x -> x " * x) |> eval end function g(x) findall(Base.invokelatest(f,x),[1,2,3]) |> println end g("<3") Julia throws "The applicable method may be too new" error. If I tried these code…
kaji331
  • 61
  • 4
2
votes
0 answers

Expression of type 'System.Decimal' cannot be used for parameter of type 'System.Object' of

I'm getting the below error messagE: Expression of type 'System.Decimal' cannot be used for parameter of type 'System.Object' of method 'System.String Format(System.String, System.Object)' When using the below expression: var expression =…
The Light
  • 26,341
  • 62
  • 176
  • 258
2
votes
1 answer

Evaluate JSON object with expression with variable name

We need to evalue json object expression in java we have following source json object { "model":"abc", "variant":"m1", "stage":2, "a":100, "b":200, "display name":"${model}-${variant}", "c":"${a}*${b}", …
Pranav
  • 103
  • 7
2
votes
1 answer

function in expression, result into temporary variable only accessible if the expression is true

When an expression is a function that returns some kind of value, is there a way to get it's processed value in a temporary variable, that can be accessed only within matching expression? Let's make a random example. function used in…
tomsseisums
  • 13,168
  • 19
  • 83
  • 145
2
votes
2 answers

SQL | Search a large string to return key-phrases found in table

I have a table that has about 3000 different key-phrases (small strings). I need a query that takes the input of a large-string (like a large sentence or paragraph) and returns the records of key-phrases that exist inside the…
2
votes
2 answers

Regular expression that matches at least 4 words starting with the same letter?

I've been trying to solve this problems for few hours but with no luck. The task is to write a regular expression that matches at least four words starting with the same letter. But! These words do not have to be one after another. This regex should…
matte
  • 45
  • 4
2
votes
2 answers

Refined manipulation of sympy expressions

I am trying to work with sympy and work with manipulation of expressions. import sympy as sym from sympy.abc import t x0,v0 = sym.symbols("x0 v0 ", real=True) wn = sym.symbols("omega_n", positive = True, real=True) z = sym.symbols("zeta", …
NMech
  • 580
  • 2
  • 8
  • 20
2
votes
3 answers

Expression parsing using binary operators

I'm trying to figure out ways to parse an expression that uses all binary operators. Each operator is surrounded by exactly one set of parenthesis, such that: 5x^2 + 3x + 2 would be ((5*(x^2))+((3*x)+2)) and is taken as an args[] argument (more…
dcfc_rph
  • 299
  • 2
  • 3
  • 10
2
votes
1 answer

How to understand OR operator in a PHP statement

I have a below PHP statement: if( (bool)is_check1($a) || (bool)is_check2($a) || (bool)is_check3($a) ){ callFunctionA(); } I have debugged and got a news thing so strange that, even if is_check1 returns…
vietean
  • 2,975
  • 9
  • 40
  • 65
2
votes
1 answer

Partially evaluate an expression in R

Sorry. I have an expression: #x^p I want to evaluate this for a given p. p -> 0 # 1 p -> 1 #x p -> 2 #x^2 p -> 3 #x^3 p -> -1 #x^-1 If I type in: p -> 1 eval(p) #1 BUT p -> 1 eval(x^p) Gives the error: #Error in eval(x^p) : object 'x' not…
heh
  • 23
  • 4
2
votes
1 answer

Evaluating a condition with AND and OR statements combined

I'm parsing files which all have following structure: A=B #A==test This means that variable A will be set to B, only if A equals 'test' Conditions can get more complex as well C=D #C==test1,D==test2 This means that C will be set to D if…
2
votes
0 answers

how to remove a condition from an expression IQueryable object in C#

I have an IQueryable object sth like; IQueryable query = DemoData.Where(x => true); query = query.Where(p=> p.Nation == Nation); // query indicates people from a Nation now. /* . . some code . . */ query = query.RemoveWhere(p=> p.Nation…
Ali CAKIL
  • 383
  • 5
  • 21