search

Need help with Binary Search Tree in C++

I'm trying to make a BST and need to print it inorder, postorder, and preorder The thing am not sure about is how to create this tree in my main() function. struct Tree_Node { Tree_Node *right; Tree_Node *left; int info; }; class bTree { private: Tree_Node *root; public: bTree(); void bTree::Insert(Tree_Node*& ...

Search a file for a string, and execute a function if string not found; in python

def checkCache(cachedText): for line in open("cache"): if cachedText + ":" in line: print line open("cache").close() else: requestDefinition(cachedText) This code searches each line of a file (cache) for a specific string (cachedText + ":"). If it does not find the specific stri...

Does LINQ have any built-in search which supports search-machine-like searching?

If I have a List<string> and want to do a standard search through it, I can use a LINQ statement like this: (from t in tasks where searchTerms.All(term => t.ToUpper().Contains(term.ToUpper())) select t).ToList(); But if I want to support standard search-engine-like syntax to handle phrases such as: contract contract customer jim c...

Customizing Sharepoint Search Box

I followed some tutorial to change the way Sharepoint Search Box is shown on screen. My first problem is, after modifying the SearchArea.xml file, is there a way to force the reload? The frequency of reload seems very random. Bonus question: is it the best way to do it? It's the easiest I've found, but having to change the file on the ...

Clojure data structure traversal/searching.

I'd like to be able to do something like this: (search data list? (fn [x] (and (list? x) (= 4 (first x)))) (fn [x] (and (set? x) (contains x 3)))) And have it recursively search a nested data structure data: first for the shallowest lists (might be in a set of sets, for example). then within those lists for the shallowest li...

How to start an Activity on clicking the Search button on an Android handset

I would like to start MyActivity class when the user clicks on the search button on the handset. Are there any strategies you can suggest for this? Any code examples would be very useful. ...

Python SQLite FTS3 alternatives?

Are there any good alternatives to SQLite + FTS3 for python? I'm iterating over a series of text documents, and would like to categorize them according to some text queries. For example, I might want to know if a document mentions the words "rating" or "upgraded" within three words of "buy." The FTS3 syntax for this query is the followi...

Chrome Bookmark Search

Can you get results from chome.bookmark.search without having to display them? Update (Answer): Ok. Maybe my problem is more complex. If I want to use the result globally. function _search() { var query = $("searchBox").value; chrome.bookmarks.search(query, function (bmk){ var id = bmk[0].id; chrome.bookmarks.get(id, functi...

Cross Referencing Databases on Fuzzy Data

I am currently working on project where I have to match up a large quantity of user-generated names with a separate list of the same names in a canonical format. The problem is that the user-generated names contains numerous misspellings, abbreviations, as well as simply invalid data, making it hard to do a cross-reference with the canon...

PHP 'smart' search engine to search Mysql tables advice

I am creating a search engine for my php based website. I need to search a mysql table. Thing is, the search engine must be pretty 'smart', so that users can easily find their items (it's a classifieds website). I have currently set up a FULLTEXT search with this piece of code: MATCH (headline) AGAINST ($querystring) But this is...

Counting how often which mnemonic occures

Do you know a program which gives you a list of all assembler mnemonics used by a given byte machine code (mainly for x86's) beside their number of occurrences? I don't mean something like a pure disassembler. I'm only interested in their absolute frequencies. Edit: I'm happy too with a simple shell script or a cunning sequence of well ...

Search through PDF files with PHP

Hi all, I'm trying to find a way to search inside PDF files. I came accross the PHP PDF class but I can't seem to find any function for reading/searching a filestream. So, as naive as I am, i tried to simple get a stream using file_get_contents(), obviously it's an encrypted-like output ;) So my question, is there any way to search t...

Google-like search query tokenization & string splitting

I'm looking to tokenize a search query similar to how Google does it. For instance, if I have the following search query: the quick "brown fox" jumps over the "lazy dog" I would like to have a string array with the following tokens: the quick brown fox jumps over the lazy dog As you can see, the tokens preserve the spaces with in ...

Need Help with Magento Mini-Search

I have the below code courtesy to Edmond's Ecommerce that converts Magento's standard mini-search form to a more detailed mini-search like the ones seen in Amazon and eBay. At this juncture, I'm able to get to the sub-categories of the root directory, but instead, I would like to pull out the array from the sub-sub-categories. Root Direc...

PHP - How to suggest terms for search, "did you mean...?"

When searching the db with terms that retrieve no results I want to allow "did you mean..." suggestion (like Google). So for example if someone looks for "jquyer" ", it would output "did you mean jquery?" Of course, suggestion results have to be matched against the values inside the db (i'm using mysql). Do you know a library that can ...

Are there any existing solutions for creating a generic DNA sequence database with a website front end?

I'd like to create an rRNA sequence database with a web front end for the lab I work in. It seems common in biology to want to search a large number of sequences using alignment algorithms such as BLAST and HMMER, so I wondered if there is any existing php/python/rails projects that allow easy creation of a generic sequence database with...

optimized indexed array search for greater-than number

I have an array of sorted numbers: pts = [ 0, 4, 25, 51, 72, 100 ] Given value T, I need to find the index of the first number in the array greater than T. if T = 2, then the correct index is 1 for value 4 dumb solution I can do this with a linear search, but would like to optimize. not working solution Binary search algorithm e...

Lucene searching by numeric values

I'm building a Java Lucene-based search system that, on addition, adds a certain number of meta-fields, one of which is a sourceId field, which denotes where the entry came from. I'm now trying to retrieve all documents from a particular source, but the index doesn't appear to be able to find them. However, if I search for a wildcard va...

how to search text in threads?

i am coding my first forum and wants to have a search field. i am wondering what function i should use to search for specific threads in database. should i use WHERE title LIKE '%keyword%' OR body LIKE '%keyword%' is that the common search algorithm for thread contents? ...

emacs newbie question - how to search within a region

If I select a region of text, is there a way to use isearch (or some other search command) that will allow me to only search within the region? I was hoping to use this to technique inside a macro. This might be obvious, but I did a quick search and couldn't find a way. ...