expressions

System.Linq.Expressions.ExpressionVisitor is inaccessible due to its protection level

I'm trying to follow the instructions on Creating an IQueryable LINQ Provider, but when I implement the classes which inherit from ExpressionVisitor as instructed I am told that ExpressionVisitor is inaccessible due to its protection level. Am I missing something incredibly basic? ...

What's the difference between those PHP if expressions!?

Hello, What's the difference between those PHP if expressions!? if ($var !== false) { // Do something! } if (false !== $var) { // Do something! } Some frameworks like Zend Framework uses the latest form while the traditional is the first. Thanks in advance ...

Having trouble with Regular Expression and Ampersand

Hi All, I'm having a bit of trouble with regex's (C#, ASP.NET), and I'm pretty sure I'm doing something fundamentally wrong. My task is to bind a dynamically created gridview to a datasource, and then iterate through a column in the grid, looking for the string "A&I". An example of what the data in the cell (in template column) looks ...

PHP preg_match, need some help

Can someone please help me with this preg_match if (preg_match('~[^A-Za-z0-9_\./\]~', $filepath)) // Show Error message. I need to match a possible filepath. So I need to check for double slashes, etc. Valid file path strings should look like this only: mydir/aFile.php or mydir/another_dir/anyfile.js So a slash at the begi...

Why am I seeing different results for two expressions in Ruby, one uses '&&', other uses 'and' operator?

print (-1 == -1) and (myobj.nil?) true print (-1 == -1) && (myobj.nil?) false Note, myobj.nil? returns false so, should not this always be false. ...

How to parse math expressions in C#?

Possible Duplicate: Is there a string math evaluator in .NET? Can C# parse mathematical expressions such as y=3*x + 3 into string? If so, ho? I appreciate your help. ...

Why won't binding to a child object property with rdlc Report work in vs2010?

A while ago someone asked how to bind to a child object's property in a rdlc report. Question here. The solution was to use an expression like this: =Fields!ChildObject.Value.SomeProperty I have recently tried to upgrade to version 10 of the reporting libraries (Microsoft.ReportViewer.WebForms and Microsoft.ReportViewer.Common) and f...

Lambda expressions - set the value of one property in a collection of objects based on the value of another property in the collection

I'm new to lambda expressions and looking to leverage the syntax to set the value of one property in a collection based on another value in a collection Typically I would do a loop: class Item { public string Name { get; set; } public string Value { get; set; } } void Run() { Item item1 = new Item { Name = "name1" }; I...

What is the best way to pass data from a SSRS 2008 R2 report body to the header?

In the SSRS 2008 versions of my reports, I placed the headers for my tablix groups into the report header. Using expressions in hidden tablix columns, I set custom code variables which I then referenced in the header (my headers are concatenations of several report items, so i can't directly reference the report items). This worked fin...

Boolean Expression Evaluation

I have a string (R(46 - 9900)) AND ( NOT (R(48 - 9900))) where R denotes Range . If you evaluate the expression it results in R(46-47) , considering the logical operators (AND,NOT). I have a requirement where I need to parse such a string and evaluate it to a correct result . I have to use C++ as a programming tool to achieve this resul...

Why I cannot add clientId of my textBox in the mark-up here so that I can find it with jQuery?

Hi, Simply I am trying to pass the client Id of one textBox 'txtPersonId' for the client-click event so that I can traverse to that textBox control and pass its jQuery wrapper to the loadePerson() function. This is how I decalre it in the aspx mark-up: <asp:Button ID="btnSearch" runat="server" Text="ARA" OnClientClick="loadPerson(jQue...

Regular Expression jQuery validation

Hi guys. I have been given the task to apply regular expressions on a form validation which I have achieved (using jquery.validate.js). Now, I have to apply a type of regular expressions when the select tag is pointed to US and other type of regular expressions when is pointed to any other country. Any help will be fully appreciated. Tha...

Evaluate beyond one level within Hold in Mathematica

The mathematica documentation on Evaluate at possible issues says: Evaluate works only on the first level, directly inside a held function Why does Mathematica have this limitation? So if I have an expression with more than one level take this simplified example: Hold[Plus[Plus[2, 2], 2]]] Now suppose I want to see what the an...

A little help with perl HTML parsing

I am working on a small perl program that will open a site and search for the words Hail Reports and give me back the information. I am very new to perl so some of this might be simple to fix. First my code says I am using an unitialized value. Here is what I have #!/usr/bin/perl -w use LWP::Simple; my $html = get("http://www.spc.noaa....

RDLC Expression Extension Methods

Is it possible to write extension methods for expressions behind RDLC fields? For example, let's say that I have a DateTime field in my datasource that may either have a valid value or may be null. I drag and drop a TextBox onto my RDLC and format its value using the ToShortDateString() method. This works fine for populated DateTime v...

Automata based alternative to re2

I am needing to implement regular expressions in a C++ program I am writing, and I wanted to use re2 but I could not compile it on windows. Does anyone know of another regular expression library or whatever it's called that compiles easily on windows and isn't a "backtracking" regex engine, but an automata-theory based one (whatever that...

C# MVC: Func<Table1, "runtime type"> How do I get a dynamic type?

Hey, I'm trying to sort a custom data grid of columns based on what the user clicked. The variable "sort" is being passed to the controller but is just a string saying what column is to be sorted. I need to get the Type of that column to be used in a LambdaExpression... heres the code ParameterExpression param = Expression.Parameter(ty...

LINQ Help for boolean function for a list

How could I construct a LINQ expression to remove values from one list that meet the criteria of a function that returns a boolean? string[] message = "days of the week" message.ToList().RemoveAll(c=>checkShortWord(c)); public static bool checkShortWord(string word) { if ((word.Length > 3) && (!...

Resources on parsing expressions

I'm writing a program that needs to build syntax trees from expressions in prefix notation. What resources would you recommend I look into to learn about parsing expressions? ...

IE6 expressions

Let's say I have this markup: <div class="foobar"> <div style="height:expression(this.parent.style.height + 'px')"></div> </div> My expression doesn't work, but you can probably tell what I'm trying to do by it: get the height of the parent element. Please, if you cannot answer the question do not bother replying. This is for a VE...