Questions tagged [overlap]

Two or more elements overlap when they partially or totally cover one another.

Two or more elements overlap when they partially or totally cover one another.
The way to find if the elements overlap or not is to test if one elements begins before the second one ends, while the second one begins before the first one ends.

For example, here are all of the ways two lines can overlap:

1.
s1|--------|e1
s2|--------|e2


2.
s1|-------|e1
     s2|--------|e2


3.
     s1|--------|e1
s2|--------|e2


4.
s1|-------------------|e1
     s2|--------|e2


5.
     s1|--------|e1
s2|-------------------|e2

Note that s1 is always smaller than e2, while s2 is always smaller than e1.

This is not the case when the two lines do not overlap:

1.
s1|--------|e1
                 s2|--------|e2


2.
                 s1|--------|e1
s2|--------|e2

Note that either s1 is bigger then e2 or s2 is bigger then e1.

The actual data type of the elements is completely irrelevant as long as it's comparable.

Therefore, to check if two elements overlap each other, all you need to do is this: (pseudo code)

If a.Start < b.End AND b.Start < a.End Then
    Overlap
Else
    No overlap
1905 questions
21
votes
4 answers

CSS: DIV containing no height on float set

Given the following code:
content1
content2 …
Ariyan
  • 14,760
  • 31
  • 112
  • 175
21
votes
4 answers

reversing z-index based from page render order

Example Markup:

Trigger

This is some content

Trigger

This is some content

Trigger

This is…
DA.
  • 39,848
  • 49
  • 150
  • 213
19
votes
2 answers

Find overlapping date ranges in PostgreSQL

Is this correct? SELECT * FROM contract JOIN team USING (name_team) JOIN player USING(name_player) WHERE name_team = ? AND DATE_PART('YEAR',date_join)>= ? AND DATE_PART('YEAR',date_leave)<= ? My table contract has the player…
aocferreira
  • 673
  • 2
  • 8
  • 15
18
votes
4 answers

How can i overlap list item on each other in android jetpack compose?

I want to implement this ui. How can i overlap post list item on each other in android jetpack compose?
18
votes
4 answers

Percentage Overlap of Two Lists

This is more of a math problem than anything else. Lets assume I have two lists of different sizes in Python listA = ["Alice", "Bob", "Joe"] listB = ["Joe", "Bob", "Alice", "Ken"] I want to find out what percentage overlap these two lists have.…
OneManRiot
  • 941
  • 3
  • 8
  • 22
18
votes
3 answers

Maven-shade-plugin, uber-jar and overlapping classes

I would like to use Maven-shade-plugin to create uber-jar. But when I call mvn package command Maven reports that there are some overlapping classes. I am attaching all problematic overlapps, some of them are caused because older and new verion of a…
user2148736
  • 1,283
  • 4
  • 24
  • 39
18
votes
6 answers

UISearchBar overlaps status bar in iOS

I (just like everyone else here) am running into the same Status Bar overlap issue that everyone else is, with a little twist, and that is why I opening a new question about this. There seems to be some mechanism that lets the UISearchBar know…
Fotis Paraskevopoulos
  • 1,001
  • 2
  • 12
  • 19
16
votes
2 answers

Understanding Overlap and Add for Filtering

I am trying to implement the overlap and add method in oder to apply a filter in a real time context. However, it seems that there is something I am doing wrong, as the resulting output has a larger error than I would expect. For comparing the…
st-h
  • 2,444
  • 6
  • 37
  • 60
16
votes
5 answers

Collapse rows with overlapping ranges

I have a data.frame with start and end time: ranges<- data.frame(start = c(65.72000,65.72187, 65.94312,73.75625,89.61625),stop = c(79.72187,79.72375,79.94312,87.75625,104.94062)) > ranges start stop 1 65.72000 79.72187 2 65.72187 …
Liza
  • 1,066
  • 2
  • 16
  • 26
14
votes
6 answers

First view above / overlapping second in LinearLayout

Is it possible to show the first view in a LinearLayout overlapping the second? I would like to layout my views like so:
RileyE
  • 10,874
  • 13
  • 63
  • 106
14
votes
1 answer

Wykobi - Error: Explicit instantiation shall not use ‘inline’ specifier [-fpermissive]

I am trying to make / compile wykobi library (computational geometry) using the given makefile, but I keep getting the error: error: explicit instantiation shall not use ‘inline’ specifier [-fpermissive] How can I solve this?
Harsha Rama
  • 349
  • 2
  • 5
  • 11
14
votes
2 answers

Merge overlapping ranges into unique groups, in dataframe

I have a dataframe of n rows and 3 df <- data.frame(start=c(178,400,983,1932,33653), end=c(5025,5025, 5535, 6918, 38197), group=c(1,1,2,2,3)) df start end group 1 178 5025 1 2 400 5025 1 3 983 5535 2 4 1932 6918 …
user1560292
  • 217
  • 4
  • 7
13
votes
3 answers

Avoid overlapping axis labels in R

I want to plot data in a graph with larger font-size for the lables. x = c(0:10) y = sin(x) + 10 plot ( x, y, type="o", xlab = "X values", ylab = "Y values", cex.axis = "2", cex.lab = "2", las = 1 ) Unfortunately the…
R_User
  • 10,682
  • 25
  • 79
  • 120
13
votes
8 answers

Subtract Overlaps Between Two Ranges Without Sets

NO SETS! I can't use Sets because: The ranges will be too long. They will take up too much memory The creation of the sets themselves will take too long. Using only the endpoints of the of the ranges, is there an optimal way to subtract two lists…
sequenceGeek
  • 767
  • 1
  • 8
  • 20
13
votes
7 answers

When screen size made smaller bootstrap tabs are overlapping

When screen size made smaller bootstrap tabs are overlapping like image. I used col-sm and my angular HTML is like this (but any non-angular HTML solution is fine too):
Kle
  • 1,003
  • 2
  • 14
  • 24