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
3
votes
1 answer

Generic Expression Filter

Hi I am hoping someone might be able to provide a little guidance with the following: I am trying to create a Generic Expression Filter that uses reflection and can receive a set of rules and create a valid expression for restricting the data…
SCB
  • 3,034
  • 2
  • 25
  • 24
3
votes
2 answers

PHP Preg expression to remove html tags and inner contents from string?

quick question. I'd like to remove the sup tag from the following string, and all content within it. $string = "Priority Mail® International"; How would I do that?
Braydon Batungbacal
  • 1,028
  • 2
  • 24
  • 52
3
votes
1 answer

*** Exception: Prelude.read: no parse in Haskell - Parsing, Expressions and Recursion

This portion of code should read in two or more numbers (main io function omitted), then a "+" to give the sum. Rationals are used because later i will do multiplications and such other operations. data Expression = Number Rational |…
CSJC
  • 35
  • 2
  • 5
3
votes
3 answers

Implementation of Expression.Assign in .Net 3.5 with same signature?

Expression.Assign isn't available before .NET 4. I need to implementation under .NET 3.5 of this method with original signature: public static BinaryExpression Assign( Expression left, Expression right ) Clarification: I'm not looking for a…
AndreyAkinshin
  • 18,603
  • 29
  • 96
  • 155
3
votes
3 answers

Regular expressions that removes only first "/"

I'm new to Regular expressions and can't seem to find out how I have to solve this: I need a regular expressions that "allows" only numbers, letters and /. I wrote this: /[^a-zA-Z0-9/]/g I think it's possible to strip the first / off, but don't…
Ronald
  • 296
  • 2
  • 9
3
votes
2 answers

Using Expression to call a property and object and determine if the object is null or not

I want to be able to call properties on objects that might be null but not explicitly have to check whether they are null or not when calling. Like this: var something = someObjectThatMightBeNull.Property; My idea is to create a method that takes…
Mikael Östberg
  • 16,982
  • 6
  • 61
  • 79
3
votes
3 answers

Is there a way to do SSRS Expressions in C#

I am working on a SQl Server Report Services project and the report I am creating requires some custom code. It seems that all expressions must be in VB.NET and I figured if there was an 'easy' way to switch that over to be C#, it would be…
JasonRShaver
  • 4,344
  • 3
  • 32
  • 39
2
votes
1 answer

Converting from Expression> to Expression>

I could use some help with expression conversion. I have a method on a class which looks like the following: protected IQueryOver OrderQuery( Expression> orderBy) { return…
Adam Goss
  • 1,017
  • 3
  • 14
  • 22
2
votes
1 answer

Embedded CASE with expressions in SQL Server 2008

Hi SQL SVR 2008 gurus. As a SQL newbie, I'm hoping for some direction.I've got a SELECT statement that needs to check an expression against a field value for each worker to see if they qualify for a paid lunch break. The value of the number of…
2
votes
1 answer

Magento collection expression

How to use expressions in a collection. More specific, I want to SELECT CAST(qty_shipped AS UNSIGNED). I have tried something like this: addExpressionFieldToSelect('qty_shipped','CAST(qty_shipped AS UNSIGNED)',null) , but it appends the table name…
user635818
  • 99
  • 2
  • 9
2
votes
1 answer

Creating a mathematical expression from nested loops

Can anyone show me how to create a mathematical expression for the number of time the statement total++; will run in the following code? I understand that the 'i loop' will iterate n/P times and I know that total++; will run a total of 'i loop…
erebel55
  • 600
  • 2
  • 8
  • 25
2
votes
2 answers

How to create the function using Expression linq

I have the following class public class ProdutoTipo : IAuditable { public Guid ID { get; set; } public string Nome { get; set; } public string MiniNome { get; set; } public string Descricao { get; set; } public string Link {…
ridermansb
  • 10,779
  • 24
  • 115
  • 226
2
votes
1 answer

Combining select expressions of the same input type

Say, I have these properties which are overridden in a derived class. protected virtual Expression> GetIDExpr { get; } protected virtual Expression> GetNameExpr { get; } protected virtual…
Connell
  • 13,925
  • 11
  • 59
  • 92
2
votes
2 answers

Get property value from MemberExpression

I'm attempting to retrieve the value of a property from an instance of MemberExpression. Here is what I have so far: protected override void VisitMember(Context context, MemberExpression node) { var propertyInfo = node.Member as…
Chuck Conway
  • 16,287
  • 11
  • 58
  • 101
2
votes
1 answer

Receiving error BC30201: Expression expected

Catch ex As Exception GetTTCFTPini = {"Nothing"} End Try it says at the GetTTCFTPini = {"Nothing"} error BC30201: Expression expected.
Epicblood
  • 1,167
  • 2
  • 10
  • 29