expression

filling a boost vector or matrix

Is there a single-expression way to assign a scalar to all elements of of a boost matrix or vector? I'm trying to find a more compact way of representing: boost::numeric::ublas::c_vector<float, N> v; for (size_t i=0; i<N; i++) { v[i] = myScalar; } The following do not work: boost::numeric::ublas::c_vector<float, N> v(myScal...

Logic expression parser

I'm trying to create a logic expression parser for expressions like: ((VariableA -> VariableB) AND NOT VariableC) The parser should be able to return, wheather the result is true or false for given values of variables. Basicly the expressions will only contain variables, logical operators (or, and, implication, equivalence, negation a...

Expression Engine: Change status outside admin section.

Is it possible to edit an entrie's status outside the admin section? I want to be able to open and close entries from the front page. ...

Spurious characters in HTML files using Microsoft Expression

Hello all, I've got MS Expression Web (12.0.6211.1000). I usually use Homesite but it and Vista don't get on so I thought I'd try Expression for editing simple HTML files. I find that Espression Web inserts the characters  at the top of every file I edit, just before the <!DOCTYPE... tag. What are these and how can I make it sto...

SSIS Derived Column Expression for Boolean-to-Char CAST

Hello, I am having a bit of a struggle with Expressions inside SSIS Derived Columns. My source field is a BOOLEAN data type. It's destination field is a SQL CHAR datatype. ** Note that I did not design either of the schemas. If I had my way, the data types would match up. Unfortunately, this is not my case! I found a great example of...

How to implement outer join expression tree?

I need to implement the query using expressions syntax (because I don't know types in compile time). For example query like this one: from customer in Customers join purchase in Purchases on customer.ID equals purchase.CustomerID into outerJoin from range in outerJoin.DefaultIfEmpty() where customer.Name == "SomeName" && range.Desc...

Expression parsing: how to tokenize

I'm looking to tokenize Java/Javascript-like expressions in javascript code. My input will be a string containing the expression, and the output needs to be an array of tokens. What's the best practice for doing something like this? Do I need to iterate the string or is there a regular expression that will do this for me? I need this t...

Expression Engine: OpenID support?

Is there a way to use OpenID with EE? ...

Subsonic dynamic query expression

Hi all, I am having a few issues with trying to live in a subsonic world and being a subsonic girl when it comes to subsonic expressions.... after reading http://stackoverflow.com/questions/765896/subsonic-query-conditiona-or-conditionb-and-conditionc it would appear i am not the only one with this sort of issue but hopefully someone (...

Converting inserted string to a compilable expression

Hi, I'm somehow new to Java so my question can seem trivial, however i cannot find an answer to it anywhere in my books. I want to initiatie a dialog with a user in which he would enter an arithmetic expression (ex. (2*x+y)) And then print out the result for such expression (for given values of x and y) String EXPRESION = null; E...

Performing expression evaluation/reduction in Visual Studio 2008

Is it possible to get Visual Studio to do mathematical expression evaluation/reduction? For example if I type '-0.005 + -0.345' how do I get Visual Studio to reduce that (i.e. replace it with the reduction)? Do I have to write a macro? If so, are there any pre-existing macros to do this type of expression reduction? Just to be clear,...

Is there any kind of "expression class" (C++)

I am creating a game that lets the player enter input, changes some states, then checks if a "goal value" is true (obviously this description is muchly simplified), and I want to be able to have that goal value be anything from if the players life is below a certain value to if the amount of enemies remaining is equal to zero. Is there ...

Literals or expressions in unit test asserts?

Do you prefer literal values or expressions in your Asserts in your unit tests? This little example demonstrates what I mean - please pay attention to the comments: [Test] public function fromXML_works() : void { var slideshow : Slideshow = SlideshowConverter.fromXML(xmlSample); // do you prefer literal value "1": assertEqu...

How to make an "operator" variable? (C++)

I am working on making an expression class: template<typename T, typename U> class expression { public: expression(T vala, U valb, oper o){val1 = vala; val2 = valb; op = o;} operator bool{return(val1 op val2);} private: T val1; U val2; oper op; }; as you can see, this is somewhat pseudocode, because I need an opera...

Convert Method Group to Expression

I'm trying to figure out of if there is a simple syntax for converting a Method Group to an expression. It seems easy enough with lambdas, but it doesn't translate to methods: Given public delegate int FuncIntInt(int x); all of the below are valid: Func<int, int> func1 = x => x; FuncIntInt del1 = x => x; Expression<Func<int, int>> f...

Help with Expression Encoder SDK

I am currently experimenting with the Expression Encoder SDK, but I find it very confusing to use when it comes to live streaming. I am trying to capture a video stream from a webcam, encode with my program and then publish it as a live stream from my computer while also injecting script commands. I've been looking through the SDK but I ...

Self Centering Page in Silverlight \ Express Blend

I have been trying hours to create a page (Axml) in expression blend that stays in the center of the browser yet equally reduces the white space on either side when the browser window is resized. And example is this site or most decent site on the net. Love a code example or link. Thanks ...

filename.Contains #(pound) or ' (single quote)

In c# how can I check in the file name has the "pound sign" and "apostrophe sign" This is waht I tried so far but doesn't work. I need to send an error if the # or ' are in the filename return filename.Contains("#\'"); ...

Javascript parser for simple expression

I would like to find a javascript parser that can handle and evaluate simple expressions. The parser should be able to evaluate the regular mathematical expressions, and support custom functions with parameters. It also has to support strings handling. String concatenation with || operator support is preferred, but it is okay if + will d...

How to get rid of unnecessary parentheses in mathematical expression

Hi I was wondering if there is any known way to get rid of unnecessary parentheses in mathematical formula. The reason I am asking this question is that I have to minimize such formula length if((-if(([V].[6432])=0;0;(([V].[6432])-([V].[6445]))*(((([V].[6443]))/1000*([V].[6448]) +(([V].[6443]))*([V].[6449])+([V].[6450]))*(1-([V].[6446])...