expression

Why this code not generate in my PC (PHP)????

Hi everyone When I write <?=?> in my PC it's not working,but it's work in another PC !!! why ??? :( for example : <?php $courses = CourseManager::findAll(); ?> <h3>Course List</h3> <table> <tr><th>Name</th></tr> <?php foreach ($courses as $c){ ?> <tr> <td><?=$c->getName()?></td></tr> <?php } ?> </table> or ...

Is it possible in LINQ to SQL to create a computed column using DataContext.CreateDatabase?

I want to dynamically create a database using my DataContext's CreateDatabase Method. I have manually created mapping classes and tested them. But as soon as I add the Expression Column (see below) the creation fails with an SqlCeException and I am unable to find out the exact reason. /// <summary> /// The sum of ratings for thi...

Expression Blend Error - Value cannot be null. Parameter name: stream

I'm getting the above error when trying to load a User Control xaml file in design view in Expression Blend 4. The xaml itself runs successfully in VS 2010, and I can view the xaml in blend, but not in design view. When viewing the xaml in 'xaml view' the UserControl element is underlined in red. Anybody run across this issue? ...

python string conversion for eval.

I have list like: ['name','country_id', 'price','rate','discount', 'qty'] and a string expression like exp = 'qty * price - discount + 100' I want to convert this expression into exp = 'obj.qty * obj.price - obj.discount + 100' as I wanna eval this expression like eval(exp or False, dict(obj=my_obj)) my question is what would b...

COCO/R Expression syntax failing

Hi All, I've got this little COCO/R grammar fragment that roughly mimics the syntax of c-style languages for expressions (only vastly simpler). But for some reason, it refuses to parse a compound expression. Perhaps it's been a long week, or perhaps I'm missing something totally obvious. I've boiled the Expression grammar down as much a...

How to formulate conditional expression in SSIS Data Flow tab?

I am developing an SSIS 2008 package and I am trying to create a Derived Column transformation. But when I go to the Expression editor and try this expression it gives me alot of errors. I have tried various differentiations of this but all have resulted in errors. I need one of you SQL experts to point out a better expression! IS...

How do I write an if else statement in Reporting Services expression language?

I would like to write a Reporting Services "Expression" that basically behaves as the following (pseudo code)... if ([Fields!StateProvinceId.Value] == 1) { return "Ontario"; } else if ([Fields!StateProvinceId.Value] == 2) { return "Quebec"; } else if ([Fields!StateProvinceId.Value] == 3) { return "Manitoba"; } // ... // more ca...

Evaluating an expression stored as a string

I want to store a boolean expression in a database, and evaluate it. It’s not necessary to store the complete expression tree, a string probably do it. I imagined a scheme like this: Criteria (expression_to_evaluate, value_to_return) For example, let’s say that I have an expression that matches people with age between 20 and 40: (var ...

How to ignore whitespace and carriage returns within text using regular expressions

Hi, Im quite new to stackoverflow so I dont know if this question has been asked before, but I cant seem to find any past questions which hint at the answer. Any help is really appreciated and thanks in advance. I have this text: { 1282837200, -- [1] "Type", -- [2] "Name", -- [3] "Reason", -- [4] Amount, -- [5] }, -- [...

Is there a C/C++ library that allows you to find out whether a set of expressions are mutually exclusive?

Hi, I'm writing a compiler for a dataflow programming language I have designed. One of the features that I really like about it is that you can express the following: x <- a + 1 if b > 3; x <- a - 1 if b <= 3; Which implies something like: x <- a - 1 + 2*(b>3); In order to pull this off though the compiler needs to know that: ((b >...

silverlight adaptive steaming, server side encoding?

has anyone used microsoft expression encoder SDK to do server side encoding of videos to preapare it for silverlight adaptive streaming? What is your experience with it? ...

CRTP and templated expressions

In a complex library that uses templated expressions, and the Curiously Recursive Template Pattern (CRTP), I need some overloaded operators to be specialized with base classes, but operations involving their derived classes are not finding the base-class specialization. Ie: if an operator is defined for BaseA< T > + BaseA< T >, then c...

Linq Expression string with inline values

I am trying to build expression strings for use with IOC extended nHydrate. When I call ToString() on my expression I get something like this: employee => employee.Username == value( Some type name here ) Is there a way to resolve that value call to the actual value? employee => employee.Username == "Captain Spiffy" ...

Expression Encoder 3 encodes a timestamp into video source

I have been recently using C# .Net and EE3 to write an application to capture video from a live stream, and store the output file into my local harddrive. Now, when it comes to the the video playback stage, there is a new requirement of displaying the recorded date time in real-time just like what we normally see in a security camera vid...

LINQ Query to match a sequence

Hi, I have a result set, say clientList. And I want to make sure that ALL the clients in the ClientList have a Profession as "Banker". Let the result of the query be a boolean value. How can I write the LINQ or lambda expression query to get the result? ...

.NET 4.0: Parameter naming inconsistency between Expression and MethodInfo

Hello there, I have just found some misterious behaviour while working with System.Linq.Expressions.Expression and System.Reflection.MethodInfo. The code is as follows: static void Main(string[] args) { Expression<Func<double, double, double>> example = (x, y) => Math.Sin(x); //Prints out "x, y": Cons...

Implementing a "like" operator multiple times in one Linq to Entities query

We have a list of strings and we need to filter our results by that list. Example would be find all students who have SSNs that start with 465, 496, or 497 (plus x more) List<string> list = GetPossibleStartsWithValues(); var qry = from student in entities.Students.WhereStartsWith(x=>x.SSN, list) select new SearchedStudent { Name ...

Troubleshooting XamlParseExceptions in Expression Blend 4

What is the best way to troubleshoot XamlParseExceptions in Blend? I'm using Blend 4 RTM, with a SL4 project, and I get totally stumped when I get the "Red Screen of Death": "An Exception was thrown. XamlParseException: [Line: 0 Position: 0]..." Is there a list of techniques that help? The error message is completely opaque and useles...

How to validate a boolean in Struts 2 Validation Framework

Simple: I have to be sure the privacy checkbox on my form is checked. I tryed to use the expression validator (and the fieldexpression validator) but it does'n work. Can anobody help me? ...

Cron expression for particular date

I want a cron expression that represents 6th September 2010 6:00 am ...