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

iReport - Variable - String[] - Initial Value Expression

I discovered today in iReport that I cannot set the initial value expression of a String[] using normally valid Java syntax, such as: private String[] fruitNames = new String[] {"Apple", "Banana"}; Extrapolating this into an iReport variable would…
depth13
  • 23
  • 1
  • 2
  • 5
2
votes
1 answer

Converting an expression to conjunctive normal form with a twist

I've got a library that I have to interface with which acts basically as a data source. When retrieving data, I can pass special "filter expressions" to that library, which later get translated to SQL WHERE part. These expressions are pretty…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
2
votes
2 answers

Expected ‘)’ before ‘;’ token G++

GCC keeps telling me: expected ‘)’ before ‘;’ token, expected primary-expression before ‘)’ token expected ‘;’ before ‘)’ token And I could not find the problem. Here is the function that have the problem: void prim(){ …
Youssef Khloufi
  • 685
  • 3
  • 13
  • 24
2
votes
2 answers

Regex - name validation

I am looking for a regular expression to check names. I have searched the net and also used the suggestion that were given me by StackOverflow while posting this question. I also know it's possible in stages, but I'm looking for a regex-1-liner to…
Jelmer
  • 2,663
  • 2
  • 27
  • 45
2
votes
2 answers

Subscripts (or other math formula) in ggplot2 legend factor labels

I tried to add subscripts to my ggplot2 geom_point colour legend by using scale_colour_discrete. Similar problems popped up here p <- ggplot(myData, aes(myFeature1,myFeature2)) p <- p + geom_point(aes(colour = myFeature3)) + facet_grid(n ~ cond) p…
Helga
  • 91
  • 2
  • 5
2
votes
1 answer

CorePlot - Expected Token Before '@' token

I am trying to incorporate CorePlot into my project. I finally manages to get my header files recognized but i keep getting the following error in my main.m. "Expected expression before '@' token" int main(int argc, char *argv[]) { …
Kevin McFadden
  • 337
  • 1
  • 5
  • 23
2
votes
3 answers

Regex to match from position 13 to end of line

Example strings: DFDBDFDFDF21R123 DFDBDFDFDF21DFD I need a regex that when run matches ths following: R123 DFD (no EOL chars) Thanks, I hope there is a simple solution that my brain isn't conjuring.
Jova
  • 41
  • 1
  • 1
  • 2
2
votes
1 answer

Expression.ToString() with format provider

Is it possible to convert a lambda expression like x => x + 1.5 to string using specific culture/format options? I know I can do: Expression> expr = x => x + 1.5; string s = expr.Body.ToString(); But with some app language…
pbalaga
  • 2,018
  • 1
  • 21
  • 33
2
votes
1 answer

Setting my To/From date based on the beginning date AND the date queries

First of all, thanks everyone for helping yesterday. I've managed to get my report working (so far) so now I need to show the date periods (FROM: TO:) in my header. Here is the query: Declare @startdate datetime Declare @enddate datetime Declare…
2
votes
1 answer

How to manually build the expression tree when I have only generic types and instance value?

I have a generic class like below: public class MyClass { MyClass(Expression> expression) { } } In my case, I want to dynamically create an instance of that class using Activator. So what I need is to…
Van Thoai Nguyen
  • 986
  • 9
  • 22
2
votes
1 answer

Logic simplification in sml

I'm creating logic simplification program in sml. But I have a problem for this input: - Or(Or(Var"x", Var"y"), Var"z"); val it = Or (Or (Var #,Var #),Var "z") : formula - Simplify it; And it's in an infinite loop. Here is my code: fun Simplify…
user1047517
  • 1,459
  • 2
  • 11
  • 20
2
votes
3 answers

Space in string allowed, but not at first or last position

For a form validation I've to check input with javascript for valid names The string has to fit the following pattern. I may not start or end with a space It may contain spaces It may contain capital en lowercase letters, inclusive ê è en such It…
OrangeTux
  • 11,142
  • 7
  • 48
  • 73
2
votes
1 answer

System Level Resources not resolving when opening a Windows Phone 7.1 Project in Blend 4

I have the following installed on a clean Windows 7 SP1 setup: VS 2010 Ultimate VS2010 SP1 Windows Phone 7.1 SDK Expression Studio 4 Ultimate Expression Blend 4 SP1 When I create a phone project in VS, all works. When I load that same project…
lookitskris
  • 678
  • 1
  • 6
  • 23
2
votes
3 answers

How to create a dynamic lambda to use it?

I've learned to manipulate Dynamic lambda expressions with the Expression class. However, the lambda expression used in a ForEach method (LINQ) seems a little different since it's an assign. For exemple, doing this : myList.ForEach(x => x.Status =…
metalcam
  • 392
  • 2
  • 16
2
votes
1 answer

How to reflect a property for lambda in generic method?

I need to reflect a property for lambda for my Repository, here's the code: public abstract class RestController : Controller where T : class { private readonly IRepository _db; private readonly string _identityProp; protected…
CodeAddicted
  • 979
  • 2
  • 10
  • 13