expression

Get expression parameter name

I need to get the name of a expression parameter. What i want to do is similar to what FluentNhibernate does with column mapping: Map(x => x.Name) From this, i need "Name". How do I do this? I can get x by doing this: Expression<Func<User, object>> exp = x => x.Id; exp.Parameters[0].Name; But im not able to get "Name". Note th...

Constraining combo box rows to field entry of the same entry

I have three related tables: People has ID fields for both Organisations and Locations. Locations has an ID field for Organisation. I want the Locations combo box in my People table to show only the Locations that have the Organisation_ID that was entered previously. I tried WHERE but it doesn't seem to recognise the [People].[Organisati...

Need help trying to EagerLoad some data in EntityFramework.

Hi folks, I'm trying to do some eager loading on an EF Entity. so, if the entity is called Orders .. then I guess i would do the following... _someContext.Orders.Include("Whatever") .... But the problem is, I have a method like the following ... public IQueryable<Order> Find(Expression<Func<Order, bool>> predicate) { return Curr...

How do you change the text colour of a label programmatically in Microsoft Expression Blend 4

Hey guys, How do I change a label's colour (for example labelname = myLBL) programmatically? Thanks Andy ...

Expression blend 4 dynamic layout example

Hey! I am trying to play with making my app look better and I found this and was incredibly impressed with the workspace example found here: http://expression.microsoft.com/en-us/ff624123.aspx look at the example with state timeline and props with the workspaces which switch what has focus in the window. The code can be found here : htt...

Video encoded by Expression Encoder is 3 seconds long on YouTube

Hi, I am trying to upload video created using MS Expression Encoder 4 to YouTube, but after processing any video is played in 3 seconds. Any ideas? Is it problem of encoder configuration or YouTube? Thank you. ...

Help With Generic LINQ OrderBy Lambda Expression

Hi Guys, Trying to get an OrderBy on an IQueryable to work, not having much luck. Here's my method: public ICollection<T> FindAll<T>(Expression<Func<T,bool>> predicate, Expression<Func<T,int>> orderingKey) where T : Post { return repository .Find() .Where(predicate) .OfType<T>() ...

Java String and Mathematical Expression Evaluators

Hi, We use the Jeks parser at present to evaluate expressions. I cannot see a way to evaluate string expressions with it - for example: IF( "Test 1" = "Test 2") Is there anything out there that can evaluate string and mathematical expressions in Java? Preferably free or open source. Thanks for any help, Andez ...

How to get child property inside parent class?

Hi all, Could you answer me how to do next, please? How to do this with Lambda? Is it possible to delegate some object instance and use its properties and methods in case if this method doesn't know type of delegated object? class class_a { public string getChildData<T> (T dynamicInstance) { return dynamicInstance.prop; ...

Creating a Custom Silverlight Designer in WPF

I need to create a designer for Silverlight in WPF and I’m thinking of a few options Use a WebBrowser control, display the content there and communicate Silverlight using the JavaScript Bridge. Not sure if this will be enough for the scenarios I need to support (see below). This is what KaXaml is doing. SilverlightSpy uses a a more so...

Evaluation of a reference expression

As per @Potatoswatter's suggestion, I have created a new discussion. Reference is this response from @Potatoswatter Given the code snippet, int i = 3, &j = i; j = ++ i; The comment which I seek clarity on, is this. (which seems to be an important missing piece in my understanding of the unsequenced evaluation a.k.a sequence point)...

Python: how to tell if a string represent a statement or an expression?

Hello I need to either call exec() or eval() based on an input string "s" If "s" was an expression, after calling eval() I want to print the result if the result was not None If "s" was a statement then simply exec(). If the statement happens to print something then so be it. s = "1 == 2" # user input # --- try: v = eval(s) ...

Expression.Call - Calling linq extension: FirstOrDefault, Where....

I am trying to create the following dynamically, however I am having problems calling the extension method "FirstOrDefault" using(var context = new Entities()) { var list = context.Engines.Include("Cars").Select(e => e.Cars.FirstOrDefault()).ToList(); } I have the following Expression parameter = Expression.P...

FTP Connection string using expression in SSIS

Hi, In my SSIS 2005 package, I need to give the FTP Connectionstring via an expression as I need to keep it configurable for the user from the dtsConfig file. At the moment I tried giving the following expression: Connectionstring = @[User::FTPServer] + "." + @[User::FTPUser] + "." + @[User::FTPPass] For this unique syntax, I took poi...

Expression that either returns the output string from a program, or a specific string, if the program doesn't exist

I'm using mercurial as a SCM, and an output from the hg parents command in my makefile to store build number and version information in my program. However, mercurial is not always present on machines where I try to build the program. Thus, hg parent fails. I'd like to use a substitute string (hard-coded or output from other program) whe...

Evaluation of C expression

int main() { int i = -3, j = 2, k = 0, m; m = ++i || ++j && ++k; printf("%d %d %d %d\n", i, j, k, m); return 0; } i thought that && has more precedence that || as per this logic ++j should execute, but it never does and the program outputs -2 2 0 1. What is going on here? What are the intermediate steps? ...

do exist any succesful project using mvvm? (designer viewpoint)

Preface : i know, exist several topics talking about MVVM and how it is good (or bad) but my question is a bit different :i want to know if really exist any successful project that uses partially or completely MVVM, all all as a designer viewpoint. I am starting another project using MVC (web), i have some experience with it and it wor...

Trying to find an algorithm which takes 2 regular expressions and tells whether they are equivalent

I'm trying to find out what the algorithm would be by being given two languages L1 and L2 to determine if they are equivalent (L1 = L2). It's surprisingly difficult to come up with one as I've found, although I am pretty sure it needs to be converted to a DFA first and then reduce each of them to a minimal DFA.. Also, I know that if L1...

Filter expression not working properly

Hi, I am using a GridView and I require the user to be able to filter using 2 controls. One simply filters the type of row - there is a column called action, and the user selects one of the distinct values from the database in a dropdown box, and the gridview only displays the rows with that value in the action column. On it's own this w...

Expression Engine CMS

I’m looking at using Expression Engine for a new site I’m developing does anyone have any experience of using EE, good or bad? I’ve looked at some other CMS but found they are quite big and although you get everything, I like EE as it looks like you can streamline it to exactly what you want your users to use? The main feature I need i...