## spatial element count data structure eg: R-Tree, with filtering

Background: The application is a web map application with a LeafletJS front-end and NodeJS back-end with Postgres database. The application is to be used on both desktops and smartphones/ tablets in the field. The map should visualise ~30K polygons whose number grows by ~3k per year. The data set has insertions and deletions less than once every 12 hours but has queries constantly. At all zooms, a representation of the entire spatial data set should be available. At lower zooms a cluster or heatmap representation is ideal. At high zooms the individual polygons should be visible. The main issue is that the data set count represented by clustering must also be filterable by a finite number of sets each with finite number of options membership (year, type of survey etc.)

A naive implementation would be to calculate the centre/ centroid/ pole-of-inaccessibility of each polygon along with its set options and send these to a standard Leaflet clustering library on the client side to visualise when below a threshold zoom level, and to send the polygons themselves when above a zoom level. The client-controlled filter would iterate through each layer in the cluster or polygon set.

It seems to me that a better cluster would be to build a R-Tree server-side and at each node level include the total child count, then on the client-side each cluster is represented as this child count at the centre of its node’s bounding box. Above the threshold zoom, polygons for that area are also stored in a client-side R-Tree to avoid querying the database for areas that have been traversed more than once.

(A) Is this a sensible data structure and method of representing clusters?

(B) How can it be extended to compute child count of subsets at different levels of zoom, such as calculating the count of every exclusive set at each level? (eg: count of elements in years x1 to x2 and survey type a,b,c, not d)

## Number of steps – Count Change Procedure

I don’t know if this is dupp question, i’ve already seen some explanations on why the procedure below is equal to $$\theta(n^d)$$ in terms of time complexity, being $$d$$ the number of coins. My question here resides on the exact number of steps required by this procedure when, e.g, $$d=2$$.

Being known that for $$d=1$$, the number of subtrees generated is equal to $$(2n+1)$$ and that for $$d=2$$, (cc n 2) initially generates two subtrees, (cc n 1) and (cc n-d 2). To get the total number of steps, I know that we have $$1 + (n/5) + (..)$$. I’m with doubts as how I can express the rest of the expression, more precisely the number of subtrees generated by (cc n 2) with 1 coin as they are subtracted, until it reaches the limit $$(n/5)$$, being $$5$$ the denomination of the coin when there are two types of coins available.

 (define (count-change amount)    (define (cc amount kinds-of-coins)      (cond ((= amount 0) 1)            ((or (< amount 0) (= kinds-of-coins 0)) 0)            (else (+ (cc (- amount                            (first-denomination kinds-of-coins))                         kinds-of-coins)                     (cc amount                         (- kinds-of-coins 1))))))    (define (first-denomination kinds-of-coins)      (cond ((= kinds-of-coins 1) 1)            ((= kinds-of-coins 2) 5)            ((= kinds-of-coins 3) 10)            ((= kinds-of-coins 4) 25)            ((= kinds-of-coins 5) 50)))    (cc amount 5)) 

Can anyone help? Thank you in advance.

## How can i count the total logged in time in PHP?

I need to make a website for school with PHP and in this website i need to count how long a person is logged in.

For example you are logged in for 1 minute and you go to another page then you need to see in the top of the page

Logged in for : 3 minuntes 20 secondes

if you refresh the page or go to another one the time needs to be refreshed and show the total amount of time you are logged in

I searched up allot of things but i couldn’t find what i was looking for.

i tried this

## What unforeseen consequences come from allowing corpses to count as creatures?

There have been quite a few questions about corpses and creatures, such as here where it is argued a dead creature is still a creature, here where the opposite is argued, and here where resurrecting an animated corpse is up in the air.

My question however, is if you allow spells, and other features, which target creatures to also target corpses (dead creatures), what are some possibly negative or game-ending/breaking effects that would occur from this houserule?

## What unforeseen consequences come from allowing corpses to count as creatures?

There have been quite a few questions about corpses and creatures, such as here where it is argued a dead creature is still a creature, here where the opposite is argued, and here where resurrecting an animated corpse is up in the air.

My question however, is if you allow spells, and other features, which target creatures to also target corpses (dead creatures), what are some possibly negative or game-ending/breaking effects that would occur from this houserule?

## any path of graph,say (a,b) (a to b) intersects a given path (x,y) at exactly one node.Then, count no. of total possible (a,b)

Let’s denote the sets of vertices in the paths (u,v) and (a,b) by S1 and S2 respectively (a path contains its endpoints too). The path (a,b) intersects perfectly with (u,v) if |S1∩S2|=1, i.e. these paths have exactly one common vertex.

For example in the given graph1]1, let (x,y) = (4,5) and now consider (a,b) as any path of the graph, say (a,b) = (1,3) So, S1 = {4, 1, 2, 5} and S2 = {1, 3} So, S1∩S2 = {1} => |S1∩S2|=1 so for (x,y): all possible (a,b) of the graph will be (4,4),(1,1),(2,2),(5,5),(1,3),(2,6) so the answer will be 6 for (x,y) = (4,5)

So, is there any efficient way to find.

## Result count mismatch on search api autocomplete

We are using search api module and search api solr as databse server. We created result page using views and it has expose form. And in the expose form, we enable autocomplete.

The problem is we search search with a word e.g. ‘performance‘, in autocomplete it is suggesting two result ‘performance,‘ with 25 count and ‘performance.‘ with 11 count and when I select one of this and do the search, it’s showing total 41 result. So here is confusing, if ignore the special chars like ‘,’ and ‘.’ here and make the merge, it will become 36 which is not same as total count.

Note: I am doing fulltext search and configured same field in views and autocomplete.

So am I missing anything there or is there any issue? Or is this way it work, it will be big help if anyone could explain here?