Search Results

Search found 4498 results on 180 pages for 'expression'.

Page 54/180 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • WPF: Is it possible to nest TreeView items with a binding expression?

    - by John Gietzen
    Lets say I have the following data: <XmlDataProvider x:Key="Values"> <x:XData> <folder name="C:"> <folder name="stuff" /> <folder name="things" /> <folder name="windows"> <folder name="system32" /> </folder> </folder> </x:XData> </XmlDataProvider> How can I get that into a treeview? I can't seem to grok hierarchical binding... I know that I can get it in there in C# code, but I wanted to do it with a binding expression.

    Read the article

  • .Net Regular expression - how to do an exact match exclusion on a full string?

    - by Nathan Ridley
    I need a .Net regular expression that matches anything OTHER than the exact full string match specified. So basically: ^Index$ ... is the only exclusion I care about. Strings can start with, finish with or contain "Index", but not match exactly. My brain doesn't seem to be working today and I'm failing to work this one out. EDIT The answer MUST be via the pattern itself, as I am passing an argument to a third party library and do not have control over the process other than via the Regex pattern.

    Read the article

  • Obj-C Error: Expected expression before ...... (why?)

    - by Horatiu Paraschiv
    Hi I have an enum declared like this: typedef enum { Top, Bottom, Center } UIItemAlignment; In my code I try to use it like this: item.alignment = UIItemAlignment.Top; I get an error like this: " Expected expression before 'UIItemAlignment' " If I use only: item.alignment = Top; everything works fine but why do I get this error if I try to use it the other way? _alignment is an NSInteger and it has a property declared like this @property (readwrite) NSInteger alignment; and I synthesized it in my implementation file. So my question is, why do I get this error?

    Read the article

  • What regular expression do I need to check for some non-latin characters?

    - by zeckdude
    I am checking a field if it is Latin Characters or not. var foreignCharacters = $("#foreign_characters").val(); var rlatins = /[\u0000-\u007f]/; if (rlatins.test(foreignCharacters)) { alert("This is Latin Characters"); } else { alert("This is non-latin Characters"); } This works well, but I would like to change it so when I enter any non-latin characters, such as chinese characters, along with a space(which is within that range I am using currently) it will still say it is non-latin characters. How can I change the regular expression I have to do that?

    Read the article

  • How can i filter a list of objects using lamda expression?

    - by Colour Blend
    I know i shouldn't have id's with the same value. This is just fictitious, so overlook that. I have: List<Car> carList = new List<Car>(); carList.Add(new Car() { id = 1, name = "Honda" }); carList.Add(new Car() { id = 2, name = "Toyota" }); carList.Add(new Car() { id = 1, name = "Nissan" }); I want to use Lamda Expression to retreive all cars that have an id of 1. Anticipated Result: -- Id: 1, Name: Honda -- Id: 1, Name: Nissan The problem is more filtering an object list based on a foriegn key. Please help me.

    Read the article

  • How to use a regular expression and assign the result to variables in Android?

    - by ChengYing
    I have a string named s_Result which will be parsed from the Internet. The format may be "Distance: 2.8km (about 9 mins)", and there are 4 variables which are f_Distance, m_DistanceUnit, f_timeEst, m_timeEstUnit. My question is how to parse s_Result and assign 2.8, km, 9, mins into f_Distance, m_distanceUnit, f_timeEst and m_timeEstUnit respectively using regular expression? I tried using "\d+(\.\d+)?" in RegEx Tester and the result showed 2 matches found, but if I use "\\d+(\\.\\d+)?" in Android code, it showed no matches! Any suggestions what might be going wrong?

    Read the article

  • How to customize $(project.compileClasspathElement) like expression in Maven?

    - by zbdiablo
    When i try to run a maven plugin, i found that the default classpath defined in expression $(project.compileClasspathElement) is too long. So, i just want to customize a shorter classpath for this plugin. The default configuration is as follows: <plugin> <groupId>org.datanucleus</groupId> <artifactId>maven-datanucleus-plugin</artifactId> <version>2.0.1</version> <configuration> ...<classpathElements>${project.compileClasspathElements}</classpathElements> </configuration> and the value of classpathElements should be a String List. May i solve this problem? and how? thx!

    Read the article

  • How to use regular expression and assign result into valuables in Android??

    - by user304078
    Dear all, I have to say sorry for my poor English first... I have a string named s_Result which will be parsed from Internet, the format may be "Distance: 2.8km (about 9 mins)", and there are 4 variables which are f_Distance, m_DistanceUnit, f_timeEst, m_timeEstUnit. My question is, how to parse s_Result and assign 2.8, km, 9, mins into f_Distance, m_distanceUnit, f_timeEst, and m_timeEstUnit respectively using regular expression?? I tried using "\d+(.\d+)?" in RegEx Tester and the result showed 2 matches found, but if use "\\d+(\\.\\d+)?" in Android code, it showed nothing matched!!! Is there any suggestion?? Thanks for your help!!

    Read the article

  • Why does this regular expression for sed break inside Makefile?

    - by jcrocholl
    I'm using GNU Make 3.81, and I have the following rule in my Makefile: jslint : java org.mozilla.javascript.tools.shell.Main jslint.js mango.js \ | sed 's/Lint at line \([0-9]\+\) character \([0-9]\+\)/mango.js:\1:\2/' This works fine if I enter it directly on the command line, but the regular expression does not match if I run it with "make jslint". However, it works if I replace \+ with \{1,\} in the Makefile: jslint : java org.mozilla.javascript.tools.shell.Main jslint.js mango.js \ | sed 's/Lint at line \([0-9]\{1,\}\) character \([0-9]\{1,\}\)/mango.js:\1:\2/' Is there some special meaning to \+ in Makefiles, or is this a bug?

    Read the article

  • How to paste text and variables into a logical expression in R?

    - by Jasper
    I want to paste variables in the logical expression that I am using to subset data, but the subset function does not see them as column names when pasted (either with ot without quotes). I have a dataframe with columns named col1, col2 etc. I want to subset for the rows in which colx < 0.05 This DOES work: subsetdata<-subset(dataframe, col1<0.05) subsetdata<-subset(dataframe, col2<0.05) This does NOT work: for (k in 1:2){ subsetdata<-subset(dataframe, paste("col",k,sep="")<0.05) } for (k in 1:2){ subsetdata<-subset(dataframe, noquote(paste("col",k,sep=""))<0.05) } I can't find the answer; any suggestions?

    Read the article

  • ASP.NET in VS IDE gives "Expression cannot be evaluated at this time."

    - by S Nash
    I read all of similar questions in SO but none seem to be an answer. Situation is simple. I have a ASP.NET webpage, In a VB code behind file I have the following line: iRendProvider = ddlProvider.SelectedItem.Value where iRendProvider is integer and ddlProvider is a dropdownlist. I put a breakpoint at the above line and code stops there. Now in the immdediate window in I type: ? ddlProvider.SelectedItem.Value I get "Expression cannot be evaluated at this time." If I step over iRendProvider = ddlProvider.SelectedItem.Value To the next line and I type ? iRendProvider , I see the correct value in the immediate window. Question is why this error and how to see contents of ddlProvider.

    Read the article

  • how do i grab text of multiple tags in an xml feed using one xpath expression?

    - by Incognito
    Im trying to parse an xml feed that looks something like this: <item> <title>item title</title> <link>item link</link> <description>item description</description> </item> I'm trying to find an xpath expression that will retrieve all the details of each item so that each item in the feed is contained within its own array or grouped in some way. I tried using //item/* but the tags are not grouped, although they are correctly ordered. Is there anyway of doing that? edit: [ [title1, link1, desc1], [title2, link2, desc2], [title3, link3, desc3] ]

    Read the article

  • Regular Expression; Find whether a line contains any word with more than X characters.

    - by Simpsoid
    Hi, I am trying to use a Validator on a ASP.NET site and need to find whether the Street Address textbox contains a valid entry. Entries with words that are longer than X characters (in this case 25, with no punctuation or spaces) will cause the HTML on a printed A4 page to not wrap properly and therefore not to confrom to certain sizes correctly pushing the margins off. For a street address I want to match that something like "201 Long Road" is valid but "235 ReallyLongAndNarrowWindingRoadBesideTheRiver Street" is invalid. Using a Microsoft .Net Regular Expression Validator I need to know what the RegEx pattern might be. I think if it does find a match the Validator will fire correctly however if there is no match the Validator won't fire and the Update button (in this case) won't fire. Since Street addresses can contain Capital Letters and numbers etc. it will need to accomodate for that and also Spaces, Commas, Semi-Colons and Colons and Hyphens are valid characters too. Any help would be greatly appreciated as I am really stuck with this problem. Thanks, David

    Read the article

  • Regular Expression to recognise truncated forms of search string?

    - by Moonshield
    I'm trying to formulate a regular expression which will recognise the search term truncated by any number of characters from the right. For example, if the search term is "pickle", the regex should recognise "pi", "pick" but not "pickaxe". Initially I came up with the following: p(i(c(k(l(e)?)?)?)?)? That works perfectly, but seems a crude way of doing it. Is there a better way of doing this? I had a look around for something similar to what I want, but I'm not entirely sure what to search for.

    Read the article

  • TypeError: Result of expression 'printWindow' [undefined] is not an object.

    - by orangebrainer
    I'm trying to create hidden iframes in my page dynamically to load 3 other pages so that i can grab all the HTML and combine them into 1 in a new window. However i'm stuck at this. tHe frames are created fine. But whenever the javascript runs to the part of function openNewWindow() { var printWindow = window.open("",""); printWindow.document.open(); printWindow.document.write(HTMLfromFrames); printWindow.document.close(); } i get this error: TypeError: Result of expression 'printWindow' [undefined] is not an object. but if i generate a button to call this function seperately, it works fine. however i need it to run all in one click event Anybody has any idea what's wrong? Thanks!

    Read the article

  • Regular Expression to get the size value of a CSS property?

    - by thiesdiggity
    I wrote a regular expression to get the size from a CSS property: /(([+-]?\d*\.?\d+(\s)*(px|em|ex|pt|in|pc|mm|cm)?)|thin|medium|thick)(\s|;|$)/i but for some reason its not working as intended. For example, when I run the following: preg_match_all('/(([+-]?\d*\.?\d+(\s)*(px|em|ex|pt|in|pc|mm|cm)?)|thin|medium|thick)(\s|;|$)/i', "border-bottom:1px solid #99999;", $matches); It outputs: 1px 99999; But I only want the 1px value returned. I understand why its returning the above but can't seem to figure out how to only return the size and not the color value. I tried using the following negative lookbehind but it's not working either: /(((?<!#\d{3}|#\d{6})[+-]?\d*\.?\d+(\s)*(px|em|ex|pt|in|pc|mm|cm)?)|thin|medium|thick)(\s|;|$)/i I want to use preg_match_all for those CSS properties that can have multiple size values (i.e. margin). Anyone have any ideas how to get this regex to return only the size values? Thanks for your help!

    Read the article

  • Get part of a string of part of regular expression?

    - by Buttink
    Im trying to make a script that will go into a directory and run my own application with each file matching a regular expression, specifically "Test[0-9]*.txt". My input filenames look like this "TestXX.txt". Now, I could just use cut and chop off the Test and .txt, but how would I do this if XX wasn't predefined to be 2 numbers? What would I do if i had "Test1.txt" ... "Test10.txt"? In other words, How would I get the [0-9]* part? Just so you know, I want to be able to make a OutputXX.txt :)

    Read the article

  • How do I specify the regular expression to disable the use of underscores after the '@' sign in php for email validation?

    - by Qlidnaque
    Currently the following email in the script validates even though there are no underscores indicated in the second part of the regular expression validation after the '@' sign. How do I make underscores invalid in the second part of the email? <?php $email = 'firstname.lastname@a_aa.bbb.co_m'; $regexp = "/^[^0-9][A-z0-9_]+([.][A-z0-9_]+)*[@][A-z0-9]+([.][A-z0-9]+)*[.][A-z]{2,4}$/"; if (preg_match($regexp, $email)) { echo "Email address is valid."; } else { echo "Email address is <u>not</u> valid."; } ?>

    Read the article

  • How to check that a regular expression fall into infty loop or not?

    - by Sorush Rabiee
    I'm trying to learn and hopefully use regular expression with Qt. I found that some patterns cause handler to fall into loop. for example searching \b\b in a text, never will terminate. and number of these expressions is infinite (\b\b\b,\b\b\b\b and so on). I'd like to determine and control all invalid expressions. Is there an algorithm to distinguish valid and invalid expressions? If not, how can I prevent my program from falling into an infinite loop?

    Read the article

  • Is it possible to use a back reference to specify the number of replications in a regular expression

    - by user307894
    Is it possible to use a back reference to specify the number of replications in a regular expression? foo= 'ADCKAL+2AG.+2AG.+2AG.+2AGGG+.+G+3AGGa4.' The substrings that start with '+[0-9]' followed by '[A-z]{n}.' need to be replaced with simply '+' where the variable n is the digit from earlier in the substring. Can that n be back referenced? For example (doesn't work) '+([0-9])[A-z]{/1}.' is the pattern I want replaced with "+" (that last dot can be any character and represents a quality score) so that foo should come out to ADCKAL++++G.G+. foo = 'ADCKAL+2AG.+2AG.+2AG.+2AGGG^+.+G+3AGGa4.' indelpatt = re.compile('\+([0-9])') while indelpatt.search(foo): indelsize=int(indelpatt.search(foo).group(1)) new_regex = '\+%s[ACGTNacgtn]{%s}.' % (indelsize,indelsize) newpatt=re.compile(new_regex) foo = newpatt.sub("+", foo) I'm probably missing an easier way to parse the string.

    Read the article

  • ypeError: Result of expression 'printWindow' [undefined] is not an object.

    - by orangebrainer
    I'm trying to create hidden iframes in my page dynamically to load 3 other pages so that i can grab all the HTML and combine them into 1 in a new window. However i'm stuck at this. tHe frames are created fine. But whenever the javascript runs to the part of openNewWindow(); { var printWindow = window.open("",""); printWindow.document.open(); printWindow.document.write(HTMLfromFrames); printWindow.document.close(); } i get this error: TypeError: Result of expression 'printWindow' [undefined] is not an object. but if i generate a button to call this function seperately, it works fine. however i need it to run all in one click event Anybody as any idea what's wrong? Thanks!

    Read the article

  • Is using a DataSet's column Expression works in background same as manual calculation?

    - by Harikrishna
    I have one datatable which is not bindided and records are coming from the file by parsing it in the datatable dynamically every time. Now there is three columns in the datatable Marks1,Marks2 and FinalMarks. And their types is decimal. Now for making addition of columns Marks1 and Marks2 's records and store it into FinalMarks column,For that what I do is : datatableResult.Columns["FinalMarks"].Expression="Marks1+Marks2"; It's works properly. It can be done in other way also is foreach (DataRow r in datatableResult.Rows) { r["FinalMarks"]=Convert.ToDecimal(r["Marks1"])+Convert.ToDecimal(r["Marks2"]); } Is first approach same as second approach in background means is both approach same or what? EDIT: I want to know that first approach works in background as second approach.

    Read the article

  • VHDL - Problem with std_logic_vector

    - by wretrOvian
    Hi, i'm coding a 4-bit binary adder with accumulator: library ieee; use ieee.std_logic_1164.all; entity binadder is port(n,clk,sh:in bit; x,y:inout std_logic_vector(3 downto 0); co:inout bit; done:out bit); end binadder; architecture binadder of binadder is signal state: integer range 0 to 3; signal sum,cin:bit; begin sum<= (x(0) xor y(0)) xor cin; co<= (x(0) and y(0)) or (y(0) and cin) or (x(0) and cin); process begin wait until clk='0'; case state is when 0=> if(n='1') then state<=1; end if; when 1|2|3=> if(sh='1') then x<= sum & x(3 downto 1); y<= y(0) & y(3 downto 1); cin<=co; end if; if(state=3) then state<=0; end if; end case; end process; done<='1' when state=3 else '0'; end binadder; The output : -- Compiling architecture binadder of binadder ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(15): No feasible entries for infix operator "xor". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(15): Type error resolving infix expression "xor" as type std.standard.bit. ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(16): No feasible entries for infix operator "and". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(16): Bad expression in right operand of infix expression "or". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(16): No feasible entries for infix operator "and". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(16): Bad expression in left operand of infix expression "or". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(16): Bad expression in right operand of infix expression "or". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(16): Type error resolving infix expression "or" as type std.standard.bit. ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(28): No feasible entries for infix operator "&". ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(28): Type error resolving infix expression "&" as type ieee.std_logic_1164.std_logic_vector. ** Error: C:/Modeltech_pe_edu_6.5a/examples/binadder.vhdl(39): VHDL Compiler exiting I believe i'm not handling std_logic_vector's correctly. Please tell me how? :(

    Read the article

  • Converting F# Quotations into LINQ Expressions

    - by forki23
    Hi, I can convert a quotation of type Expr<'a -> 'b> to a Linq expression via the following snippet: /// Converts a F# Expression to a LINQ Lambda let toLambda (exp:Expr) = let linq = exp.ToLinqExpression() :?> MethodCallExpression linq.Arguments.[0] :?> LambdaExpression /// Converts a Lambda quotation into a Linq Lamba Expression with 1 parameter let ToLinq (exp : Expr<'a -> 'b>) = let lambda = toLambda exp Expression.Lambda<Func<'a, 'b>>(lambda.Body, lambda.Parameters) Now I want to convert a quotation of type Expr<'a * 'b -> 'c> or maybe even Expr<'a -> 'b -> 'c> to a Linq Lambda Expression of type Expression<Func<'a,'b'c>>. How can I do this? Regards, forki

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >