indexing

Matlab multiplied iterator for array index inside parfor - slicing

拟墨画扇 提交于 2020-01-03 03:57:08
问题 Is it possible to slice 3'rd line (tt)? This code is simplified, but the problem is similar. I am using multiplied iterator (3*i) in array index, however it doesn't work. Maybe it is possible to change it somehow. parfor i = 1 : NE tmp = i * [1, -1; -1, 1]; tt(3*i-1:3*i+1) = tmp([3,2,4]); pp(i) = tmp(1,1,i); end; Thanks :) 回答1: To be a sliced output variable, tt must be indexed using literally only the loop variable i , and other constant terms (including : ). Perhaps you can make tt

PHP ElasticSearch how to set mapping before indexing records?

对着背影说爱祢 提交于 2020-01-03 03:55:08
问题 I'm using laravel and elasticsearch-php to index and store data to elastic, my problem is that elastisearch uses from dynamic mapping but I need to set my custom mapping. How can I use from my mapping? Bellow is my code: $client = \Elasticsearch\ClientBuilder::create()->build(); $mappingData = array( 'index' => 'promote_kmp', 'body' => array( 'mappings' => $resource->getMappingProperties() ) ); $client->indices()->create($mappingData); $params = [ 'type' => 'resources', 'id' => uniqid(),

Excel Find the largest partial value in an indexed list

[亡魂溺海] 提交于 2020-01-03 02:54:13
问题 I am working with excel and trying to find if a portion of one cell matches anything from a list. I am attempting to extract that part of the cell as my result. The formula I am working with is: {=INDEX($A$1:$A$10,MATCH(1,COUNTIF(B1,"* "&$A$1:$A$10&"*"),0))} note: had to space out the asterisk to avoid italics A1 to A10 is the list i am referencing and anything in column B is what I am searching partail parts for in the list The problem is the formula return the most common value found in the

Elasticsearch queries on “empty index”

你离开我真会死。 提交于 2020-01-03 02:34:25
问题 in my application I use several elasticsearch indices, which will contain no indexed documents in their initial state. I consider that can be called "empty" :) The document's mapping is correct and working. The application also has a relational database that contain entities, that MIGHT have documents associated in elasticsearch. In the initial state of the appliation it is very common that there are only entities without documents, so not a single document has been indexed, therefore "empty

TitanDB not using indexes for query

本秂侑毒 提交于 2020-01-03 01:51:22
问题 I have created indexes on two properties: mgmt.buildIndex("userId", Vertex.class).addKey(mgmt.makePropertyKey("userId").dataType(Integer.class).make()).buildCompositeIndex(); mgmt.buildIndex("firstNameIndex", Vertex.class).addKey(mgmt.makePropertyKey("firstName").dataType(String.class).make()).buildCompositeIndex(); On Gremlin shell i can see the indexes have been created: g.getIndexedKeys(Vertex.class) ==>userId ==>firstName Now when i so query on vertices like simplest one: gremlin> g.V()

Duplicate key error with mongodb 2dsphere unique index

懵懂的女人 提交于 2020-01-03 01:50:14
问题 I try to inserts geo points to mongodb with 2dsphere unique index, but it raises many duplicate key error. A simple reproduce demo: > version() 2.4.5 > use geo > db.test.ensureIndex( { loc : "2dsphere" }, unique=true ) > db.test.insert({"loc" : { "type" : "Point", "coordinates" : [ 113.3736642, 23.04469194 ] }}) > db.test.insert({"loc" : { "type" : "Point", "coordinates" : [ 113.3734775, 23.04609556 ] }}) E11000 duplicate key error index: geo.test.$loc_2dsphere dup key: { : "1f22000102222113"

Programmaticaly prevent Vista desktop search (WDS) from indexing pst files placed on mapped network drives

限于喜欢 提交于 2020-01-02 21:09:53
问题 After several days and multiple attempts I didn't find any 100% solution for this trouble. My search and investigation scopes: Direct access to registry: HKLM\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules HKCU\Software\Microsoft\Windows Search\Gather\Windows\SystemIndex\Protocols\Mapi HKLM\SOFTWARE\Microsoft\Windows Search\Gather\Windows\SystemIndex\Sites\ and other keys... Windows Search 3.X interfaces like ISearchManager using Microsoft.Search

recursive replacement in R

◇◆丶佛笑我妖孽 提交于 2020-01-02 18:05:07
问题 I am trying to clean some data and would like to replace zeros with values from the previous date. I was hoping the following code works but it doesn't temp = c(1,2,4,5,0,0,6,7) temp[which(temp==0)]=temp[which(temp==0)-1] returns 1 2 4 5 5 0 6 7 instead of 1 2 4 5 5 5 6 7 Which I was hoping for. Is there a nice way of doing this without looping? 回答1: The operation is called "Last Observation Carried Forward" and usually used to fill data gaps. It's a common operation for time series and thus

Fulltext and composite indexes and how they affect the query

北战南征 提交于 2020-01-02 17:16:44
问题 Just say I had a query as below.. SELECT name,category,address,city,state FROM table WHERE MATCH(name,subcategory,category,tag1) AGAINST('education') AND city='Oakland' AND state='CA' LIMIT 0, 10; ..and I had a fulltext index as name,subcategory,category,tag1 and a composite index as city,state ; is this good enough for this query? Just wondering if something extra is needed when mixing additional AND 's when making use of the fulltext index with the MATCH/AGAINST. Edit: What I am trying to

Fulltext and composite indexes and how they affect the query

非 Y 不嫁゛ 提交于 2020-01-02 17:16:35
问题 Just say I had a query as below.. SELECT name,category,address,city,state FROM table WHERE MATCH(name,subcategory,category,tag1) AGAINST('education') AND city='Oakland' AND state='CA' LIMIT 0, 10; ..and I had a fulltext index as name,subcategory,category,tag1 and a composite index as city,state ; is this good enough for this query? Just wondering if something extra is needed when mixing additional AND 's when making use of the fulltext index with the MATCH/AGAINST. Edit: What I am trying to