search

Regex in Notepad++: Find all 'INSERT INTO…;' queries

假如想象 提交于 2020-01-16 04:03:15
问题 I have a big sql file that contains a lot of 'create table ...' and 'insert ...' queries. Now I want to eliminate all the 'insert' queries from the file. The insert queries are somewhat like: INSERT INTO 'some_table' (col1, col2, col3) values ('val11','val12','val13'), ('val21','val22','val23'), ('val31','val32','val33'); Using Notepad++ I want to find and delete all these 'INSERT' queries using regular expression. When I tried finding with the regex INSERT INTO((.*\r\n)*) then it selects

Textwatcher doesn't recognize space

微笑、不失礼 提交于 2020-01-16 00:43:24
问题 I am trying to filter a gridview and for that I am entering the data in an editbox. It works great except that when I insert a space character in editbox it somehow doesn't recognize it and the result set comes empty. Please help Here is my editbox listener: search.addTextChangedListener(new TextWatcher(){ @Override public void afterTextChanged(Editable arg0) {} @Override public void beforeTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {} @Override public void onTextChanged

How check different spellings of a persons full name

旧巷老猫 提交于 2020-01-16 00:41:13
问题 I try to create a regular expression with searches in a huge document for a persons full name. In the text the name can be written in full, or the first names can be either abbreviated to a single letter or a letter followed by a dot or omitted. For instance my search for _ALBERTO JORGE ALONSO CALEFACCION_now is: preg_match('/([;:.,&\s\xc2\-(){}!"'<>]{1})(ALBERTO|A.|A)[\s\xc2-]+ (JORGE|J.|J)?[\s\xc2,]+(ALONSO)[\s\xc2*-]+(CALEFACCION))([;:.,&\s\xc2(){} !"'<>]{1})/i', $text, $match); Between

How check different spellings of a persons full name

混江龙づ霸主 提交于 2020-01-16 00:41:09
问题 I try to create a regular expression with searches in a huge document for a persons full name. In the text the name can be written in full, or the first names can be either abbreviated to a single letter or a letter followed by a dot or omitted. For instance my search for _ALBERTO JORGE ALONSO CALEFACCION_now is: preg_match('/([;:.,&\s\xc2\-(){}!"'<>]{1})(ALBERTO|A.|A)[\s\xc2-]+ (JORGE|J.|J)?[\s\xc2,]+(ALONSO)[\s\xc2*-]+(CALEFACCION))([;:.,&\s\xc2(){} !"'<>]{1})/i', $text, $match); Between

com.mongodb.MongoException: not talking to master and retries used up

依然范特西╮ 提交于 2020-01-15 15:37:11
问题 My search is not working now. I guess because my index was not configured for replica set: curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{ "type": "mongodb", "mongodb": { "db": "mongo", "host": "local", "port": "40000", "collection": "users" }, "index": { "name": "api", "type": "users" } }'` Is there anyway to declare a replica set properly so that elasticsearch can find the master, the way PHP driver does: $m = new Mongo( "mongodb://localhost:40000,localhost:41000", array(

Sqlite advanced search

巧了我就是萌 提交于 2020-01-15 11:25:48
问题 I'm developing an android application for a store, which provides many functions. One of these is a function that allows the customer to search a product with some criteria (price,size,type... like in the picture ). I guess I should work with SqliteDatabase , but I have no idea how I can make this multi-criteria search interface , so the user can query the database. 回答1: It's simple. after setup your database, you can use SQL queries and JOIN types with WHERE critaria and finally achive

Mysql, PDO - Like statement not working using bindParam

蹲街弑〆低调 提交于 2020-01-15 11:19:33
问题 I am trying to code search functionality for a site and am stuck at the like comparison in the sql statement. For some reason when I use ? and pindparam the variable containing the string of like comparisons it keeps coming back with no results found. If I remove the ? and just type the comparison post_title LIKE '%something%' it works. here is my code: // Retrieve search results function retrieve_search_posts($searchfield){ //test the connection try{ //connect to the database $dbh = new PDO(

MATLAB quick find of a vector in matrix

一个人想着一个人 提交于 2020-01-15 07:53:27
问题 I have a piece of code that works in the following way. There is a matrix of size n x 2 . Each element is an integer between 1 and some maximum, say m . I want to search for rows in this matrix, that is, given [v1, v2] , output the index of this. Right now, I am using: k = find(ismember(edges, [v1, v2], 'rows')); However, this is the bottleneck in my code because this is in linear time. I would like to implement some hashmap type structure for fast lookup. What would be an easy way to do this

Ransack search, how to search for each word by splitting input search parameter

偶尔善良 提交于 2020-01-15 07:11:48
问题 I am currently experimenting using the ransack gem to conduct a search on a model in Rails. As it stands I am using the basic setup. Controller: def index @q = Person.search(params[:q]) @people = @q.result(:distinct => true) end View: <%= search_form_for @q do |f| %> <%= f.label :name_cont %> <%= f.text_field :name_cont %> <%= f.submit %> <% end %> I have managed to find lot of information about conducting searches on multiple fields, however, I haven't managed to find anything to help me to

How do I get the tf and idf score from a Solr query?

不羁岁月 提交于 2020-01-15 06:30:06
问题 Following Solr documentations (https://cwiki.apache.org/confluence/display/solr/Function+Queries and others) I should just put idf(fieldname, 'term') as I do with termfreq(fieldname, 'term') in the field list. However, whenever I try this I get an exception as: org.apache.solr.client.solrj.SolrServerException: No live SolrServers available to handle this request By looking at the logs I could find: null:java.lang.UnsupportedOperationException: requires a TFIDFSimilarity (such as