Search Results

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

Page 135/783 | < Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >

  • Searching in graphs trees with Depth/Breadth first/A* algorithms

    - by devoured elysium
    I have a couple of questions about searching in graphs/trees: Let's assume I have an empty chess board and I want to move a pawn around from point A to B. A. When using depth first search or breadth first search must we use open and closed lists ? This is, a list that has all the elements to check, and other with all other elements that were already checked? Is it even possible to do it without having those lists? What about A*, does it need it? B. When using lists, after having found a solution, how can you get the sequence of states from A to B? I assume when you have items in the open and closed list, instead of just having the (x, y) states, you have an "extended state" formed with (x, y, parent_of_this_node) ? C. State A has 4 possible moves (right, left, up, down). If I do as first move left, should I let it in the next state come back to the original state? This, is, do the "right" move? If not, must I transverse the search tree every time to check which states I've been to? D. When I see a state in the tree where I've already been, should I just ignore it, as I know it's a dead end? I guess to do this I'd have to always keep the list of visited states, right? E. Is there any difference between search trees and graphs? Are they just different ways to look at the same thing?

    Read the article

  • Custom search engine in asp.net mvc and entity framework

    - by Rahat
    Hi, does anyone have any idea how I can get started building a search engine for my asp.net mvc site using entity framework. I plan to build something like: http://www.carsguide.com.au/search/?N=4294962119++492&type=cars there on the left there is a refine search option panel. What's the best approach to design a model for the UI and optimized query with entity framework.

    Read the article

  • search algorithm using sentinel

    - by davit-datuashvili
    i am trying to do search algorithm using sentinel which reduce time to 3.87n nanoseconds for example compare to this code int search (int t ){ for (int i=0;i<n;i++) if (x[i]==t) return i; return -1; } it takes 4.06 nanoseconds so i am trying to optimize it here is code public class Search{ public static int search(int a[],int t){ int i; int p=0; int n=a.length; int hold; hold=a[n-1]; a[n-1]=t; for ( i=0;;i++) if (a[i]==t) break; a[n-1]=t; if (i==n){ p= -1; } else{ p= i; } return p; } public static void main(String[]args){ int t=-1; int a[]=new int[]{4,5,2,6,8,7,9}; System.out.println(search(a,t)); } } but is show me that 9 is at position 6 which is correct but if t =1 or something else which is not array it show me position 6 too please help

    Read the article

  • kooaba API image search

    - by priyanka
    Hi all, i am new in iPhone try to search image using kooaba API but i am not getting proper response i need URL of image which user try to search. but i am not getting URL of image. following is my response xml 58199oljm27fr8ro02kbm7occ http://search.kooaba.com/q/58199oljm27fr8ro02kbm7occ Short Cut to Hollywood but i need data in tage please help me, with regards

    Read the article

  • Search field using Ultraseek

    - by tony noriega
    So i realized today that using IE to do a search on my site, for instance the term "documents" returns the search results. if i use FireFox or Chrome the data in the input field is not recognized... now i looked at the code, and realized that there are no tags around the input fields... BUT if i put them, then IE does not work... what the heck do i do? <div class="searchbox" id="searchbox"> <script type="text/ecmascript"> function RunSearch() { window.location = "http://searcher.example.com:8765/query.html?ql=&amp;col=web1&amp;qt=" + document.getElementById("search").value; } </script> <div class="formSrchr"> <input type="text" size="20" name="qt" id="search" /> <input type="hidden" name="qlOld" id="qlOld" value="" /> <input type="hidden" name="colOld" id="colOld value="web1" /> <input type="image" name="imageField" src="/_images/search-mag.gif" width="20" height="20" onclick="RunSearch();" /> </div> </div> <!-- /searchbox -->

    Read the article

  • Where can I find an updated Google filter Greasmonkey script?

    - by MBraedley
    Recently, Google updated their search results page. Unfortunately, this broke pretty much every Greasemonkey script used on the results page, including the very useful filter scripts. I use these scripts at work when I encounter a coding problem that (for some reason) hasn't been answered at StackOverflow, and don't want to see sites like experts-exchange. Has anyone found a new script or updated their own to work with Google's new results page?

    Read the article

  • ruby on rails ferret search:.only 10 records are getting from table

    - by jissy
    ruby on rails ferret search:.only 10 records are getting from table.For pagination i did it ,but only 10 records are getting even though there exists more records satisfying the search condition.if any of you know how to solve this,please reply. no limit is givenf it is not a ferret search all records are getting from table , and pagination is working the code is: @search_sd_ticket_result=ServiceDeskTicket.find_with_ferret(params[:sd_ticket][:servicedeskticket]).paginate :per_page =5, :page=params[:page]

    Read the article

  • MySQL search a text from two columns

    - by I Like PHP
    i have a table (tbl_world) which look like this id | first_name | last_name | age | class | now i want to search the text which can be anywhere in first_name or in last_name i m using below mysql query "SELECT * FROM tbl_world WHERE REGEXP '".$word."' IN( first_name, last_name)"; where $word is user input (means if i search 'hell' then 'hello' as well as 'wellhell' also returned in result) above query display error, please suggest me optimize method for search in mysql. addition question: should i use LIKR or RLIKE?

    Read the article

  • Use different Solr Similarity algo for every search

    - by snickernet
    Hi Guys, Is possible in Solr 1.4 to specify which similarity class to use for every search within a single index? Let's say, I got 2 type of search (keyword and brand). For keyword search, I want to use the DefaultSimilarity class. But, for brand search, I want to use my CustomSimilarity class. I've been modifying the schema.xml to specify a single similarity class to use. But, I came to this requirement that I have to use 2 different similarity classes. I'll be glad to here your thoughts on this. Thanks in advance.

    Read the article

  • htaccess; /search/?q=test to /test

    - by Matthew Haworth
    I have a similar situation to the one described in the title. All that I need to do is map all requests in the form /search/?q=test to /test. This is because we are changing the way our search works to make it user friendly, but still want to allow for backward compatability (i.e. anyone that may have these links bookmarked etc). However, thus far I have this: RedirectMatch 301 /search/?q=(.*) /$1 And that doesn't work, but: RedirectMatch 301 /search/(.*) /$1 does... Any idea why? Cheers.

    Read the article

  • Cakephp: Extend search capability to hasMany Relationship

    - by Chris
    I have two models: Car hasMany Passengers Passenger belongsTo Car I want to implement a search using Cake Search. The user should input a number and the searchengine should return all cars that have less than this number passengers. In my search form: echo $form->input('passengers', array('label' => 'Passengers', 'div' => false)); In my Car model: public $filterArgs = array( array('name' => 'passengers', 'type' => 'int'), ); In the controller: public $presetVars = array( array('field' => 'passengers', 'type' => 'int') } I thought of adding a function to the model that returns the number of passengers: function countPassengers(){ return(count($this->Car->Passenger)); //Not sure if this works } And how to I implement this search criteria?: return all Cars where countPassengers()<passenger

    Read the article

  • T-SQL stored procedure to return google style "suggested" search results

    - by stephen776
    Ok, using SQL Server 2008. On my web page I have a textbox with jQuery-UI AutoComplete hooked up. Now I need a stored procedure to search across all columns of a single table(or multiple joined tables I suppose) for a search string coming from the textbox/autocomplete AJAX call, and return "suggested" search strings. I am using the AdventureWorks db for testing(Products table) So for example, the product table has columns for product name and product number(among others) and I want to return suggested search strings based on user input where they may enter a product name and/or a product number. I have it working across a single column which was simple. Any ideas?

    Read the article

  • ferret,multiple model search -undefined method `aaf_index' for #<Class:>

    - by jissy
    ferret,multiple model search - I have 2 models A and B.I want to perform a text search by using 3 fields; title, description(part of A) and comment(part of B). Where I want to include the comment field to perform the ferret search.Then,what other changes needed. class A < ActiveRecord::Base has_one :b acts_as_ferret :fields => [:title, :description], :additional_fields => [:comment_text] def comment_text return b.comment end In a_controller, i wrote: @search = A.find_with_ferret( params[:st][:text_search], :limit => :all, :multi => [B] ).paginate :per_page =>10, :page=>params[:page] The second mosel is given below: class B < ActiveRecord::Base belongs_to :a while using :multi[B] option with the find_with_ferret,the following error is getting: undefined method `aaf_index' for #ClassName

    Read the article

  • twitter streaming api instead of search api

    - by user1711576
    I am using twitters search API to view all the tweets that use a particular hashtag I want to view. However, I want to use the stream function, so, I only get recent ones, and so, I can then store them. <?php global $total, $hashtag; $hashtag = $_POST['hash']; $total = 0; function getTweets($hash_tag, $page) { global $total, $hashtag; $url = 'http://search.twitter.com/search.json?q='.urlencode($hash_tag).'&'; $url .= 'page='.$page; $ch = curl_init($url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE); $json = curl_exec ($ch); curl_close ($ch); echo "<pre>"; $json_decode = json_decode($json); print_r($json_decode->results); $json_decode = json_decode($json); $total += count($json_decode->results); if($json_decode->next_page){ $temp = explode("&",$json_decode->next_page); $p = explode("=",$temp[0]); getTweets($hashtag,$p[1]); } } getTweets($hashtag,1); echo $total; ?> The above code is what I have been using to search for the tweets I want. What do I need to do to change it so I can stream the tweets instead? I know I would have to use the stream url https://api.twitter.com/1.1/search/tweets.json , but what do I need to change after that is where I don't know what to do. Obviously, I know I'll need to write the database sql but I want to just capture the stream first and view it. How would I do this? Is the code I have been using not any good for just capturing the stream?

    Read the article

  • How to map a search object to a class with more fields with JPA annotations

    - by Moli
    Hi all, I'm a newbie with JPA. I need to map a search object to a table. The search object has only and id, name. The big object has more fileds id, name, adress and more. I use this as big object view plaincopy to clipboardprint? I use this as big object @Entity @Table(name="users") public class User { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String name; private String adress; private String keywords; } //this is my search object @XXX public class UserSearch { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String name; } What annotations I need to use to map the search object to the table users? I'm using spring+struts2+hibernate+JPA. Help is appreciated! Thanks!

    Read the article

  • Best practices for "search data class" in ASP.NET MVC

    - by Tim Ridgely
    Hi everybody, I'm hoping this isn't too subjective, but I'm new to ASP.NET MVC and I'm trying to figure out how others may have solved similar problems. Basically, I have two entities, Customers and Orders. A customer has many orders; an order belongs to exactly one customer. I'm making an Order Search feature that should allow a user to search for orders based on order or customer information. Pretty straightforward, I think. I've read in other posts that the search controller should use GET, but I think it makes more sense to use POST because of the large number of search params. I'm using Entity Framework to create my models, and that's in a separate class library project and namespace. This article talks about using binding instead of Request.Form to get at the POST data. Would it make decent sense to make a class to hold all the search data that could be materialized by the magic model binding? Otherwise I'd just be poking through the FormCollection to pull out particular values, which might be fine. Where would you recommend making such a class?

    Read the article

  • simple search in rails

    - by Adnan
    Hi, I'm making a simple search form in rails. In my search view I have two select boxes with fixed values like: SELECT BOX 1 SELECT BOX 2 ALL, ALL, FR, FR, US, US, DE DE And I have 2 fields in my DB with country_from and country_to. So for making a simple search like from FR to US I use: @search_result = Load.find(:all, :conditions => "country_from='#{params[:country_from]}' AND country_to='#{params[:country_to]}'" ) that is fine, but I need to implement the ALL option as well, so when I make a search like from DE to ALL I get a list with all countries in country_to I image I can do it with ifs...but what would be the most efficient way to do it?

    Read the article

  • [C#] How to do a search from a list with non-prefix keywords

    - by aNui
    First of all, sorry if my english or my post got any mistakes. I am programming a program to search the name from the list and I need to find them if the keyword is not in front of the names (that's what I mean non-prefix) e.g. if I my list is the music instruments and I type "guit" to the search textbox. It should find the names "Guitar, Guitarrón, Acoustic Guitar, Bass Guitar, ..." or something like this Longdo Dictionary's search suggestion. here is my simple and stupid algorithm (that's all I can do) const int SEARCHROWLIMIT = 30; private string[] DoSearch(string Input, string[] ListToSearch) { List<string> FoundNames = new List<string>(); int max = 0; bool over = false; for (int k = 0; !over; k++) { foreach (string item in ListToSearch) { max = (max > item.Length) ? max : item.Length; if (k > item.Length) continue; if (k >= max) { over = true; break; } if (!Input.Equals("Search") && item.Substring(k, item.Length - k).StartsWith(Input, StringComparison.OrdinalIgnoreCase)) { bool exist = false; int i = 0; while (!exist && i < FoundNames.Count) { if (item.Equals(FoundNames[i])) { exist = true; break; } i++; } if (!exist && FoundNames.Count < SEARCHROWLIMIT) FoundNames.Add(item); else if (FoundNames.Count >= SEARCHROWLIMIT) over = true; } } } return FoundNames.ToArray(); } I think this algorithm is too slow for a large number of names and after several trial-and-error, I decided to add SEARCHROWLIMIT to breaks the operation And I also think there're some readymade methods that can do that. And another problem is I need to search music instruments by a category like strings, percussions, ... and by the country of origins. So I need to search them with filter by type and country. please help me. P.S. Me and my friends are just student from Thailand and developing the project to compete in Microsoft Imagine Cup 2010 and please become fan on our facebook page [KRATIB][3]. And we're so sorry we don't have much information in English but you can talk to us in English.

    Read the article

  • HTML5 Search Input: No Background Image in Chrome?

    - by Jason
    I have been pulling my hair out trying to get Chrome to style my search input with a background image. Firefox has no problem, but I fear it's because it treats the input as a regular text input. Is this simply not possible? Try this as a demo: <input type="search" /> ?input[type="search"] { background: transparent url(http://google.com/intl/en_ALL/images/srpr/logo1w.png) no-repeat 0 0; }?????? If it worked correctly, it should put Google's logo (or part of it) as the background image for the "Search" input. But as you will see when you look at this in Chrome, it DOES NOT WORK. Any ideas, or is this just one of HTML5's quirks? :\

    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

  • Grep without storing search to the "/ register in Vim

    - by Phro
    In my .vimrc I have a mapping that makes a line of text 'title capitalized': noremap <Leader>at :s/\v<(.)(\w{2,})/\u\1\L\2/g<CR> However, whenever I run this function, it highlights every word that is at least three characters long in my entire document. Of course I could get this behaviour to stop simply by appending :nohlsearch<CR> to the end of the mapping, but this is more of an awkward hack that still avoids a bigger problem: The last search has been replaced by \v<(.)(\w{2,}). Is there any way to use the search commands in Vim without storing the last search in the "/ register; a 'silent' search of sorts? That way, after running this title-making command, I can still use my previous search to navigate the document using n, N, etc. Edit Using @brettanomyces' answer, I found that simply setting the mapping: noremap <Leader>at :call setline(line('.'),substitute(getline('.'), '\v<(.)(\w{2,})', '\u\1\L\2', 'g'))<CR> will successfully perform the substitution without storing the searched text into the / register.

    Read the article

< Previous Page | 131 132 133 134 135 136 137 138 139 140 141 142  | Next Page >