Search Results

Search found 6715 results on 269 pages for 'preg match'.

Page 119/269 | < Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >

  • What happens in memory when calling a function with literal values?

    - by Drise
    Suppose I have an arbitrary function: void someFunc(int, double, char); and I call someFunc(8, 2.4, 'a');, what actually happens? How does 8, 2.4, and 'a' get memory, moved into that memory, and passed into the function? What type of optimizations does the compiler have for situations like these? What if I mix and match parameters, such like someFunc(myIntVar, 2.4, someChar);? What happens if the function is declared as inline?

    Read the article

  • Passing input value thru XML loop and return value

    - by Mike Dyer
    "X" is reading the form value, but it is still passing and older "var thisMarket" value. The objective is to take a zip code via HTML form: <form id="market" name="market" onSubmit="return validateZIP(this.zip.value);" method="get" action=""> <input type="text" name="zip" id="zip" value="zipcode" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" style="float:left; width:100px; margin-top:5px;"> <input type="image" style="float:left; margin-top:5px; border: 0pt none ; width: 22px; height:17px;" src="images/nav/bottom/linkbar/btn_search_btn.gif" onClick="findLda();"> </form> The script being passed thru is: function findLda(x){ marketName = new Array(); marketURL = new Array(); zip = new Array(); zip_temp = new Array(); zipMatch = false; var shareZip = "Shared Zips"; var thisMarket = "Market value"; xmlDoc=loadXML("/_includes/market.xml"); var Offer,node; document.getElementById('market').innerHTML=''; for(var j=0; j<xmlDoc.getElementsByTagName('market').length; j++){ node = xmlDoc.getElementsByTagName('market')[j]; marketName.push(node.childNodes[3].textContent); marketURL.push(node.childNodes[5].textContent); for(var k=0; k<node.getElementsByTagName('zip').length; k++){ if(node.getElementsByTagName('zip')[k].textContent!=null){ zip_temp.push(node.getElementsByTagName('zip')[k].textContent); } } zip.push(zip_temp); zip_temp = new Array(); } //loop the zip Array to find a match for the query Zip. for(k=0; k<zip.length; k++){ for(m=0; m<zip[k].length; m++){ if(x == zip[k][m].toString()){ zipMatch=true; thisMarket=marketName[k].toString(); } } } alert(thisMarket); } The objective naturally is to take field input (A), pass it thru market.xml - initialize a loop and match a zip (B), alert the result (C). Looking for any direction with what is existing or a completely new direction. Thanks!

    Read the article

  • Selecting text between Brackets in an input field with Jquery

    - by Marcel
    Hi, with $("#TextInputElement").select() I am able to select a text (mark it) in an in an input text field. Now I only want to select the text in between brackets in that input field. I have the regular expression match(/-[^-]*-/) to select, but how would I apply this to only select the text inside the input field between brackets? [noselect]textToBeSelected[/noselect] thx

    Read the article

  • Lucene MultiFieldQueryParser which column of the three generated the hit

    - by user549432
    I am using Lucene MultiFieldQueryParser and the implementation is as shown below QueryParser parser = new MultiFieldQueryParser (Version.LUCENE_30,new String[] {"First Name","Middle Name","Last Name"}, standardAnalyzer); Query query = parser.parse(queryString); and using it to find a match for the input string in my DB columns First Name, Middle Name and Last name . I am able to get the hits with normal search and fuzzy search - The only problem I am facing is finding which column of the three generated the hit - Can you pls help me here - Thanks

    Read the article

  • broken UTF-8 String ruby

    - by josh
    While reading a file I get broken UTF-8 String error whenever I have the following in my file través if I change it to normal e then it works. Whats the way to fix this? error only happens if I do line.lstrp or any other function. Just printing the lines is ok. problem even happens when I try to match the string with regex.

    Read the article

  • Haskell Input & Passing Values to Functions

    - by Pradeep
    putStrLn "Enter the Artist Name" art <- getLine putStrLn "Enter the Number of CD's" num <- getLine let test= buyItem currentStockBase art num printListIO (showcurrentList test) the values i have to pass for buyItem is buyItem currentStockBase "Akon" 20 but i want to send "Akon" to art and for 20 i want to send num it gives me this error ERROR file:.\Project2.hs:126 - Type error in application *** Expression : buyItem currentStockBase art num *** Term : num *** Type : [Char] *** Does not match : Int please help me

    Read the article

  • Does this e-mail-regex exclude valid addresses?

    - by neo
    I tried to create a regular expression which catches all RFC-valid addresses but it's ok if some false-positives come through (though hopefully not so many). This is waht I came up so far: /^\b\S+@\S+\.[^\s@]{2,}\b$/ Is there any RFC-valid address which doesn't match against this expression or do you have any suggestions to improve it? I don't mind the false positives but I would be glad if you show me a few, too.

    Read the article

  • Implementation of interface when using child class of a parent class in method of interface

    - by dotnetdev
    I don't have access to my dev environment, but when I write the below: interface IExample void Test (HtmlControl ctrl); class Example : IExample { public void Test (HtmlTextArea area) { } I get an error stating the methods in the class implementation don't match the interface - so this is not possible. HtmlTextArea is a child class of HtmlControl, is there no way this is possible? I tried with .NET 3.5, but .NET 4.0 may be different (I am interested in any solution with either framework). Thanks

    Read the article

  • Multiline Regular Expression search and replace!

    - by Scott
    I've hit a wall. Does anybody know a good text editor that has search and replace like Notepad++ but can also do multi-line regex search and replace? Basically, I am trying to find something that can match a regex like: search oldlog\(.*\n\s+([\r\n.]*)\);replace newlog\(\1\) Any ideas?

    Read the article

  • Find multiple line spanning text and replace using Powershell

    - by MrGrant
    Hello, I am using a regular expression search to match up and replace some text. The text can span multiple lines (may or may not have line breaks). Currently I have this: $regex = "\<\?php eval.*?\>" Get-ChildItem -exclude *.bak | Where-Object {$_.Attributes -ne "Directory"} |ForEach-Object { $text = [string]::Join("`n", (Get-Content $_)) $text -replace $RegEx ,"REPLACED"}

    Read the article

  • Regular Expression Fails

    - by Meander365
    Anyone help? When I run this I get " invalid quantifier ?<=href= " var aHrefMatch = new RegExp("(?<=href\=")[^]+?(?=")"); var matchedLink = mystring.match(aHrefMatch); But I know the regular expression is valid. Any ideas?

    Read the article

  • obj-c, how do I create a property and synthesize an NSUInteger ?

    - by Jules
    I'm having some trouble using an NSUInteger, I've tried various things and googled, but not found the answer ? I have... I also tried ... nonatomic, retain @property (readwrite, assign) NSUInteger *anAmount; @synthesize anAmount; error: type of property 'anAmount' does not match type of ivar 'anAmount' Also when I release it in dealloc I get a warning.. warning: invalid receiver type 'NSUInteger'

    Read the article

  • Displaying Data on the Windows Form

    - by The.Anti.9
    I'm searching files and returning lines that include the search text, and I'm not really sure the best way to display the information I get. Every time I get a match, I want to show, in some sort of control, the File it came from, and the whole text line. (aka streamreader.ReadLine() result). First I tried just putting it all in a read-only text box, but it doesn't have a scroll bar. What is the best form control to help me display this data neatly?

    Read the article

  • Does F# have an equivalent to Haskell's take?

    - by McMuttons
    In Haskell, there is a function "take n list" which returns the first n elements from a list. For example "sum (take 3 xs)" sums up the first three elements in the list xs. Does F# have an equivalent? I expected it to be one of the List-functions, but I can't spot anything that seems to match.

    Read the article

  • What's the logic flaw in this conditional?

    - by Scott B
    I've created this code branch so that if the permalink settings do no match at least one of the OR conditions, I can execute the "do something" branch. However, I believe there is a flaw in the logic, since I've set permalinks to /%postname%.html and it still tries echo's true; I believe I need to change the ORs to AND, right? if (get_option('permalink_structure') !== "/%postname%/" || get_option('my_permalinks') !== "/%postname%/" || get_option('permalink_structure') !== "/%postname%.html" || get_option('my_permalinks') !== "/%postname%.html")) { //do something echo "true"; }

    Read the article

  • JavaScript: add or subtract from number in string

    - by yoavf
    I have a string that looks like "(3) New stuff" where 3 can be any number. I would like to add or subtract to this number. I figured out the following way: var thenumber = string.match((/\d+/)); thenumber++; string = string.replace(/\(\d+\)/ ,'('+ thenumber +')'); Is there a more elegant way to do it?

    Read the article

  • Pass PHP variables without being seen when working with a database generated list

    - by Wilcoholic
    Looking for any help regarding the problem. Here's the deal: I have a database that has a teams table and it contains team_id. On one of my pages, I generate a list of links that contain the team_id of the creator in their get URL. I need the team_id on the next page but can't figure out how to pass it through any other way. Using a form and POST isn't an option because this method would only pass through the last links data on the list. Storing in a session isn't an option either because there is no way to discretely pass the the variables I need to a function to set the session variables. I have tried and it can pretty easily be viewed from viewing the source code. So here's some sample code to see exactly what I'm dealing with. <? if(mysql_num_rows($result2)>0){ ?> <a class="fltrt btn btn-danger btn-small" onclick="test()" href="acceptmatch-exec.php?match_id=<?php echo $match_id; ?>&team_id=<?php echo $team_id;?>&action=cancel">Cancel Match</a> <?}else{?> <a class="fltrt btn btn-success btn-small" href="acceptmatch-exec.php?match_id=<?php echo $match_id; ?>&team_id=<?php echo $team_id;?>&action=accept">Accept Match</a> <?} ?> The code above is generated multiple times on a page via a while loop that was excluded. I want to pass the match_id and team_id variables without being seen anywhere. If I made this a form, it wouldn't pass the correct variables unless there is only one result at the time (not likely). I'm sure there has to be an easy method that is eluding me, so please share thoughts on how to solve this. I feel as though I am not explaining it well enough, but it's not really easy to explain. I basically want something that works like GET but acts like POST and can be hidden from people viewing source code or link locations. Thanks

    Read the article

  • How do I disable auto- poster image generation on the video tag?

    - by ekallevig
    I'm using the 'poster' attribute on a video tag and the way it seems to work at least in webkit browsers is that it loads the poster image and then once enough of the video has loaded, it replaces that poster with an auto-generated poster from the video file itself. However, my poster images don't match the auto-generated posters which results in a weird experience of one image loading, then being replaced in a few seconds by the auto-generated image. Is there any way to prevent the auto-generated image from being used?

    Read the article

  • Rails3 nomethod error #<ActiveRecord::Relation>

    - by Dodi
    Hi! I'm writing a static page controller. I get the menuname in the routes.rb and it's call the static controller show method. match '/:menuname' = 'static#show' And static_controller.rb: @static=Staticpage.where("menuname = ?", params[:menuname]) But if I want print @static.title in the view, I get this error: undefined method `title' for # Whats wrong? the SQL query looks good: SELECT staticpages.* FROM staticpages WHERE (menuname = 'asd')

    Read the article

  • PHP: What's the best way to check equality of $_SERVER['HTTP_REFERER'] ?

    - by Hank
    I have a PHP script that checks the HTTP Referer. if ($_SERVER['HTTP_REFERER'] == 'http://www.example.com/') {...} However, this seems inherintly unsafe ... because what happens if the user goes to 'http://example.com/' or 'http://www.ExaMple.com' (both of which don't match the equality test). Question: what's a better equality test to ensure that the HTTP Referer is coming from 'example.com' ?

    Read the article

< Previous Page | 115 116 117 118 119 120 121 122 123 124 125 126  | Next Page >