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
0 answers

How do I check whether the given expression is Infix, Postfix or Prefix accurately?

Bit of a long read, It's my first question here :) So, I want a function or the logic, whereby the code is able to validate an expression whether it is Infix, Postfix, or Prefix Accurately. So by accurate I mean it should check all conditions…
SaurabhV
  • 21
  • 1
2
votes
1 answer

Using Reflection to build EF Core query is faster than to using reflection

I've got an IQueryable Extension method that is being used to reduce the amount of boiler plate code needed to search a number of fields in an EF Core DbContext model: public static IQueryable
2
votes
2 answers

Parsing querystring into dynamic sql (LINQ)

I don't visit nor ask things on here too much, so I hope this question is allowed. I've been assigned a task, to implement a REST service, where the GET endpoint would basically work as an OData service. But not exactly. I tried convincing the…
Wizaerd
  • 235
  • 3
  • 15
2
votes
1 answer

How to do Expression Trees on complex datatypes

I must admit that I'm absolutely new to Expression Trees in C#, but currently there is a necessity to get used to it. My problem is that I have two DataTypes that contain an array of arrays. For that reason I created an interface which is called…
msedi
  • 1,437
  • 15
  • 25
2
votes
1 answer

Combining or appending to pyarrow.dataset.expressions

I am trying to filter pyarrow data with pyarrow.dataset. I want to add a dynamic way to add to the expressions. from pyarrow import parquet as pq import pyarrow.dataset as ds import datetime exp1 = ds.field("IntCol") == 1 exp2 = ds.field("StrCol")…
Ted. Z
  • 23
  • 2
2
votes
3 answers

How can expressions of the form "A" = "a", "B" = "b", etc be constructed automatically from LETTERS and letters?

I was recently reading a solution to an R4DS exercise. It includes the code: library(stringr) replacements <- c("A" = "a", "B" = "b", "C" = "c", "D" = "d", "E" = "e", "F" = "f", "G" = "g", "H" = "h", "I" = "i", "J" = "j", …
J. Mini
  • 1,868
  • 1
  • 9
  • 38
2
votes
1 answer

Convert a given property-access to chained string

I'm trying to write an extension-method to retrieve a property-path from a given LambdaExpression. I want to be able to call it like var path = ((Event e) => e.Address.City.Name).ToChainedPath(); which would return Address.City.Name as string…
KingKerosin
  • 3,639
  • 4
  • 38
  • 77
2
votes
3 answers

5.3.2: Function call in expression Python

Here's the prompt: Assign max_sum with the greater of num_a and num_b, PLUS the greater of num_y and num_z. Use just one statement. Hint: Call find_max() twice in an expression. Here's my code: def find_max(num_1, num_2): max_val = 0.0 if…
2
votes
2 answers

Python expression to MathML

I would like to be able to convert a python mathematical expression into content MathML using Python. The goal would be to turn an expression like (a*x^2 + b*x + c)/(2*a) into the content MathML example in the Wikipedia article on MathML. The…
abalter
  • 9,663
  • 17
  • 90
  • 145
2
votes
2 answers

negative regex for password review

I have already tried several options on this topic here on Stackoverflow, but none of them worked. I have a database of passwords that I need to review for compliance. I figured how to build an expression to match the passwords that are compliant…
Bluz
  • 5,980
  • 11
  • 32
  • 40
2
votes
0 answers

How can I access binding.expression in Vue 3?

I am not able to find binding.expression in Vue 3 from my custom directive's events. Has it been replaced by something else? I need to access the raw expression to process it rather than the evaluated expression value. Thank you.
geeko
  • 2,649
  • 4
  • 32
  • 59
2
votes
1 answer

Create LINQ expression Tree with multiple OR and AND condition

I want to generate LINQ expression tree with nested AND or OR condition. I have bellow expressions var constant = Expression.Constant("Jhon"); var property = Expression.Property(paramExpr,"FirstName"); var expression =…
user3501613
  • 596
  • 7
  • 28
2
votes
0 answers

AutoMapper expression mapping with ValueObject

I have a business logic object User with ValueObject field UserId. I need to translate expression tree with User to similar tree with DbUser using AutoMapper. Here is my setup: public static void Main(string[] args) { // create new AutoMapper …
DenisNP
  • 141
  • 1
  • 6
2
votes
1 answer

How to replace string only if the replacement exists in the target object?

I have the following snippet from this post, this code replaces the token $ENV[accountsDomain] in a string with the key from item object accountsDomain: 'www.yahoo.com' and similarly for accountsUrl how can I run replace conditionally, replace the…
dota2pro
  • 7,220
  • 7
  • 44
  • 79
2
votes
1 answer

How to modify an expression to pass it to a method

The problem is: public GetAll(Expression> whereCondition) { // and it should call another GetAllCampsFromRepo method that gets Camps from a repository } public IList GetAllCampsFromRepo(Expression>…
iLemming
  • 34,477
  • 60
  • 195
  • 309
1 2 3
99
100