expression

Sorting xml with simpleXML/xpath?

Hey, I have some xml, say: <Background> <Uses>14</Uses> </Background> <Background> <Uses>19</Uses> </Background> <Background> <Uses>3</Uses> </Background> How can I sort the xml from lowest Uses to highest? Maybe an xpath expression? Also, how could I just retrieve the bottom 2 Backgrounds, or the ones most recently added? Than...

Passing EL expressions or managed bean instance in jsp:include

I have a generic buttons jsp: <wow:button id="addButton" iconClass="add16 icon16x16" action="#{managedbean.addNew}" type="submit" immediate="true" value="#{lblMsg.label_add }" /> <wow:button id="deleteButton" iconClass="iconCancel" action="#{managedbean.delete}" type="submit" value="#{lbl...

What are the advantages to doing WPF in Expression Blend?

Hi, I've been learning WPF and checking out Expression Blend. As far as I can tell, Visual Studio can do everything it can and more. Why do people use Expression Blend? Can it do anything VS cannot? They say its geared for "designers." What tools does it have for designers that VS doesn't? Couldn't designers just use VS? ...

Count no of boolean records from second table - Coredata

hello my test application can currently load a table view which lists a couple of books, the detailview takes you to cells that displays the book text in cells. the user has the ability to bookmark a cell which is a boolean in the book_text table. what i am trying to do is, on the main table view, is: 1-Load the books like how it does ...

Error: SubQuery Returned More than One Value

I've got the following piece of SQL Code that is giving me a titular error. WHERE (SELECT Tokens FROM StringSplitter(@DocumentValue, '|', 1)) IN (SELECT Tokens FROM StringSplitter(@sortValue, '|', 1)) Where @DocumentValue and @sortValue are both concatenated strings separated by a delimiter (in this case, a '|'). The...

VBScript in Reports Expression Editor, filtering out certain values

I have a report that need null values replaced with N/A. It works for x amount of rows until the null value is hit then the rest of the data needing to be displayed just goes away. Here is my expression =iif(Fields!PastBaseline.Value is nothing, "N/A", Round(Fields!PastBaseline.Value)) Anyone know what I am doing wrong? ...

Expression to change specific value text color in string of values in SSRS based on another field

I have a field in my SSRS report, that contains a string of numbers delimited with commas (from a coalesce select in sql). It looks like 12, 91, 160, 171, 223. I would like to change the text color of only ONE specific value (160 for example) in the field, IF the value is also in another field of the report. I already have this for an...

Python operator precedence

Python docs say that * and / have the same precedence. I know that expressions in python are evaluated from left to right. Can i rely in that and assume that j*j/m is always equal to (j*j)/m avoiding the parentheses? If this is the case can i assume that this holds for operators with the same precedence in general? ps: The question a...

Including variables in expression call in R

Hi everyone, I was wondering if it were possible to include variables when using expression in R. For instance I would like to do something like this: par(mfrow=c(2,3)) for (i in 1:6) { plot(x, p1-i*p2, main=expression(Phi[1] - i * Phi[2])) } But this does not work, as it prints 1 - i2 (i.e. it does not substitute i with...

iReport/jasperReports how can i check in xml data source if node exsicts

Hello all i new to iReport , my question is in the expression editor , how can i build expression that checks if xml node extincts and base on that print string i have this expression that returns me null in the result : ( $F{root_customer}.isEmpty() ? "Entity name:" :"Customer id:" ) the root_customer does not exsict in the xml ...

Create a class type in code in .net c#

When I was looking to the System.Linq.Expression capabilities (creating expression trees in code, compiling them, executing them) I was asking myself if this is possible for class creation as well - specifically generic classes. I would expect something like Expression.Class() or Expression.GenericClass(). Looking at the methods I did n...

SSRS: Trouble applying custom expression to Vertical Axis Chart Label

Hey database gurus. Using visual studio BI dev studio 2008. I have a chart that has a Y axis of numbers ranging from 0 to about 1500 (Values), an x axis of dates (Category Group). The Y-axis numbers are integers representing minutes. I want to convert the Y-Axis of minutes to hh:mm form and I thought it would be simple to write a cu...

transform a lambda expression

Hi I have the following code Expression<Func<IPersistentAttributeInfo, bool>> expression = info => info.Owner== null; and want to tranform it to Expression<Func<PersistentAttributeInfo, bool>> expression = info => info.Owner== null; PersistentAttributeInfo is only known at runtime though Is it possible? ...

Creating Dynamic Predicates- passing in property to a function as parameter

I am trying to create dynamic predicate so that it can be used against a list for filtering public class Feature { public string Color{get;set;} public string Weight{get;set;} } I want to be able to create a dynamic predicate so that a List can be filtered. I get few conditions as string values ">","<",">=" etc. Is there a wa...

Expression Blend 3 Default Images Location Problem

I'm using Expression Blend 3 to do the visual side of our project. In the project, we have a folder, named "Images", which we want to use to contain all of our image data. In Expression, though, whenever we add a new image, it adds it directly to the project root, and has all references to the image pointed there. Currently, we do all...

[C++] Expected constant expression fails miserably in switch statement..

Say I have a class "Code" defined like this, with a user specified type conversion to int: class Code { public: int code; std::string description; Code (const int c, const std::string& d) : code(c), description(d) { ; } operator int() const { return code; } }; And a second class "Master" using the code class: cl...

PHP server-side validation regular expression match

Hey guys, I have the following part of a validation script: $invalidEmailError .= "<br/>&raquo;&nbsp;You did not enter a valid E-mail address"; $match = "/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/"; That's the expression, here is the validation: if ( !(preg_match($match,$email)) ) { $errors .= $invalidEmailError; // checks...

Any program to combine several images into one for use with CSS and to reduce round trip count?

I'm looking at ways to reduce the quantity of Round Trips to my site for my clients. Right now I have several images that I think should be combined into a single image like this: http://aspnetajax.componentart.com/common/themes/20101/Office2010Silver/Static.png and then spit out some CSS like this: http://aspnetajax.componentart.co...

PHP regex replace expression with function run on its part

Hello, I have a simple text that is being parsed with PHP. In that text, I sometimes use following syntax: Here's the text... {$video:path/to/my/video.mp4} and here the text goes on. Now, what I need, is, by means regex, to replace this {$video:path/to/my/video.mp4} with the returned string of this: $someObject->processVideoSource('p...

jsp:include not working with Expression Language (JSP version 2.5, EL enabled)

I've read: http://stackoverflow.com/questions/2168832/expression-language-in-jsp-not-working but it's slightly different. Using EL for referencing file works fine like the one below. <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/global.css"/> However when try to use JSP include tag with EL e...