Search Results

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

Page 31/783 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • how to make an ajax search

    - by amir
    I'm trying to make an ajax search for a website, HTML : <form id="search" method="post" action="search.php"> <input type="text" name="search" /> <input type="image" name="submit" alt="search" src="images/buttons/search.gif" /> </form> $(function() { var search_text = ''; $('form#search input[name=submit]').click(function() { search_text = $('form#search input[name=search]').val(); $.get('../search.php',{ s: search_text }); return false; }); }); in the search.php file I have the following <?php $search = $_GET['s']; if (isset($_POST['submit_x'])) { $search = $_POST['search']; $search = str_replace(' ','',$search); $search = strtolower($search); if($search == 'kingbabychosenheart' || $search == 'chosenheart' || $search == 'beltchosenheart') { echo "<meta http-equiv='refresh' content='0;url=chosen_heart.php'>"; } else { echo "<meta http-equiv='refresh' content='0;url=not_found.php'>"; } } ?> but this doesn't work, what else do I have to do to make this work? thanks

    Read the article

  • Search string in file (C)

    - by chutsu
    So my code isn't working... test.c:27: warning: passing argument 1 of ‘search’ from incompatible pointer type which is the fgets line. My code opens a file, reads the file line by line, and I'm trying to create a "search" function that will return a value that indicates whether that string is found on that line of the file. My ultimate goal is to achieve a search and replace program. But one step at a time eh? this is what I have so far: #include <stdio.h> #include <string.h> int search(const char *content[], const char *search_term) { int t; for(t=0; content[t]; ++t){ if(!strcmp(content[t], search_term)){ return t; // found } } return 0; // not found } int main(int argc, char *argv[]) { FILE *file; char line[BUFSIZ]; int linenumber=0; char term[20] = "hello world"; file = fopen(argv[1], "r"); if(file != NULL){ while(fgets(line, sizeof(line), file)){ if(search(line, term) != -1){ printf("Search Term Found!!\n"); } ++linenumber; } } else{ perror(argv[1]); } fclose(file); return 0; }

    Read the article

  • Get context for search string in text in C#

    - by soundslike
    Given a string text which contains newline there is a search keyword which matches an item within the text. How do I implement the following in C#: searchIdx = search index (starting with 0, then 1, etc. for each successive call to GetSearchContext. Initially start with 0. contextsTxt = string data to search in searchTxt = keyword to search for in contextsTxt numLines = number of lines to return surrounding the searchTxt found (ie. 1 = the line the searchTxt is found on, 2 = the line the searchTxt is found on, 3 = the line above the searchTxt is found on, the line the searchTxt is found on, and the line below the searchTxt is found on) returns the "context" based on the parameters string GetSearchContext(int searchIdx, string contentsTxt, string searchTxt, int numLines); If there's a better function interface to accomplish this feel free to suggest that as well. I tried the following but doesn't seem to work properly all the time: private string GetSearchContext(string contentValue, string search, int numLines) { int searchIdx = contentValue.IndexOf(search); int startIdx = 0; int lastIdx = 0; while (startIdx != -1 && (startIdx = contentValue.IndexOf('\n', startIdx+1)) < searchIdx) { lastIdx = startIdx; } startIdx = lastIdx; if (startIdx < 0) startIdx = 0; int endIdx = searchIdx; int lineCnt = 0; while (endIdx != -1 && lineCnt++ < numLines) { endIdx = contentValue.IndexOf('\n', endIdx + 1); } if (endIdx == -1 || endIdx > contentValue.Length - 1) endIdx = contentValue.Length - 1; string lines = contentValue.Substring(startIdx, endIdx - startIdx + 1); if (lines[0] == '\n') lines = lines.Substring(1); if (lines[lines.Length - 1] == '\n') { lines = lines.Substring(0, lines.Length - 1); } if (lines[lines.Length - 1] == '\r') { lines = lines.Substring(0, lines.Length - 1); } return lines; }

    Read the article

  • Will a search engine lower the rank of my page if i have hidden iframes?

    - by Skurpi
    As a praxis, all external content on our site is put in iframes to lower the risks of any external parties injecting stuff to our users. We also do it to make sure our content shows up before banners, to make the site feel quicker. We now have an external script running which we want to put in an iframe, but it does not have any visible content to go with it so I want to put css "visibility: hidden;" on the iframe. I read in a forum somewhere that search engines will lower the rank of a page, or even drop the page, if a iframe has "the minimal size of 1x1px". Will a search engine lower the rank of my page if I have a hidden (or 1px big) iframe?

    Read the article

  • Serialize a C# class to binary be used by C++. How to handle alignment?

    - by glenn.danthi
    I am currently serializing a C# class into a binary stream using BinaryWriter. I take each element of the class and write it out using BinaryWriter. This worked fine as the C++ application reading this binary file supported packed structs and hence the binary file could be loaded directly. Now I have got a request to handle alignment as a new application has popped up which cannot support packed structs. What's the best way to convert the C# class and exporting it out as a binary keeping both 2 byte as well as 4 byte alignment in mind? The user can choose the alignment.

    Read the article

  • Detecting if a file is binary or plain text?

    - by dr. evil
    How can I detect if a file is binary or a plain text? Basically my .NET app is processing batch files and extracting data however I don't want to process binary files. As a solution I'm thinking about analysing first X bytes of the file and if there are more unprintable characters than printable characters it should be binary. Is this the right way to do it? Is there nay better implementation for this task?

    Read the article

  • Will a search engine lower the rank of my page if i have a hidden iframes?

    - by Skurpi
    As a praxis, all external content on our site is put in iframes to lower the risks of any external parties injecting stuff to our users. We also do it to make sure our content shows up before banners, to make the site feel quicker. We now have an external script running which we want to put in an iframe, but it does not have any visible content to go with it so I want to put css "visibility: hidden;" on the iframe. I read in a forum somewhere that search engines will lower the rank of a page, or even drop the page, if a iframe has "the minimal size of 1x1px". Will a search engine lower the rank of my page if I have a hidden (or 1px big) iframe?

    Read the article

  • How long before Google will update search terms matching my website?

    - by Camran
    I have a website which title I changed about a month ago. The website is a classifieds website which is dynamic, using php. The title changed from "Free classifieds" to "buy and sell free classifieds". The strange part is that after about two weeks the title showed in google search results changed to the new title, BUT when I searched for "buy and sell free classifieds" my website didn't show up at all. I mean I have gone through over 30 pages of search results and my site isn't listed. However, searching for "free classifieds" still display my website at the same position it was before the title change. Any reason for this? How patient should I be? FYI the website has a sitemap submitted and updated, good meta tags and is W3 valid etc etc, so that is not the problem here. Thanks

    Read the article

  • SharePoint 2007 no results in search

    - by Shax
    I'm using sharepoint server 2007 SP2 SQL2000 SP4. When I perform search I get no results. In the past I used hot fix http://support.microsoft.com/kb/941422 which resolved this issue but I can't use it now after upgrading to SP2. Any ideas how to fix it? Thanks

    Read the article

  • Integrating jQuery autocomplete with Google site search

    - by user1715700
    I have a bit of an odd situation. I have to implement search on a public facing website -but, that search must be able to search both web pages and have an autocomplete/suggestion functionality that comes from a list of terms that are in a DB table. So, I'm wondering a couple things: 1) should I be looking at Google search and jQuery autocomplete? 2) is there something else I should be looking at instead? 3) if this is the right path to be heading down are the enough pointers on implementation? The crux of my problem is that the terms that I need to use for the autocomplete/suggest functionality reside within a database and not on the webpages. So, I thought Google would be appropriate for search the webpages and that I could sort of fill in the blanks so to speak with these terms from the DB. I'm going to say that there are roughly 20-40,000 terms or so that need autocomplete. But that is really just a very rough guess -it could be less. I'm open to ideas and not really married to any particular solution. However, I will admit to liking the ideas of offloading the search to Google. I hear they have a good algorithm ;) Any ideas, thoughts, or leads are greatly appreciated!

    Read the article

  • What's a good algorithm for searching arrays N and M, in order to find elements in N that also exist

    - by GenTiradentes
    I have two arrays, N and M. they are both arbitrarily sized, though N is usually smaller than M. I want to find out what elements in N also exist in M, in the fastest way possible. To give you an example of one possible instance of the program, N is an array 12 units in size, and M is an array 1,000 units in size. I want to find which elements in N also exist in M. (There may not be any matches.) The more parallel the solution, the better. I used to use a hash map for this, but it's not quite as efficient as I'd like it to be. Typing this out, I just thought of running a binary search of M on sizeof(N) independent threads. (Using CUDA) I'll see how this works, though other suggestions are welcome.

    Read the article

  • displaying search results of more than one word

    - by fusion
    in my search form, if the user types 'good', it displays all the results which contain the keyword 'good'. however if the user types in 'good sweetest', it displays no results because there is no record with the two words appearing together; BUT appearing in an entry at different places. for example, the record says: A good action is an ever-remaining store and a pure yield the user types in 'good', it will show up this record, but if the user types in 'good' + 'pure', it will not show anything. or if the record contains the keyword 'good-deeds' and if the user types in 'good deeds' without the hyphen, it will not show anything. what i would like is that if the user types in 'good' + 'pure' or 'good deeds' it should records containing these keywords highlighting them. search.php code: $search_result = ""; $search_result = $_POST["q"]; $search_result = trim($search_result); //Check if the string is empty if ($search_result == "") { echo "<p class='error'>Search Error. Please Enter Your Search Query.</p>" ; exit(); } if ($search_result == "%" || $search_result == "_" || $search_result == "+" ) { echo "<p class='error1'>Search Error. Please Enter a Valid Search Query.</p>" ; exit(); } $result = mysql_query('SELECT cQuotes, vAuthor, cArabic, vReference FROM thquotes WHERE cQuotes LIKE "%' . mysql_real_escape_string($search_result) .'%" ORDER BY idQuotes DESC', $conn) or die ('Error: '.mysql_error()); function h($s) { echo htmlspecialchars($s, ENT_QUOTES); } function highlightWords($string, $word) { $string = preg_replace("/".preg_quote($word, "/")."/i", "<span class='highlight'>$0</span>", $string); /*** return the highlighted string ***/ return $string; } ?> <div class="caption">Search Results</div> <div class="center_div"> <table> <?php while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) { $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result); ?> <tr> <td style="text-align:right; font-size:18px;"><?php h($row['cArabic']); ?></td> <td style="font-size:16px;"><?php echo $cQuote; ?></td> <td style="font-size:12px;"><?php h($row['vAuthor']); ?></td> <td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']); ?></td> </tr> <?php } ?> </table> </div> search.html: <form name="myform" class="wrapper"> <input type="text" name="q" onkeyup="showUser()" class="txt_search"/> <input type="button" name="button" onclick="showUser()" class="button"/> <p> <div id="txtHint"></div> </form>

    Read the article

  • load search results into a div that toggles with other divs

    - by Z. Edwards
    I am working with a page that has multiple divs that toggle. This function works. A search function was added and this works too. The problem with the page as it exists currently: The search bar was placed on the "default" div and the results load below the bar into another div that is invisible when empty. The results div is inside this first default div. If you toggle to another div, you lose the default div and can't get back to it. For this reason, I moved the search bar to the left navigation where the other toggle links are situated. I also moved the search results div out of the default div to "stand on its own." What I am trying to do: Make the search button show the div with the results as well as find the results. Basically, to integrate the search function into the array/toggle function. The search function is in one .js file and the toggle function is in a different .js file. I keep thinking there must be a way to get "onclick" to call from both .js files so that I don't have to do a bunch of extra work combining the two functions that already exist and work separately. I am a Javascript newbie learning by examples and haven't been able to figure this out. I have never seen a working example of this and my searches haven't produced one. I would be very grateful for any help. Hope I explained the problem adequately. Edit: Here is the code I already have for the toggle function. var ids=new Array('a','b','c',[and so on--search results not added here yet]); function switchid(id_array){ hideallids(); for( var i=0, limit=id_array.length; i < limit; ++i) showdiv(id_array[i]); } function hideallids(){ for (var i=0;i<ids.length;i++){ hidediv(ids[i]); } } function hidediv(id) { //safe function to hide an element with a specified id if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'none'; } else { if (document.layers) { // Netscape 4 document.id.display = 'none'; } else { // IE 4 document.all.id.style.display = 'none'; } } } function showdiv(id) {//safe function to show an element with a specified id if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'block'; } else { if (document.layers) { // Netscape 4 document.id.display = 'block'; } else { // IE 4 document.all.id.style.display = 'block'; } } } function initialize(){ var t = gup("target"); if( t ) { switchid([t]); } } function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ){ return ""; } else { return results[1]; } } Thanks in advance!

    Read the article

  • displaying search results with two or more queries

    - by fusion
    in my search form, if the user types 'good', it displays all the results which contain the keyword 'good'. however if the user types in 'good sweetest', it displays no results because there is no record with the two words appearing together; BUT appearing in an entry at different places. for example, the record says: A good action is an ever-remaining store and a pure yield the user types in 'good', it will show up this record, but if the user types in 'good' + 'pure', it will not show anything. what i would like is that if the user types in 'good' + 'pure' it should records containing these keywords highlighting them. search.php code: $search_result = ""; $search_result = $_POST["q"]; $search_result = trim($search_result); //Check if the string is empty if ($search_result == "") { echo "<p class='error'>Search Error. Please Enter Your Search Query.</p>" ; exit(); } if ($search_result == "%" || $search_result == "_" || $search_result == "+" ) { echo "<p class='error1'>Search Error. Please Enter a Valid Search Query.</p>" ; exit(); } $result = mysql_query('SELECT cQuotes, vAuthor, cArabic, vReference FROM thquotes WHERE cQuotes LIKE "%' . mysql_real_escape_string($search_result) .'%" ORDER BY idQuotes DESC', $conn) or die ('Error: '.mysql_error()); function h($s) { echo htmlspecialchars($s, ENT_QUOTES); } function highlightWords($string, $word) { $string = preg_replace("/".preg_quote($word, "/")."/i", "<span class='highlight'>$0</span>", $string); /*** return the highlighted string ***/ return $string; } ?> <div class="caption">Search Results</div> <div class="center_div"> <table> <?php while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) { $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result); ?> <tr> <td style="text-align:right; font-size:18px;"><?php h($row['cArabic']); ?></td> <td style="font-size:16px;"><?php echo $cQuote; ?></td> <td style="font-size:12px;"><?php h($row['vAuthor']); ?></td> <td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']); ?></td> </tr> <?php } ?> </table> </div> search.html: <form name="myform" class="wrapper"> <input type="text" name="q" onkeyup="showUser()" class="txt_search"/> <input type="button" name="button" onclick="showUser()" class="button"/> <p> <div id="txtHint"></div> </form>

    Read the article

  • Why doesn't Outlook 2007 return the same results as Windows 7 search?

    - by TerryT
    When I attempt to search for an email, if I search for the email using the search toolbar within Outlook 2007, no results are found. However, if I use the Windows 7 built-in search functionality found when you click the Start button, using the same search criteria as I did in Outlook, Windows 7 finds the email immediately. Question: how can I make Outlook 2007 find the email(s) I'm searching for that Windows 7 finds that Outlook doesn't?

    Read the article

  • Move Emails Easily Using Search - Outlook 2011 Feature on the MAC for Outlook 2010 Windows

    - by Arthor
    My main email client is Outlook 2010 for Windows 7. I also have a Mac but I do not use it that much however on the MAC you have Outlook 2011. In my Outlook 2010 for Windows 7, I have many many folders. There is one feature I would like to know if it is available or something similar which is on Outlook 2011 for the Mac. On the Outlook 2011 for the mac you can go to: Top Menu Message Move Choose Folder or press (SHIT+CMD "press" M) This bring up a box where you can just type the beginning part of the folder and all the folders with that beginning appears (To search), you select the one you want and the selected emails move to that folder. I hope I have explained it well. Does anyone know if there is a plugin on Outlook 2010 or may I have just missed the function. Thank you

    Read the article

  • How to disable "Automatically search for drivers and install" in Windows 7

    - by raegadfsgfsdg
    I connected my TI-89 to my Windows 7 system, and apparently it is not plug-and-play. There was a link to a Windows configuration setting made available that gave the option to automatically search their windows site for drivers and automatically install them each time i connect an unrecognized device. Well, I selected that link with the intention of it being temporary and just that one time. That didnt work and the location/install of a driver was not successful. How can I reset that setting to not automatically install whatever drivers it thinks might be fitting? I cannot find that configuration setting when I looked for it recently.

    Read the article

  • SharePoint Server Search Not Crawling

    - by tekiegreg
    Hi there, we recently moved some sites into a new farm, everything seems to be doing fine, but the search for reasons I can't identify are not crawling the migrated content. We're getting this message in our crawl log for every document: http://xxx/sites/...announcements The object was not found. (The item was deleted because it was either not found or the crawler was denied access to it.) Of course the first thing I suspected was the crawler access account, so I logged into SharePoint with the account and was able to access via that URL just fine. I tried upping permissions (even all the way up to Admin) but to no avail. Thoughts?

    Read the article

  • search nfs network volume from mac client

    - by user1440190
    Asked: how does a Mac OSX SL or Lion user search the cluster for a particular file (foo.txt) "From the cluster, you would need to run some form of recursive lookup for the file desired. As an example, using 'find'. RAM-1# find /ifs |grep test.txt /ifs/Elements/avid2test.txt /ifs/Elements/test.txt I would suggest contacting Apple support regarding their recommendation for searching for files on remote file systems from the Mac client itself" OK that's great, but I don't want users using CLI !!! Anyone know a good method (non-CLI)? Spotlight is not an option. BTW cluster is roughly 80TB

    Read the article

  • Highly robust and scalable search server needed for managing and analyze files

    - by ChrisBenyamin
    Hi everybody, I am looking for a professional search server system with functionality, like e.g. solr http://lucene.apache.org/solr/ holds. Place of action should be a centralized location, whereon many hosts would request data. Furthermore the system should be extensible for implementing statistical procedures. (e.g. a kind of heatmap (or common diagrams) of a (or more) file(s) (which has a guid), that is spread on different hosts.) This software doesn't have to be opensource. thanks. chris

    Read the article

  • Firefox location bar search: odd behaviour with Comodo firewall

    - by JNat
    I recently installed Comodo firewall, and it changed the behaviour of my Firefox location bar. I used to type something there and it either redirected me to a google search page or it actually redirected me to the site I wanted at once: If I typed 'imdb cloud atlas' it would redirect me to IMDB's page on Cloud Atlas, and the same would happen if I typed 'wiki' or 'wikipedia', redirecting me to Wikipedia's page on it. Now, it redirects me here. I checked this page and everything is according to what they describe, yet it doesn't seem to act the way it should. And there are no Comodo add-ons or extensions installed on Firefox. Can anyone help me?

    Read the article

  • Search Files (Preferably with index) on Windows 2000 Server

    - by ThinkBohemian
    I have many files on a windows server 2000 machine that is setup to act as a networked disk drive, is there anyway I can index the files and make that index available as a search to more people than just me? Bonus if the index can look inside of documents such as readme.txt? If there is no easy way to do this globaly (for all users) Is there a way I could generate and store an index locally on my computer? If this is the wrong place to ask this question, any advice on community more suited?

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >