sql,sql-server,indexing
I'm going through and removing duplicate and redundant indexes in a SQL database. So if I have two identical indexes I delete. If I have overlapping indexes I delete, for example... Index 1: brand, model Index 2: brand, model, price I delete index 1. What about indexes in same order...

matlab,if-statement,for-loop,matrix,indexing
I to do some indexing, something like what follows: for c=1:size(params,1) for d=1:size(data,2) if params(c,8)==1 value1(c,d)=data(params(c,11),d); elseif params(c,8)==2 value2(c,d)=data(params(c,11),d); elseif params(c,8)==3 value3(c,d)=data(params(c,11),d); end end end The problems with this is that if we have params(:,8)=1,3,1,3,2,3,1... then value1 will contain all zeros in rows 2, 4, 5, 6, etc. These are...

python,arrays,numpy,indexing
I'm looking for a function that would do what the function indices does in the following hypothetical code: indices( numpy.array([[1, 2, 3], [2, 3, 4]]) ) {1: [(0,0)], 2: [(0,1),(1,0)], 3: [(0,2),(1,1)], 4: [(1,2)]} Specifically, I want to produce a dictionary whose keys are the unique elements in the flattened...

javascript,arrays,json,indexing
I have the following problem: I have a JSON table with the data I need (found this on the internet since it is nearly what I need) var testext ={"key1":[ { "firstName":"Ray", "lastName":"Villalobos", "joined":2012 }, { "firstName":"John", "lastName":"Jones", "joined":2010 } ]} document.getElementById("demo").innerHTML=testext.key1[0].firstName; This works fine but as you can see...

php,mysql,indexing,pdo,show
I am trying to use PDO and prepared statements to get the primary key of a table. From other questions I saw that this is possible when executing something like this: show index from TABLENAME where Key_name = 'PRIMARY' The problem is that I can not use this from inside...

oracle,indexing,plsql,deterministic
I'm using an own DETERMINISTIC function for a function based index on one of my tables. What will happen if I modify the PL/SQL-Code of this function? (located in an package) Will the Index invalides? Do I have to rebuild it (manually)? Thanks! Edit: Here is my example script, which...

mysql,indexing
I'm now working on a new MySQL database (interface PHPmyadmin) for my personal project and I don't know how to avoid two columns on a same table to have the same value. So, i want that we can't insert same values for 2 differents columns in one record. Example TABLE...

search,indexing,solr,levenshtein-distance
Lets say I have my list of ingredients: {'potato','rice','carrot','corn'} and I want to return lists from a database that are most similar to mine: {'beans','potato','oranges','lettuce'}, {'carrot','rice','corn','apple'} {'onion','garlic','radish','eggs'} My query would return this first: {'carrot','rice','corn','apple'} I've used Solr, and have looked at CloudSearch, ElasticSearch, Algolia, Searchify and Swiftype. These engines only...

python,numpy,multidimensional-array,indexing,dynamic-arrays
I'm new to python so I need some help with this: I have 2D array of numbers that represent density of a circle of material in a space and I want to locate the centre. So I want to get the index of the numbers representing the diameter and then...

java,arrays,indexing
So I'm working with a problem where I am parsing a large text file into data - each row of the file being represented by a Node object with several data fields. During program execution, these objects will be accessed many times according to their int id field (specified in...

