search

searching data in a database

Hi, Here is the aspx.cs file for my web application: protected void Button1_Click(object sender, EventArgs e) { SqlDataReader myDataReader = null; string connectionString = "Data Source=[my source];Initial Catalog=[catalog name];Integrated Security=True"; using (SqlConnection connection = new SqlConnection(con...

Finding a Subset of Points by Relative Distances

I'm writing a game in which the player may manipulate a great many objects at one time. I would like the player to be able to select objects according to the distances between them. Given the locations of all objects, a starting object, and a distance threshold, what is the fastest way to find the subset containing the starting object f...

How to search lines which don't contain an empty line before the return statement

I would prefer to have an empty line prior to the last return statement of any Java method. How do I find and replace such lines using Eclipse? public int foo() { ... ... System.out.println("end of foo"); return 1; } In this case , I would prefer an empty line before the return statement, do note that there could be a...

ShingleFilter search with more terms than indexed phrase fails

I am using Solr 1.4.1 (lucene 2.9.3) on windows and am trying to understand ShingleFilter. I wrote the following code and find that if I provide more words than the actual phrase indexed in the field, then the search on that field fails i.e. no score contributed from that field with debugQuery=true. Here is an example I created to repro...

Term-Topic Matrix for a huge file

Hi, I have a list of 17 million sentences in a text file. Each sentence contains at max 200 characters. Each sentence is also accompanied by one or more annotation(s) with it. I have a list of unique annotations and a list of unique words obtained from the 17 million sentences. I have to create a sparse matrix with the rows as the uniqu...

fastest search algorithm

hello I'm trying to implement an algorithm to search multiple XML files for a certain record. known that the records are not sorted ( i don't have an indexed id) . what is the fastest algorithm to search for that record ?. please let me know if anything was unclear thanks in advance ...

Sharepoint 2007 search slowdown (using custom scopes)

Is there really a slowdown issue when using custom scopes in searching for contents in Sharepoint 2007? How do you resolve this? I experience the slowdown every after 3 or 4 tries (so the first tries work just fine). I'm using a custom masterpage but the same issue is encountered in OOB portals (using default masterpage). ...

Magento: How to show only products with a custom binary attribute

I created some custom attributes for my Products in the backend, put together in a single attribute set. Attributes are like: "Can be used to fill holes in teeth" "Can be used to to cover up fillings" "Is absorbable" All of those attributes are of the "yes/no" kind. I made all of them searchable, yet when I search for "fillings" or "...

Search for the smallest element in a list after some value

Consider a list of integers <1,5,10> (assume sorted in ascending fashion). Given an integer, say, key = 6, is there a utility method that returns the smallest element after key (in this case it would be 10)? NB: Looping through the elements in the list and comparing it with key is an obvious way to do it, but I'm just wondering if ther...

Is this an efficient use of the Array.filter() method for searching and retrieving an Object instance from an Array?

I am curious if this is an okay implementation of the Array.filter() method. //Array of generic Object instances representing galleries. //The images property is empty for the example var galleries:Array = new Array(); galleries[0] = {name: 'Portraits', images: new Array()}; galleries[1] = {name: 'Landscapes', images: new Array()}; ga...

Sphinx question: Structuring database

Hey, I'm developing a job service that has features like radial search, full-text search, the ability to do full-text search + disable certain job listings (such as un-checking a textbox and no longer returning full-time jobs). The developer who is working on Sphinx wants the database information to all be stored as intergers with a ke...

Filter XML from searchparameters

Hi there folks! I'm creating a small search function on a site I'm creating. I'm working with Umbraco CMS, and all the nodes that I need to search are children of the page that are being searched on. Right now I have a search box with seven fields. three input fields and four dropdown's. This is the XML that I need to find my results f...

Programatically searching GMail?

Is there any way to programatically search GMail, preferably using C#? For example, I'd like to get all email messages matching the search label:MyLabel from:[email protected], so that I can parse the email bodies as required. The only thing remotely feasible I've found is the GMail API by Johnvey Hwang, though it doesn't look like it s...

Auto-complete search box, selecting multiple values from results

I'm creating my own recipe box using php/mysql and one part I'm stuck on is actually creating the recipes, specifically selecting the ingredients. What I wanted to do instead is have a auto-complete search box where I can type out names of the ingredients, have the results drop down right below, and click the ones I'm looking for. After...

Eclipse: Files opened by multiple searches using same editor tab

When using the "file search" function in eclipse to find a bit of text in a ".java" file, I may get a list of several search results. Let's say I double click on the file "A.java" which then opens A.java in a new editor tab. If I then use the "file search" function again to find some other bit of text and this time double click on the ...

How do I search in Discussion Boards from a Form Web Part?

I want to create a "stackoverflow.com" solution in a sharepoint, for one of our internal projects. I have choose a Form Web Part for searching and Discussion Boards for asking questions and replying to them. How I can create a search algorithm that searches the discussion board? I type some keywords in the form web part and click Go...

Finding similar word lists using StringListProperty on App Engine

I have a list of tags defined in a StringListProperty(). The DB contains around 1 million entries and each entry has around 20 different values in the list. e.g. a = [ 'ab', 'bc', 'ca', 'x', ....] b = ['x', 'm', 'a', .... ] I am using Google App Engine so I have constraints on running batch jobs ... (only 30 sec allowed) Here is m...

Search in JTable

I have created with Java Swing a dialog window which presents in a JTable a list of items. I would like to implement some sort of search functions. Can anyone suggest me the best way to implement such feature? ...

Algorithm for searching grid in diffrent direction

Hi, Today a work mate posed a question to me. Given a grid of characters and a list of words one would have to find every occurrence of that word in the grid both horizontally, vertically and diagonally. The solution we came up with works and does the trick but I am interested to see how other peoples minds tick. ...

Lucene adding additional filter returns no results

I am attempting query some results using a Boolean Query. However the query does not return any results. Here is the FilterQuery I am running. This returns no results, even though the field foo contains bar, and the field foo3 contains bar3. And I have triple checked my fields to make sure that the fields do exist in the index. +(foo...