expression

Regular expression token antlrV3

Can I write a rule where the initial token is partly fixed and partly generic? rule: ID '=' NUMBER ; ID: (A.. Z | a.. Z) + NUMBER: (0 .. 9) + But only if the token ID is in the form var* (var is fixed) Thanks ...

Currency validation

Hello All, Please help with me writing a JavaScript Validation for currency/money field. So please provide any regular expressions if u have :) Also, for my region, don't need any currency symbols like '$' in the field. Only decimals are to be included for validation as special chars., along with numbers. ...

unable to make out how ~ operator works in c

hello, I have this piece of code can you explain me the output unsigned int x=3; ~x; printf("%d",x); output is 10 I am not able to make it how. I have compiled the code on turbo c ...

Get text between complex tags in PHP

Hi, I'm trying to get text from in between 2 html tags, only the difficulty is that the tag can differ from name. I'll explain into detail: <icon displayid="62115">inv_helmet_130</icon> I have to get the inv_helmet_130 But the displayid of the tag can differ, any ideas on how to solve this? Perhaps with a regular explression b...

Expression Web 3.0 SuperPreview on a .Net MVC 1.0 Web site

Hi All, We are trying to use Web Expression 3.0 feature SuperPreview to make our site consistent across multiple browsers. Our's is a MVC 1.0 application. Has anyone tried to use SuperPreview on that ? Your advise will be very helpful. ...

Getting the name which is not defined from NameError in python.

Hello! As you know, if we simply do: >>> a > 0 Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> a > 0 NameError: name 'a' is not defined Is there a way of catching the exception/error and extracting from it the value 'a'. I need this because I'm evaluating some dynamically created expressions, and woul...

Boolean and Math Expression Parser

Hello, I am writing an application that allows a user to enter a boolean expression. I need the ability to evaluate the entered boolean expression at runtime and am looking for both a parser and a expressoin validator. Parser The parser needs to take a boolean expression as a string and return true/false. Example: string expression...

Simple expression parser example using Boost::Spirit ?

Is anyone aware of an online resource where I can find out how to write a simple expression parser using Boost::Spirit?. I do not necessarily need to evaluate the expression, but I need to parse it and be able to return a boolean to indicate whether the expression is parsable or not (e.g. brackets not matching etc). I need the parser t...

How do I match a quoted string followed by a string in curly brackets?

I need a regex expression for matching a string in quotes and then a white space then a round bracket then a curly bracket. For example this is the text I want to match in Java: "'Allo 'Allo!" (1982) {A Barrel Full of Airmen (#7.7)} What would the regex for this be? Sorry, but I'm just really lost. I tried a lot of different things b...

Why doesn't my tempate show up in expression blend 3

I right click on a button. Select edit template edit a copy. The template is blank and not the template of the button. This happens off and on. WHY???? ...

WPF Designer Popup Content Display

Happy friday folks, awesome. I am currently writing a small tooltip mimicking control to display inline help in an application. I was going to just use standard tooltips but decided that I potentially wanted interactivity. I have it working no problem. Its quite literally an implementation of ContentControl with a ControlTemplate trigg...

Using Lambda Expressions trees with IEnumerable

I've been trying to learn more about using Lamba expression trees and so I created a simple example. Here is the code, this works in LINQPad if pasted in as a C# program. void Main() { IEnumerable<User> list = GetUsers().Where(NameContains("a")); list.Dump("Users"); } // Methods public IEnumerable<User> GetUsers() { yield r...

Expression Studio - v2 good enough for learning?

I have VS 2008, and looking forward to moving fairly quickly to VS2010. Our applications (we only have a few) are all winforms apps - mostly VB. I want to start to learn WPF. My version of Expression Studio is version 2. I have heard that the improvements made from version 2 to version 3 are significant. If it follows the paradigm o...

Regex for continues sentence

I have the following text, I need to extract the exception name and the continuing sentence from the file, but the file has continuous sentences without a space. ??????>????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????...

Storing expression references to data base

I have standard arithmetic expressions sotred as strings eg. "WIDTH * 2 + HEIGHT * 2" In this example WIDTH and HEIGHT references other objects in my system and the literals WIDTH and HEIGHT refers to a property (Name) on those objects. The problem I'm having is when the Name property on an expression object changes the expression won...

How would I express a chained assignment in Scala?

How would I express the following java code in scala? a = b = c; By the way, I'm re-assigning variables (not declaring). ...

Error in ternary expression

Consider the following code which shows compile time error : #include <stdio.h> int main(int argc, char** argv) { int x=5,y=0,z=2; int a=z?x,y?x:(y); // but z?x,y?x:y:z is not showing any error printf("%d",a); return 0; } Please help me explain the reason why z?x,y?x:y:z is not showing any error? ...

Storing expression template functors

Hello guys, at the moment I'm really interested in expression templates and want to code a library for writing and differentiating mathematical functions with a lambda-style syntax. At the moment, I'm able to write (_x * _x)(2); and get the correct result 4. But I would really like to do something like MathFunction f = _x * _x; f(2);, b...

Expression engine! MySQL query for entry/expiration date range

I’ve built a site in ExpressionEngine for some holiday apartments (EE1.6.8), that uses two related weblogs for bookings. ‘apartments’ & ‘booking’ Bookings are set up as weblog entries using the entry_date for arrival and expiration_date for leaving date, and are related back to the apartment that is booked. I’ve built a page that list...

C++ infix to postfix conversion for logical conditions

I want to evaluate one expression in C++. To evaluate it, I want the expression to be converted to prefix format. Here is an example wstring expression = "Feature1 And Feature2"; Here are possible ways. expression = "Feature1 And (Feature2 Or Feature3)"; expression = "Not Feature1 Or Feature3"; Here And, Or, Not are reserved w...