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
6
votes
2 answers

Excel XY Chart (Scatter plot) Data Label No Overlap

So I've been working on this for the past week. Although it can't do miracles, I can say I've got a pretty good result: I just wanted to put this code out there for all the poor souls like me that are looking for some kind of vba macro that helps…
Schadenfreude
  • 1,522
  • 1
  • 20
  • 41
6
votes
3 answers

How does one overcome overlapping points without jitter or transparency in ggplot2

I am starting to use ggplot2. I have some small n (about 30 or so) granular data with lots of overlap. Neither jitter nor alpha (transparency) are suitable. Instead a stripchart with stack and offset do it best but I do not know how to do it in…
Farrel
  • 10,244
  • 19
  • 61
  • 99
6
votes
2 answers

How to call DeviceIOControl code asynchronously?

I am trying to call DeviceIO functions asynchronously by using the OVERLAPPED structure as described on MSDN. I am using the FSCTL_ENUM_USN_DATA control code to enumerate the MFT of NTFS drives but i am not able to run it asynchronously. The file…
6
votes
4 answers

How to check overlapping among multiple date ranges in PHP?

There are many posts about checking overlapping between two dates. However I couldn't find any which talks about how to check among multple ranges. Say I have this array: $ranges = [ array('start'=>'2014-01-01' , 'end'=>…
Aladdin Mhemed
  • 3,817
  • 9
  • 41
  • 56
6
votes
0 answers

Avoid label overlap python igraph

I'm using python igraph and many of my charts are plotted with pesky overlapping labels. I found an rpackage solution in this thread (Plotting clusters of nominal data in R) but that is for R Package. Here is an example of what I'm getting. The…
Chris Hall
  • 871
  • 6
  • 13
  • 21
6
votes
2 answers

CSS overlapping elements without absolute positioning

I want a parent class (ul tag) to hold a bunch of li tags to that overlap each other, here is my code:
  • Overlap One
  • Overlap Two
  • Overlap Three …
Abdullah Bakhsh
  • 658
  • 1
  • 9
  • 15
5
votes
1 answer

primefaces menu cant fully display out in fullpage layout

few days ago i ask 1 question in primefaces forum but nobody reply me. I facing a problem while using in fullpage layout(position="west"), the submenu can't fully display out. Can make it display overlap to the (position="center") as I don't wish…
heng heng
  • 693
  • 3
  • 13
  • 25
5
votes
7 answers

Need generic div css that does not overlap (like a table)

I'm trying to use divs instead of tables to style boxes around my content. The content can be any size and needs to allow the browser to be resized to any degree. Need the background color and border to contain the content. This works fine with…
fcs
  • 78
  • 1
  • 1
  • 7
5
votes
0 answers

How to reproduce the same logical reasoning about overlapping contours on a triplot joint distribution

I have the following figure whose I want to apply the same logical reasoning for plotting all the contour and content of different ellipses (identified by a color). In this example, there are 4 matrices plotted instead in my case below, I have 5…
user1773603
5
votes
2 answers

Creating a filled rectangle within an array in Julia

I am new to Julia, and I am trying to understand basic data visualization. I am creating a 2D array of noise with: xRange, yRange = 1:1:300, 1:1:300 maxVal = 0.3 noiseArr = rand(length(xRange),length(yRange))*maxVal The resulting array is shown…
AaronJPung
  • 1,105
  • 1
  • 19
  • 35
5
votes
4 answers

Detect overlapping of rectangular prisms

Given a 3D coordinate system and rectangular prisms with a non-negative starting point and a non-negative size (e.g. starts at (0, 2, 5) and has a size of (9, 20, 5)): how can I best check if another rectangular prism intersects with one of the…
Samuel
  • 18,286
  • 18
  • 52
  • 88
5
votes
1 answer

How to identify rows that occur within a specific time frame?

I have a table that contains hospital visits for patients. I am trying to flag visits that occur within 90 days of the previous visit. However, the caveat to this is that once a visit is flagged as an overlap visit, that visit should not be used to…
CandleWax
  • 2,159
  • 2
  • 28
  • 46
5
votes
4 answers

Bottom Navigation View overlaps last item of RecyclerView

The last item of RecyclerView is being overlapped by BottomNavigationView. The description and time is being overlapped by BottomNavigationView. framgment_news.xml: This contains my RecyclerView
5
votes
1 answer

Tabwidget overlaps with my activity content

after spending 2 solid days searching for an answer, I would like to ask for help about the following behaviour. I'm trying to code a simple tabhost application on Android, with a layout per activity. I've designed my layout so that the tabwidget…
Adam Dulson
  • 283
  • 5
  • 16
5
votes
6 answers

Merging Overlapping Intervals in Python

I am trying to solve a question where in overlapping intervals need to be merged. The question is: Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. I…
mourinho
  • 763
  • 6
  • 13
  • 24