Search Results

Search found 19563 results on 783 pages for 'binary search'.

Page 186/783 | < Previous Page | 182 183 184 185 186 187 188 189 190 191 192 193  | Next Page >

  • javascript search and replace prefix zero

    - by Bharanikumar
    Hi , i have few numbers like 0011,0101,0123,1234,5245,0052,3265,0047,0124 How replace prefix zero only, like no number should start with zero , exactly like 0011 should be 11 , 0101 should be 101 , 0123 should be 123 How to do this ? Is ther any javascript function there , Thanks

    Read the article

  • Search pattern in string using regex in obj-c

    - by manileo86
    I'm working on a string pattern match algorithm. I use NSRegularExpression for finding the matches. For ex: I've to find all words starting with '#' in a string.. Currently I use the following regex function: static NSRegularExpression *_searchTagRegularExpression; static inline NSRegularExpression * SearchTagRegularExpression() { if (!_searchTagRegularExpression) { _searchTagRegularExpression = [[NSRegularExpression alloc] initWithPattern:@"(?<!\\w)#([\\w\\._-]+)? options:NSRegularExpressionCaseInsensitive error:nil]; } return _searchTagRegularExpression; } and I use it as below: NSRegularExpression *regexp = SearchTagRegularExpression(); [regexp enumerateMatchesInString:searchString options:0 range:stringRange usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { // comes here for every match with range }]; This works properly. But i just want to know if this is the best way. suggest if there's any better alternative...

    Read the article

  • Matching on search attributes selected by customer on front end

    - by CodeNinja1974
    I have a method in a class that allows me to return results based on a certain set of Customer specified criteria. The method matches what the Customer specifies on the front end with each item in a collection that comes from the database. In cases where the customer does not specify any of the attributes, the ID of the attibute is passed into the method being equal to 0 (The database has an identity on all tables that is seeded at 1 and is incremental). In this case that attribute should be ignored, for example if the Customer does not specify the Location then customerSearchCriteria.LocationID = 0 coming into the method. The matching would then match on the other attributes and return all Locations matching the other attibutes, example below: public IEnumerable<Pet> FindPetsMatchingCustomerCriteria(CustomerPetSearchCriteria customerSearchCriteria) { if(customerSearchCriteria.LocationID == 0) { return repository.GetAllPetsLinkedCriteria() .Where(x => x.TypeID == customerSearchCriteria.TypeID && x.FeedingMethodID == customerSearchCriteria.FeedingMethodID && x.FlyAblityID == customerSearchCriteria.FlyAblityID ) .Select(y => y.Pet); } } The code for when all criteria is specified is shown below: private PetsRepository repository = new PetsRepository(); public IEnumerable<Pet> FindPetsMatchingCustomerCriteria(CustomerPetSearchCriteria customerSearchCriteria) { return repository.GetAllPetsLinkedCriteria() .Where(x => x.TypeID == customerSearchCriteria.TypeID && x.FeedingMethodID == customerSearchCriteria.FeedingMethodID && x.FlyAblityID == customerSearchCriteria.FlyAblityID && x.LocationID == customerSearchCriteria.LocationID ) .Select(y => y.Pet); } I want to avoid having a whole set of if and else statements to cater for each time the Customer does not explicitly select an attribute of the results they are looking for. What is the most succint and efficient way in which I could achieve this?

    Read the article

  • jQuery - search for previous selector relative to current

    - by Thomas Slater
    I have a form with 3 sections in it. Each section has a dedicated div for fairly long contextual help messages regarding the input that has focus. My question is, if I give each of these help divs a class of "form-tip" and each input that has a tip the class "has-tip", how can I get the tip to always show up in the previous "form-tip" div? Something like: $('.has-tip').each(focus(function() { var tip = $(this).attr('title'); // Find most recent $('.form-tip') in the DOM and populate it with tip })); I hope that makes sense... Thanks for any help.

    Read the article

  • How to Search and Navigate XML Nodes

    - by edison681
    I have the following XML : <LOCALCELL_V18 ID = "0x2d100000"> <MXPWR ID = "0x3d1003a0">100</MXPWR> </LOCALCELL_V18> <LOCALCELL_V18 ID = "0x2d140000"> <MXPWR ID = "0x3d1403a0">200</MXPWR> </LOCALCELL_V18> <LOCALCELL_V18 ID = "0x2d180000"> <MXPWR ID = "0x3d1803a0">300</MXPWR> </LOCALCELL_V18> I want to get the inner text of each <MXPWR>. however, it is not allowed to use ID# to locate the inner text since it is not always the same. here is my code: XmlNodeList LocalCell = xmlDocument.GetElementsByTagName("LOCALCELL_V18"); foreach (XmlNode LocalCell_Children in LocalCell) { XmlElement MXPWR = (XmlElement)LocalCell_Children; XmlNodeList MXPWR_List = MXPWR.GetElementsByTagName("MXPWR"); for (int i = 0; i < MXPWR_List.Count; i++) { MaxPwr_form_str = MXPWR_List[i].InnerText; } } Any opinion will be appreciated.

    Read the article

  • Search and Matching algorithm

    - by Tony
    Hello everyone. I am trying to come up with an algorithm to do the following: I have total 12 cells that I need to fill until program stops. I have 3 rows and each row has 4 columns. As an example, let me illustrate this as in airplane. So you have 3 rows and each row has 4 columns and you have window/aisle seats. Each row will have a window seat, aisle seat, aisle seat and window seat (|WA AW| Just like seat arrangement in airplane). At each iteration (different set of passengers), there would be some number of passengers (between 1 and 12) and I need to seat them closest together possible (Seat together). And I do this for next group (each iteration) until program stops (It will stop when I am done with every group). For example, I have 3 passengers (A,B,and C) and A wants to seat in Window, B wants to seat in Aisle and C wants to seat in Window. Assuming that all the seats (all 12) are available, I could place them like |A# BC| or |CB #A| and mark the seats dirty (so I don’t pick same seats again for next passengers). And I do this for next group (iteration). I am not sure if this right forum, but if somebody can advise me how I should accomplish, I would really appreciate it. Thanks.

    Read the article

  • How to search for duplicate values in a huge text file having around Half Million records

    - by Shibu
    I have an input txt file which has data in the form of records (each row is a record and represents more or less like a DB table) and I need to find for duplicate values. For example: Rec1: ACCOUNT_NBR_1*NAME_1*VALUE_1 Rec2: ACCOUNT_NBR_2*NAME_2*VALUE_2 Rec3: ACCOUNT_NBR_1*NAME_3*VALUE_3 In the above set, the Rec1 and Rec2 are considered to be duplicates as the ACCOUNT NUMBERS are same(ACCOUNT_NBR1). Note: The input file shown above is a delimiter type file (the delimiter being *) however the file type can also be a fixed length file where each column starts and ends with a specified positions. I am currently doing this with the following logic: Loop thru each ACCOUNT NUMBER Loop thru each line of the txt file and record and check if this is repeated. If repeated record the same in a hashtable. End End And I am using 'Pattern' & 'BufferedReader' java API's to perform the above task. But since it is taking a long time, I would like to know a better way of handling it. Thanks, Shibu

    Read the article

  • PDF search on the iPhone

    - by pt2ph8
    After two days trying to read annotations from a PDF using Quartz, I've managed to do it and posted my code. Now I'd like to do the same for another frequently asked question: searching PDF documents with Quartz. Same situation as before, this question has been asked many times with almost no practical answers. So I need some pointers first, as I still haven't implemented this myself. What I tried: I tried using CGPDFScannerScan handling the TJ and Tj operators - returns the right text on some PDF, whereas on other documents it returns mostly random letters. Maybe it's related to text encoding? Someone pointed out that text blocks (marked by BT/ET operators) should be handled instead, but I still haven't managed to do so. Anyone managed to extract text from any PDF? After that, searching should be easy by storing all the text in a NSMutableString and using rangeOfString (if there's a better way please let me know). But then how to highlight the result? I know there are a few operators to find the glyph sizes, so I could calculate the resulting rect based on those values, but I've been reading the spec for hours... it's a bloated mess and I'm going insane. Anyone with a practical explanation? Thanks.

    Read the article

  • mysql_real_escape_string and search data in mySql DB

    - by ryrysz
    I have problem with php function : mysql_real_escape_string My test string: @,&!#$%^*()_+' "\/ I add this data to mySql database, like that (in short): $str = mysql_real_escape_string($str); $sql = "INSERT INTO table(company) VALUES('".$str. "')"; In DB is stored as: @,&!#$%^*()_+\' \"\\/ But problem is with find this data by SELECT statement. I want find, company where name is like ' " My SELECT's: SELECT company FROM table WHERE company LIKE '%\' "%'; SELECT company FROM table WHERE company LIKE '%\\' \\"%'; ; not working. This works: SELECT `company` FROM `table` WHERE `company` LIKE '%\\\' \\\\"%'; and SELECT `company` FROM `table` WHERE `company` LIKE '%\\\\\\\' \\\\\\\"%' But I dont know why this work :(. My questions are: why must add so many slashes ? how I can make correct query in PHP: $query = '\' "'; '%'.mysql_real_escape_string($query).'%' result is : '%\' \"%' '%'.mysql_real_escape_string(mysql_real_escape_string($query)).'%' result is : '%\\\' \\\"%' '%'.mysql_real_escape_string(mysql_real_escape_string(mysql_real_escape_string($query))).'%' result is : '%\\\\\\\' \\\\\\\"%' Only last one works good.

    Read the article

  • Search by Letters using LINQ

    - by Biswo
    hi i m using Linq & C# and i want to filter my data as this syntax in Sql Syntax in sql is I hav one table name Customer in which name is field 'Select name from customer where name like 'C%'' can u help to solve this code in Linq

    Read the article

  • Inserting new argument to table through search form of another table

    - by owca
    In my database I have a form for searching products (fields : id, name, manufacturer_id[set to display manufacturer's name], category_id, price). I would like to have the ability of adding manufacturers through this form. So I've created vba script but it does not work. Still when I enter new name it gives me prompt to "Select element from the list". What am I doing wrong ? Private Sub manufacturer_id_NotInTheList(NewData As String, Response As Integer) Dim strSQL As String, strInfo As String strInfo = "Manufacturer " & NewData & " is not on the list." & vbCrLf & "Add?" If MsgBox(strInfo, vbYesNo + vbQuestion, "Element not on the list") = vbYes Then strSQL = "INSERT INTO manufacturer (name, country, id_distributor) VALUES ('" & NewData & "','Undefined', '0');" DoCmd.SetWarnings (False) DoCmd.RunSQL strSQL Response = acDataErrAdded Else Response = acDataErrContinue NewData = "" Me.manufacturer_id.Text = "" End If End Sub

    Read the article

  • Flex - Search in ArrayCollection by part of the word

    - by Sergei
    For example i have an ArrayCollection, and i want to find person with telephone begines with "944" how can i do this? <mx:ArrayCollection id="arrColl" > <mx:source> <mx:Array> <mx:Object telephone="944768" subscriber="Smith P.T."/> <mx:Object telephone="944999" subscriber="Peterson Q.T."/> </mx:Array> </mx:source> </mx:ArrayCollection>

    Read the article

  • ASP.NET MVC and Paging - Search & Result Scenario

    - by devforall
    I have forms in my page a get and a post and i want add pager on my get form .. so i cant page through the results.. The problem that i am having is when i move to the second page it does not display anything.. I am using this library for paging .. http://stephenwalther.com/Blog/archive/2008/09/18/asp-net-mvc-tip-44-create-a-pager-html-helper.aspx this my actions code. [AcceptVerbs("GET")] public ActionResult SearchByAttraction() { return View(); } [AcceptVerbs("POST")] public ActionResult SearchByAttraction(int? id, FormCollection form) {.... } and this is what i am using on my get form to page through <%= Html.Pager(ViewData.Model)% //but when i do this it goes to this method [AcceptVerbs("GET")] public ActionResult SearchByAttraction() instead of going to this this [AcceptVerbs("POST")] public ActionResult SearchByAttraction(int? id, FormCollection form) which sort of makes sence .. but i cant really think of any other way of doing this Any help would be very appreciated.. Thanx

    Read the article

  • Different search paths for tclsh

    - by user364128
    Hi: Any one knows how can I invoke the tclsh in the TCL code due to different paths to tclsh in various platforms (Linux, SUN) ? For example in SUN: !/usr/bin/sun/tclsh in Linux: !/usr/bin/linux/tclsh How can I use the same TCL code and execute it in the above two paths ?

    Read the article

  • Search for nodes by name in XmlDocument

    - by RajenK
    I'm trying to find a node by name in an XmlDocument with the following code: private XmlNode FindNode(XmlNodeList list, string nodeName) { if (list.Count > 0) { foreach (XmlNode node in list) { if (node.Name.Equals(nodeName)) return node; if (node.HasChildNodes) FindNode(node.ChildNodes, nodeName); } } return null; } I call the function with: FindNode(xmlDocument.ChildNodes, "somestring"); For some reason it always returns null and I'm not really sure why. Can someone help me out with this?

    Read the article

  • Recursive search Linq to xml

    - by Raj Esh
    this is my sample xml. <Messages> <Conversation> <id>Z100</id> <ReplyToId></ReplyToId> <Message>Topic</Message> </Conversation> <Conversation> <id>A100</id> <ReplyToId></ReplyToId> <Message>This is a test</Message> </Conversation> <Conversation> <id>M100</id> <ReplyToId>A100</ReplyToId> <Message>What kind of test</Message> </Conversation> <Conversation> <id>A200</id> <ReplyToId>M100</ReplyToId> <Message>Stage 1</Message> </Conversation> <Conversation> <id>M200</id> <ReplyToId>A200</ReplyToId> <Message>Test result for </Message> </Conversation> </Messages> How to get the conversation list based on id using linq in C#. Say for example, If i want to get the conversation for id "A100" which has a link to other conversation based on ReplyToid.

    Read the article

  • Store latitudes and longitudes in database for proximity/radius search using Google Maps API, .NET a

    - by poojad
    What is the approach for storing the latitudes and longitudes for multiple addresses as a one time set up. I need to find the nearby stores using Google Maps and I have to get the latitudes and longitudes of all the available stores. As the data is huge and may increase or change in future, can anyone suggest an approach taking performance and maintenance into consideration. Thank you.

    Read the article

  • SQL Query wildcard search

    - by gabrielVa
    Hi everyone, Im writing a C# web page thats tied to a listview. My lcient would like to eb able to type in something or part of something that it would show results. For example he wants a textbox where he may put in a phone number, part of a phone number, a name, city or whatever and there would be a SP of sorts that finds then lists the info. How can I accompish this in either a SQL Sp or within VS 2010?

    Read the article

  • Using search to solve problems

    - by dan
    am trying to write a 4 x 4 grid using vertical bars and underscore. I have a class for the puzzle, but i want to know what fields and methods i can use to represent and manipulate a configuration for the puzzle

    Read the article

  • Mysql search design

    - by neil
    I'm designing a mysql database, and i'd like some input on an efficient way to store blog/article data for searching. Right now, I've made a separate column that stores the content to be searched - no duplicate words, no words shorter than four letters, and no words that are too common. So, essentially, it's a list of keywords from the original article. Also searched would be a list of tags, and the title field. I'm not quite sure how mysql indexes fulltext columns, so would storing the data like that be ineffective, or redundant somehow? A lot of the articles are on the same topic, so would the score be hurt by so many of the rows having similar keywords? Also, for this project, solutions like sphinx, lucene or google custom seach can't be used -- only php & mysql. Thanks!

    Read the article

  • Search for a string between two known strings

    - by Flocked
    Hello, I have a String with this content: href="http://www.website.com/" /> [...] [...] I just want to get the central part of the string. How is it possible to get the part between @"href="" and @"" /" Note: Even if it looks like xml-code, it is inside of a NSString.

    Read the article

  • How to search and replace an unprintable character

    - by krzyk
    I've a file that was exported from Word and it replaced all quotes with strange unicode characters which aren't correctly displayed in vim. So now I want those characters to be replaced with quotes, but I don't know how to enter this character in :%s/???/'/g The characters look like this: ~U ~R. But of course I can't just mark them with mouse and paste in the command.

    Read the article

< Previous Page | 182 183 184 185 186 187 188 189 190 191 192 193  | Next Page >