google-app-engine,indexing,gae-datastore,app-engine-ndb
I have an NDB model with some obsolete EntitiesByProperty indexes. Some belong to properties that are no longer part of the schema (but they do exist on some old entities), and some belong to properties that are never used for queries (but they were with Indexed=True because this is ndb...

mysql,database,table,indexing
SELECT * FROM orders WITH (INDEX(idx)); When i fired above query i got the error mysql #1064 - You have an error in your SQL syntax I have created index as below create index idx on orders(date,status); Can anybody tell me the correct syntax?...

numpy,multidimensional-array,indexing,argmax
I have a collection of 2D narrays, depending on two integer indexes, say p1 and p2, with each matrix of the same shape. Then I need to find, for each pair (p1,p2), the maximum value of the matrix and the indexes of these maxima. A trivial, albeit slow, way to...

mongodb,indexing
I have a collection I am updating adding a new field. The document looks like: {"A": "P145", "B":"adf", "C":[{"df":"14", "color":"blue"},{"df":17}], "_id":ObjectID(....), "Synonyms":{"Synonym1": "value1", "Synonym2": ["value1", "value2"]}} In the update I am adding new elements to C I want to create a index on the field A and B. A and...

java,indexing,elasticsearch,lucene,scalability
All I read and understand about running multiple ES nodes is to enable index replication and scaling. I was wondering if it could help us to make indexing faster for large number of files. I have two questions and they are as follows: Question 1: Would it be accurate to...

python,arrays,numpy,indexing,masking
Suppose you have a numpy array(n,n) ie. x = np.arange(25).reshape(5,5) and you fill x with random integers between -5 and 5. Is there a method to use a boolean mask so that all of my values which are 0 become 1 and all my numbers which are nonzero become zero?(i.e,...

mysql,sql,indexing
For example, if I have two tables Teacher and Student that would have a column named IDNumber, do I have to name the indexes separately like this: IDNum_teach IDNum_stu Or could I just create an index on each table for IDNumber and name them both IDNum? ...

python,list,if-statement,indexing,indexoutofboundsexception
I'm using Python's one-line conditional thus: x = 'foo' if myList[2] is not None else 'bar' to assign to x the value of an item at a certain index of a list - if and only if it exists - and a different value if it doesn't. Here's my challenge:...

c#,file-io,indexing
So I have a text file that holds 12,970 lines. I want to take this file and make them into two arrays, list, anything that will separate the file into two groups: group one being called apollo that holds the lines 0 through 7678 and group two being called sabre...

python,numpy,indexing
I would like to take an NxM matrix, for simplicity, we'll use x=np.arange(25).reshape((5,5)) And I would like to create a new matrix, A, in which I can store a node for each element in the first row, its N-direction index in the second row, its M-direction index in the third...

performance,postgresql,indexing,full-text-search,ispell
We are using a custom text search configuration for searching in german texts for a proper support of compound words. The dictionary can be found here: http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/ (ispell-german-compound.tar.gz). The dicts got converted to UTF8 and I used the following script to add the configuration to the database: DROP TEXT SEARCH...

mysql,indexing
Below is the query SELECT * FROM mytable WHERE if(@type=1,col1,col2) = 1420070400; @type is a session variable. I have two indexes defined on both columns col1 and col2 but mysql does not uses in this case. Is there any way by which we can make mysql use index? Below is...

mysql,sql,database,performance,indexing
TL;DR: I have a query on 2 huge tables. They are no indexes. It is slow. Therefore, I build indexes. It is slower. Why does this makes sense? What is the correct way to optimize it? The background: I have 2 tables person, a table containing informations about people (id,...

r,for-loop,indexing
I am trying to retrieve the index of a newly-added row, added via a for loop. Starting from the beginning, I have a list of matrices of p-values, each with a variable number of rows and columns. This is because not all groups have an adequate number of treated individuals...

c#,visual-studio,dictionary,indexing,text-processing
I'm currently trying to create an application to do some text processing to read in a text file, then I use a dictionary to create index of words, reading a text file and checking to see if the word is already in that file or not. If so, it will...

java,indexing,lucene,cassandra
I am just experimenting with Lucene and want to indexing objects in Database(Cassandra) as a table. But, I didnt realized out, how the indexing does work on Cassandra. Especially searching... When i take a simple Example Indexing in Lucene: Document doc = new Document(); doc.add(new TextField("id", "Hotel-1345", Field.Store.YES)); doc.add(new TextField("description",...

java,indexing,solr,lucene,solrj
I have downloaded solr 5.2.0 and have started using $solr_home/bin/solr start The Logs stated: Waiting to see Solr listening on port 8983 [/] Started Solr server on port 8983 (pid=17330). Happy searching! Then I visited http://localhost:8983/solr and created a new core using Core Admin / new Core as Core1 (...

python,dictionary,indexing,tuples
Let's say I have my_dict = { ("airport", "London"): "Heathrow", ("airport", "Tokyo"): "Narita", ("hipsters", "London"): "Soho" } What is an efficient (no scanning of all keys), yet elegant way to get all airports out of this dictionary, i.e. expected output ["Heathrow", "Narita"]. In databases that can index by tuples, it's...

mysql,performance,indexing
Say I have a mysql table with an index on the column 'name': I do this query: select * from name_table where name = 'John'; Say there are 5 results that are returned from a table with 100 rows. Say I now insert 1 million new rows, non that have...

python,numpy,multidimensional-array,indexing,vectorization
I have a Nx2x2x2 array called A. I also have a Nx2 array called B, which tells me the position of the last two dimensions of A in which I am interested. I am currently getting a Nx2 array, either by using a loop (as in C in the code...

sql-server,tsql,indexing
I need to create new index for table in database which size is around 300 gb, but need i perform any additioanl action after i complete with it ? My database engine is microsoft sql server 2008 ?

excel,if-statement,indexing,match,countif
I need to track a person in a data sheet to determine from which location to which location the person moved. If a person appears more then one time in Column J that means the person has changed the location and the location value is in Column L. For this...

php,indexing,footer,copyright
In my index.php file I have a command to retrieve the footer content. <?php echo file_get_contents('template/footer.php'); ?> In the footer.php document I have an additional script to get a automatic generated copyright date however when the footer.php document is rendered it isn't executing the php. <?php echo date("Y"); ?> Is...

matlab,function,for-loop,matrix,indexing
I'm attempting to find a critical point in a matrix. The value at index (i,j) should be greater than or equal to all elements in its row, and less than or equal to all elements in its column. Here is what I have (it's off but I'm close): function C...

performance,mongodb,indexing
Say I have a collection containing documents like the one below: { _id: ObjectId(), myValue: 123, otherValue: 456 } I then create like below: {myValue: 1, otherValue: 1} If I execute the following query: db.myCollection.find({myValue: 123}) will I get the same performance with my index as I would if I...

java,indexing,hashmap
Map pins = new HashMap(); pins.put("t1","test1"); pins.put("t2","test2"); pins.put("t3","test3"); pins.put("t4","test4"); Here is my code,i store key and values in HashMap. And i want to retrieve key and value by index value just like array. Retrieve value by key using iterator working. But i want index based can any body help me...

r,string,indexing,data.table
Apologies for a question that probably makes it obvious that I usually work in Python/pandas, but I'm stuck with this. How do I select a data.table column using a string? dt$"string" dt$as.name("string") dt$get("string") I'm sure this is super simple, but I'm not getting it. Any help is greatly appreciated! --------------...

postgresql,indexing
Sorry, lots of context before the actual question as we've throughly researched this and I wanted to give you full context. Some context: postgres index-only-scans rely on the visibility map (VM). If a page is not marked as not-fully-visible in the visibility map, postgres fetches that page to ensure the...

java,indexing,lucene
I am trying to get all documents from Lucene Index (which is already not deleted ). I heard that if I delete something from Lucene Index, Lucene will not delete immediately from file. So I wanted to get the documents from Index file which is not deleted....

python,indexing,elasticsearch,mapping
Im pretty new to Elasticsearch. I have a requirement of creating ALL string fields with an "analyzed" and "not_analyzed" index. I have been able to do it for 1 or 2 fields, but how can I do this if I have 50 fields in my document? I have used the...

java,arrays,indexing,hex
I have this String here called message. Bruce Wayne,Batman,None,Gotham City,Robin,The Joker Oliver Queen,Green Arrow,None,Star City,Speedy,Deathstroke Clark Kent,Superman,Flight,Metropolis,None,Lex Luthor Bart Allen,The Flash,Speed,Central City,Kid Flash,Professor Zoom I need to count the number of characters in each line and print them in hex. First line should be (From Bruce to Joker) 2b Second...

variables,indexing,set,linear-programming,ampl
Not too familiar with AMPL, but running into some issues with indexes... Basically, I have some variables defined as such: var array{i in set}; And I need to do some amount of checking the elements around a given i in some of the constraints: subject to Constraint{i in set}: array[i]...

python,list,indexing,nltk
i currently have a file that contains a list that is looks like example = ['Mary had a little lamb' , 'Jack went up the hill' , 'Jill followed suit' , 'i woke up suddenly' , 'it was a really bad dream...'] I would like to find the index of...

python,string,list,indexing,set
I got following List relational_scheme = [["F",["DC"]],["A",["EBD"]],["DC" , ["BAF"]],["E",["DB"]]] Now i want to get the second List as a Set like def returnSetOfList(relational_scheme,"F") So that this output generates set(["DC"]) How can i make this? an easy Index don't work. Thanks in advance. UPDATE got it, was just blind Solution: def...

sql-server,indexing,key
I have a SQL statement that is giving me a Key Lookup sucking the processing of this query below. Since its part of a 3 part union, getting rid of the key lookup is preferable. My query is below. SELECT c.customerName, c.customerNumber, totals.TotalLoanAmount, totals.TotalCommitmentAmount, l.loanNumber, l.commitmentAmount, ed.amountThreshold, ex.exceptionId, IsNull(ex.reminderDateGracePeriod, ed.defaultReminderDateGracePeriod)...

matlab,indexing,vectorization
I need a fast way in Matlab to do something like this (I am dealing with huge vectors, so a normal loop takes forever!): from a vector like [0 0 2 3 0 0 0 5 0 0 7 0] I need to get this: [NaN NaN 2 3 3...

c,pointers,indexing
Right now I'm looking over some C code and they have some pointer syntax that I'm confused about. So first they declared a pointer like so: int32_t *p_tx_buf=NULL; Then later on they wrote: p_tx_buf = malloc(...math... ); The stuff in the middle is just math to calculate the size of...

python,arrays,matlab,numpy,indexing
I am attempting to convert a script I have in MATLAB to Python in order to increase speed and efficiency of the overall algorithm. In MATLAB, the code is as follows: for iter = 1:T costi = costo; for i = 1:length(index) for j = i+1:length(index) if index(j) == index(i)...

list,python-2.7,loops,indexing
New to Python, trying to understand how this iterative loop that is intended to remove all items form the list is handling the indexes in the list and why it stops where it does... Why does this loop: foo = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] for i...

sql,postgresql,search,indexing,full-text-search
i'm using for the first time Postgresql and i'm trying to create a search engine in my website. i have this table: CREATE TABLE shop ( id SERIAL PRIMARY KEY, name TEXT NOT NULL, description TEXT, address TEXT NOT NULL, city TEXT NOT NULL ); Then i created an index...

mysql,indexing,unique-index
I understand that UNIQUE KEY is a unique index and KEY is a non-unique index. I have read that in case of unique index'es inserting data might result in some IO. If we don't have to rely on the DB for unique-ness and we still want fast lookup's using column...

python,dictionary,indexing,data-structures
I have a class that inherits the dict object. my_subclassed_dict = SubclassedDictionary({ "id": {"value1": 144 "value2": "steve", "more" {"id": 114} }, "attributes": "random" }) On initialization of SubclassedDictionary, I would like paths generated which match a certain condition. Hypothetically, if I was to make this condition, 'index all numbers above...

mongodb,indexing,pymongo
I am trying to apply indexing for my mongodb collection through pymongo. I am using db[collection_name].ensure_index([("field_name" , "text"),("unique", 1), ("dropDups" , 1)]) and it works. But now how can apply it for multiple fields? Something like this db[collection_name].ensure_index([("field_name1" , "text"),("field_name2", "text"),("field_name3", "text"),("unique", 1), ("dropDups" , 1)]) I know we can...

java,indexing,uniqueidentifier,tagging,subfolder
Using Java, I am creating a program that indexes a folder structure and allows a user to search for files and also tag a file with keywords and then search for files based off of those tags. I have been traversing through the folder hierarchy using the FileUtils listFiles method...

javascript,node.js,mongodb,indexing,mongoose
I am trying to add an index to a certain Schema with mongoose for text searches. If I add a text index to individual fields it works fine, also with compound indexes it is okay. For example the answer provided here is great: Full text search with weight in mongoose...

python,indexing,theano
Supposing I have a vector in Theano and some of the elements are inf, how do I remove them? Consider the following example: import numpy as np import theano from theano import tensor vec = tensor.dvector('x') fin = vec[(~tensor.isinf(vec)).nonzero()] f = theano.function([vec], fin) According to the Theano documentation, this should...

indexing,neo4j,lucene
I have a graph that has only Schema indexes and not legacy indexes as Neo4j documentation recommends. I want to search for nodes like in this example described under the legacy indexing section (exact match, start queries etc). I am wondering if this is possible with schema indexes and if...

matlab,indexing
I have a variable est which is 20x1 double, something like this: 12 15 68 85 0 25 3 ... and variable k which is also 20x1 double consisting of 0, 1, or 2, something like this: 1 2 0 1 0 0 2 ... I would like to change...

arrays,database,performance,postgresql,indexing
According to Can PostgreSQL index array columns?, PostgreSQL can index array columns. Can it do searches on an array column as efficiently as it does for non array types? For example, suppose you have a row from a questions table (like SO): title: ... content:... tags: [ 'postgresql', 'indexing', 'arrays'...

python,list,loops,for-loop,indexing
list_1 = ['a', 'a', 'a', 'b'] list_2 = ['a', 'b', 'b', 'b', 'c'] so in the list above, only items in index 0 is the same while index 1 to 4 in both list are different. also, list_2 has an extra item 'c'. I want to count the number of...

oracle,indexing,sqlplus
I think its wrong question ,but its a university project assignment .. The question : I want to find tables without indexes in Oracle with select statement in SqlPlus. Thanks for helping.....

python,csv,indexing,pandas
I have data that sorts a csv by using groupby and then plots the information. I used a small sample of information to create the code. It ran smoothly and so then I tried running it with the huge file of data. I am pretty new at Python and this...

python,arrays,matlab,numpy,indexing
I have the following section of Python: for j in range(0,T): for x in xrange(len(index)): for y in xrange(x+1,len(index)): if index(y) == index(x): continue For which I have been attempting to translate successfully from a MATLAB equivalent. In matlab, this operation is simple as follows: for iter = 1:T for...

mongodb,indexing
How could we make MongoDB report errors for queries that don't use indices? We end up creating indices for every query anyway so it would be great if MongoDB would report missing indices for us. Also it would be convenient to be able to configure the restriction on a connection...

python,list,indexing,nodes
I'm trying to assign classes to a list of nodes, and separate all nodes into separate lists based on class tag. For example, if we have the following code: #define number of classes MaxC=5 index=[4 4 5 1 4 1 4 5 4 4 3 1 3 3 1 1]...

python,indexing,pandas,sum,dataframes
Let's assume I have a pandas dataframe df as follow: df = DataFrame({'Col1':[1,2,3,4], 'Col2':[5,6,7,8]}) Col1 Col2 0 1 5 1 2 6 2 3 7 3 4 8 Is there a way for me to change a column into the sum of all the following elements in the column? For...

python,indexing,arduino
So I am trying to get from my arduino some resource values and some id's , and I can't figure out how to solve this. I haven't played with python, this is my first time, so it is have to be something easy ... this is my python program import...

search,indexing,elasticsearch
ElasticSearch returns me "No query registered for [likes_count]" error when trying to look up entries using the following query. The field likes_count is a new field of documents and does not exist in every document. The same query works without the sort part. Why does this error appear? Thanks {...

java,indexing,solr,lucene,full-text-search
I have worked upon Lucene before and now moving towards Solr. The problem is that I am not able to do Indexing on Solr as fast as Lucene can do. My Lucene Code: public class LuceneIndexer { public static void main(String[] args) { String indexDir = "/home/demo/indexes/index1/"; IndexWriterConfig indexWriterConfig =...

table,indexing,plsql,insert,value
I can't put my value of v_emp into my emp_table. It is all going wrong at this line: emp_table(counter) := v_emp; The error that i get is: invalid use of type name of subtype name I can't see what the problem is.. CREATE OR REPLACE PROCEDURE laatste_emp IS v_emp employees%ROWTYPE;...

excel,vba,excel-vba,indexing
I have a code that works, but I want to add some more functionality to it. It currently does what it is supposed to do, and has sped up some processes, but now I think it can be sped up even more. I am using the solution that I marked...

arrays,indexing,elements
I have 4 very large arrays, a, b, c, and d of the same size. I have selected specific elements in 'a', and I need the corresponding elements from b, c, and d (i.e. if I select an element from 'a' want the elements from the other arrays that have...

indexing,neo4j
I am using Neo4j-server and I am trying to find a way to configure a legacy index either with cypher or with a property. So far to enable the legacy indexing I just uncommented the related line in neo4j.properties file. How can I apply some of the configurations listed here...