expressions

Mathematical Expression evaluation preferably without using stacks or queues

Given the allowed operators of +, /, -, *, and given a user inputted list of single digit numbers (any length allowed), how can I output all possible combinations of mathematical expressions (and the resulting values) that can be formed with the numbers and the given constant set of operators? Also to allow for scalability, for example,...

Django - How to remove F() from a field?

Hello guys, after doing a query with F() (see http://docs.djangoproject.com/en/dev/topics/db/queries/#query-expressions), I save the object, but then, I need to save it again. I want to remove F() from the field. If I don't, F() gets called again. For example rank.ammountMatchesRanked = F('ammountMatchesRanked') + 1 rank.save() # does ...

Previous(sum(.......), Previous(avg(........)

I can work okay with Previous(sum(.......)) in Reporting Services (in expressions), but in the same expression I need to use Previous with an average i.e. Previous(avg(......)). It won't let me do the latter, is there any other way that this can be written? Thanks in advance. AW ...

Different outputs

Possible Duplicate: C++ pre/post increment expression evaluation #include<iostream> using namespace std; int main() { int a=5; b=a++*++a; //(A) gives 36 cout<<(a++*++a); //(B) gives 35 return 0; } Why expressions marked as (A) and (B) gives different outputs? ...

C# Boolean expressions

Hi, in the example below, what would 'foo' be set to each time? I've searched online but I can't find anywhere that gives me the answer: static void Main(string[] args) { static public bool abc = true; static public bool foo = (abc = false); foo = (abc = true); } ...

ublas matrix expression tutorial/examples

hi I am trying to implement certain matrix operations but I am lost in the internals of ublas library. is there a resource such as tutorial or an example on how to implement new ublas matrix expressions? Thanks ...

Replacing parameters in a lambda expression

I had a part of code that takes in lambda expressions at runtime, which I can then compile and invoke. Something thing; Expression<Action<Something>> expression = (c => c.DoWork()); Delegate del = expression.Compile(); del.DynamicInvoke(thing); In order to save execution time, I stored those compiled delegates in a cache, a Dictionar...

Globalization in Masterpages

Hi to All, As i know, In ASP .net web forms, we can get text (or any other attributes of asp.net controls) value of the control directly from a resourse file in App_GlobalResources folder through expression attribute of the control without writting any code. ( selecting the control going to its expression property selecting the text s...

Writing an XPath query to match elements based on attributes and content

I have some XML like this: <topics> <topic id="50"/> <topic id="51"/> <topic id="52"/> </topics> <discussions> <discussion type="foo">talked about T50 as Discussion 1000</discussion> <discussion type="bar">Food is yummy!</discussion> <discussion type="foo">talked about T52 as Discussion 1050</discussion> </discussions> Gi...

Calling a custom method from a datagridview column expression

Howdy using c#, vs2008 winforms I have a datagridview that i am programtically binding to a binding source, that is bound to a dataset with 1 table. After filling the dataset using the sqlAdaptor, i want to add a new column to the dataset, and in the new column populate it with a result derived from a call to a custom method in the fo...

Translate XML Schema pattern to Java regular expression

Who can help me to translate this XML Schema pattern "[0-9]+-([0-9]|K)" to java regular expression? ...

Create New Expression from Existing Expression

I have an Expression<Func<T,DateTime>> I want to take the DateTime part of the expression and pull the Month off of it. So I would be turning it into a Expression<Func<T,int>> I'm not really sure how to do this. I looked at the ExpressionTree Visitor but I can't get it to work like I need. Here is an example of the DateTime Expression ...

Regex problem (PHP)

[quote=Username here]quoted text here[/quote] Reply text here I need a regular expression that stores the "Username here", "quoted text here" and "Reply text here" in a Array. This expression needs to support nesting aswell. Eks: [quote=Username2 here][quote=Username here]quoted text here[/quote] Reply text here[/quote] Reply text...

How do I provide a ExpressionBuilderContext to a ExpressionBuilder without a 'virtualpath'?

How can I construct an ExpressionBuilder which takes an ExpressionBuilderContext as parameter, without the use of a virtualpath in the context? I would like to parse expressions which retrieve data which is stored based on business-id rather then a virtualpath belonging to some view. Extra info: I have this to retrieve localized resou...

BASH Arithmetic Expressions

I had used several ways to do some simple integer arithmetic in BASH (3.2). But I can't figure out the best (preferred) way to do it. result=`expr 1 + 2` result=$(( 1 + 2 )) let "result = 1 + 2" What are the fundamental differences between those expressions? Is there other ways to do the same? Is the use of a tool like bc mandatory f...

Executing a modified expression

I found this brief demo: http://msdn.microsoft.com/en-us/library/bb546136.aspx Which discusses modifying an expression. However the code starts with a Expression<Func<string, bool>> and ends up with a Expression so it's not complete. How do I take that expression and make it typed as Expression<Func<string,bool>> again? All the exampl...

php regular expression help finding multiple filenames only not full URL

I am trying to fix a regular expression i have been using in php it finds all find filenames within a sentence / paragraph. The file names always look like this: /this-a-valid-page.php From help i have received on SOF my old pattern was modified to this which avoids full urls which is the issue i was having, but this pattern only find...

C++ Expression Templates

Hi, I currently use C for numerical computations. I've heard that using C++ Expression Templates is better for scientific computing. What are C++ Expression Templates in simple terms? Are there books around that discuss numerical methods/computations using C++ Expression Templates? In what way, C++ Expression Templates are better than...

After Effect - Triangle Wave (JavaScript)

Hi, I'm trying to control a parameter with AE expressions and I need a triangle wave. I've got this so far: freq = 20; amplitude = 8; m = amplitude; i = time*freq; m - (i % (2*m) - m); Unfortunately this gives a saw wave (see below) and my math's a bit rusty, any takers? Thanks! PJ http://i25.photobucket.com/albums/c73/pjburnhi...

Dynamic Linq Property Converting to Sql

I am trying to understand dynamic linq and expression trees. Very basically trying to do an equals supplying the column and value as strings. Here is what I have so far private IQueryable<tblTest> filterTest(string column, string value) { TestDataContext db = new TestDataContext(); // The IQueryable data to query...