search

In Python, how to check if a string only contains certain characters?

In Python, how to check if a string only contains certain characters? I need to check a string containing only a..z, 0..9, and . (period) and no other character. I could iterate over each character and check the character is a..z or 0..9, or . but that would be slow. I am not clear now how to do it with a regular expression. Is this ...

Complex Searching with Ado.Net Entity Framework?

What is the best practices for complex searching with ADO.NET Entity Framework. How do you handle complex searching with EF? I am curious about how other developers use EF with detailed,complex searches like E-Shop, Real Estate... etc ? I was using Ayende's for Nhibernate. Thank you ...

jqGrid search filter questions

Have two questions. Make the search filter form non modal. Allow searching by pressing enter key instead of having to press the Find button. thanks. ...

SQL Server Full Text ContainsTable function Rank issue

Is is possible to increase the Rank of the ContainsTable results if its an Exact match. I have a fulltext query like this select iname,rank from ItemSearch_View sv INNER JOIN CONTAINSTABLE(ItemSearch_View,searchstring, '(FORMSOF(INFLECTIONAL, "google") )',500) AS itable ON sv.itemid = itable.[KEY] order by rank desc which provides ...

jquery livesearch?

I am looking for a nice quick live search/filter. Anybody use this? http://rikrikrik.com/jquery/quicksearch/#usage Also how do you combine it with pagination or ajax for large amounts of data? Code: HTML: <form method="get" autocomplete="off" action=""> <input type="text" value="" name="q" id="q"><br><br> </form> <ul id="posts"> <li>...

Can't assign FULLTEXT index on my table

I am trying to implement a search function on a database table using query expansion, and I'm aware that I have to add the FULLTEXT index on the fields I want to become searchable. I have tried to do this and got no errors from PHPMyAdmin, but when I examine the structure of the table the cardinality of the FULLTEXT index is 0. I have tr...

implementing a string translation table in c

I want to implement a basic search/replace translation table in C; that is, it will read in a list of pairs of words from a config file, and go through a text received at runtime, replacing each source word it finds with the corresponding target word. For example, if my user-input text was "Hello world, how are you today?" and my conf...

Multi Criteria Search Algorithm

Hello, Here's the problem : I've got a huuge (well at my level) mysql database with technical products in it. I ve got something like 150k rows of products in my database plus 10 to 20 others tables with the same amount of rows. Each tables contains a lot of criteria. Some of the criteria are text values, some are decimal, some are just...

replacing all index.html files in a directory tree

My shared hosting account with a number of websites was compromised. Some malware on my PC, which I probably got through downloading a PDF file, found all my FTP passwords and happily went about its business of inserting some code into all index.* files on the server. I now got rid of this malware, and I am ready to change all FTP passwo...

Problems using MySQL FULLTEXT search

I have already posted a question about this, but the situation has changed sufficiently to warrant a new one. I have a MySQL table called aromaProducts in which there are 7 columns with the FULLTEXT index, and which has three records in it. When I make a query against it like: SELECT * FROM aromaProducts WHERE MATCH (title) AGAINST ('...

Role-based intranet search

I'm currently working on an ASP.NET 3.5 intranet that uses role-based security, both on the page level and the page content level in some cases. I'd like to implement a site-wide search, but restrict results according to what the current user would normally see when they visit a given page. I suppose it would have to index the site separ...

How to grep git commits for a certain word

In a Git code repository I want to list all commits that contain a certain word I tried this: git log -p | grep --context=4 "word" but it does not necessarily give me back the filename (unless it's less that 5 lines away from the word I searched for. I also tried git grep "word" but it gives me only present files and not the...

What is the easiest way to search and replace in text files encoded UTF-16?

I'm trying to update a series of xml files by changing names that they reference. I have a table of names that have changed, column for the current name and a column for the name to replace with. I looked for ways to script search and replace and found sed. It seemed like a good choice until I ran my first attempt. On inspecting the fi...

Miscellaneous import errors with Djapian

After installing Djapian ten different ways and following 5 completely different tutorials, it's time to ask for help. Ok, the vanilla way: I go to http://code.google.com/p/djapian/wiki/Installation and follow the instructions to a tee, installing Djapian 2.0. joshua@staging-server:/var/www$ python pri*/pro*/my*/manage.py shell Python ...

Searching views in Drupal

How do you add Search form to your Views in Drupal? Do I have to edit specific view template and add to it form-creating code that posts arguments to my view? Should form's method URL be simply view's URL and form fields the same as view arguments? Is that all the tricks I need to know? ...

How to search an entire CVS repository (all branches/history/comments)?

If I want to essentially grep every line ever in the repository, is there a way to do it? I know this would take a long time for large projects. If not all inclusive, at least just the current branch and its entire source history? Edit: I should have been more explicit. What if I don't have direct access to the server that the CVS repo...

WSS Search - Content inside webparts

How would you go about having WSS search index content that's inside a webpart/pulled from an external source and presented in a SPGridView? ...

Site wide search on a rails application

Hi, I'm trying to add search capability to one of my rails applications. I just need it to search through the mysql columns of quite a few models well. I'm wondering what the best way to do this is. I figure I should use a plugin but I don't see anyone really recommending one over another. Is there one you would recommend over all ot...

Java newbie: infinite loop searching for specific text in a file

I'm needing to locate a string on a particular line in a text file that is composed of several lines of strings. However, my loop to find the text or the end of the file is eternally searching. I know the string is in the file. Here is the code I am using to locate the text - but be warned, if you try it on your system even with a simple...

Need a way to search mail for a message id using imap

Hi, I am using Java Mail api to access a gmail account (not fixed). I need to search all mails for a given Mail id (). The search should terminate on the FIRST occurence of the message with given ID (Optimization : only a single mail should exist with the given id) i would of course would like to skip the "All mail" folder. The simples...