search

Effective ways of finding an element in a Javascript array

I am using an array with titles. Each titles index corresponds to an id in a database which contains html for that given title. Lets say I have a string which contains one of the titles. title = "why-birds-fly"; titles[] // an array which contains all the titles To use the string "title" to get the corresponding id I could do: for (...

Searching for a string 'somewhere' in a database

Here's my problem: I'm looking at someone's Postgresql based database application for the first time and trying to find what is causing certain warnings/errors in the system's logfile. I don't know anything about the database schema. I don't know anything about the source code. But I need to track down the problem. I can easily search f...

What is an elegant way to find versions of packages on a pypi package index?

Currently I'm using a very ugly approach based on a regex for finding links and taking them apart. I'm unhappy with the code, so I'm asking for nicer solutions, preferably using only the stdlib. Edit The task at hand has 2 parts: Find all distributions that match a certain criteria (like prefix of the name). Find all versions availa...

Advanced Search in Linq to SQL possible??

Without the use of "LIKE" in Dynamic Linq it virtually renders it useless to me when trying to create an advanced search query. How have any of you overcome this Advanced Search problem when using Linq to SQL? I'd need to search the following field types and they all could be null as well: List item varchar (column LIKE '%' + myText ...

Whats a fast alternative to plain fulltext searching in php?

Im looking to improve the search in one of my applications, where I sue regular fulltext searching, which isn't too bad, but Im looking to add some more complex behaviors, such as typo recognition and better relevancy. Are there any solutions out there that can be integrated into an existing application? Im looking to search several tab...

Anonymous SharePoint Users and people search core results web part

Hi Can anyone tell me how to allow anonymous SharePoint MOSS users to view people search core results web parts? When they try to access pages containing this web part, they are prompted to login. All the best ...

Rails: Searching multiple tables from one query

How do I write condition statement in find or paginate method to allow users search in Project and Project Category names simultaneously? Now my code looks like this @projects = Project.paginate :per_page => 20, :page => params[:page], :conditions => ['name LIKE ?', "%#{params[:search]}%"] So I have also Category table with name fiel...

Best way to create a sitesearch in ASP.NET

Which is the best way to create a site search engine for a dynamic asp.net site with hundreds of dynamic pages. I have seen many products and articles http://www.karamasoft.com/UltimateSearch/overview.aspx http://www.sitesearchasp.net http://www.easysearchasp.net/ http://msdn.microsoft.com/en-us/magazine/cc163355.aspx http://www.co...

Programming information in your mother tongue

Whenever I need information on a programming topic I tend to search Google directly in English. I don't even bother trying to search in Spanish which is my mother tongue, I know that probably I won't find anything interesting. Do you ever try to search for programming help in your mother tongue? Do you always find your responses in tha...

How to store documentation of programs, libraries and languages you use

As I often work without a fast or even any internet connection, I have a webserver that serves commonly used documentation, for example: Various programming languages (php, Python, Java, ...) Various libraries (for example pthreads) Various open books RFCs IETF drafts Wikipedia (text-only, the uncompressed English dumpfile weighs 20GB!...

High level explanation of Similarity Class for Lucene?

Do you know where I can find a high level explanation of Lucene Similarity Class algorithm. I will like to understand it without having to decipher all the math and terms involved with searching and indexing. ...

How can I search and then replace a code snippet that includes some variables in TextMate?

I have a project that includes 49 folders, each one has a file called index.php All index.php files are almost the same except for one part that changes depending on the folder it is in. <?php include_once("/home/bgarch/public_html/galleryheader.html"); ?> <?php include_once("/home/bgarch/public_html/culture/loadscripts.html"); ?> </h...

Is there a better way to use SEARCH in two-dimensional arrays of COBOL?

The Cobol's SEARCH keyword can be used to search one dimensional arrays indexed. But I think this SEARCH is having some disadvantages when used for searching 2-d arrays. We can search using PERFORM loop also but is there a better way of utilizing SEARCH for 2-d arrays. Which one do you propose? ...

vim clear last search highlighting

After you do a search in vim you get all the occurrences highlighted, how can you disable that? I now do another search for something gibberish that can't be found. Is there a way to just temporarily disable the highlight and then re-enable it when needed again? ...

How to implement incremental search on a list

I want to implement incremental search on a list of strings. Consider I have an array containing which contains the strings store,state,stamp,crawl,crow. My application has a text box in which the user enters the search string. Now, as the user enters the text, I need to highlight all the matches. For example, when the user enters "st" I...

Search Center on SharePoint Publishing site

Can someone give me some directions on how to setup SharePoint Search Center so I can get results from the list and that they have some custom (modified) link? I have Forms authentication (and anonymous access) enabled with alternate access mapping. Right now in the Default zone I get results from the data in lists and they all point ...

Wild card search in C#

I have a list of wild card based patter in a XML file. If the input string matches the pattern present in the XML doc, then a specific action would be taken. I did find the approach mentioned here http://www.codeproject.com/KB/recipes/wildcardtoregex.aspx but in that case, I need to create a RegEx object for every entry in the XML whic...

Extract first N unique integers from an Array

I have a large list of integers (thousands), and I want to extract the first N (in the order of 10-20) unique elements from it. Each integer in the list occurs roughly three times. Writing an algorithm to do this is trivial, but I wonder what's the most speed and memory efficient way to do it. There are some additional constraints and ...

How to search a List(Of Byte) for two values using the Framework?

Is there a way of searching a list for more that one consecutive values? I've looking at Find and IndexOf but Find uses Predicates that only use the current value and IndexOf only takes byte parameters. I can code my own solution but I want to be sure that there isn't a solution already available to this common problem. Thanks in advan...

How do I search a directory of files using another file as input and sending the output to another file?

I am working on a Unix system. I have a directory of files called MailHistory. Each file in the directory contains all of the emails for the previous day. The files are created at midnight and named with the timedatestamp. So, a typical filename is 20090323000100. I have a file that has a list of names. Using this file as input, I...