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
0
votes
1 answer

R: ggplot2: avoid overlapping points and color formating

I am new to SO and relatively new to R so please take it easy on me! This is my scenario: I have a dataframe that has 24 meta-analytic distributions (Dist1-Dist24). For each distribution, I have seven estimates of the respective meta-analytic mean…
James F
  • 65
  • 1
  • 1
  • 5
0
votes
1 answer

Resolving overlap of instances with type families

I have a class class Monad m => MyClass m where type MyType1 m type MyType2 m ... a :: m (MyType1 m) b :: m (MyType2 m) c :: m (MyType3 m) ... and I also have bunch of instances that implement the functions (a ... )…
jakubdaniel
  • 2,233
  • 1
  • 13
  • 20
0
votes
1 answer

How to stop border-bottom width from overlapping / overflowing onto float-right div

The h1 with the border: h1 { font-size: 2.125em; border-bottom: 1px solid #aaa; width: 100%; display: block; } The float-right "Contents": div { float: right; clear: right; margin-bottom: .5em; padding: .5em 0 .8em 1.4em; …
GregariousJB
  • 159
  • 1
  • 1
  • 11
0
votes
4 answers

VBA overlapping networkdays from dates with a condition

First I'm open to do this with an other angle. I want to count the total hours of work hours estimated, see sheet2. In another sub I've calculated the total work hours (timer tot) with worksheetfunction.sum and timer FRJ/HET with…
Cobse
  • 73
  • 11
0
votes
1 answer

Overlap data on spline chart in Highcharts

I have a spline chart in Highcharts. It has data for 24 hours i.e 24 points. Now during those 24 hours, there are certain incidents that take place which i need to show as points on the spline chart. And there needs to be a tooltip for those points.…
Nikhil Tikoo
  • 365
  • 1
  • 9
  • 31
0
votes
1 answer

Prevent same color or type event overflow in Fullcalendar

I am having a bit of difficulty to find information about overflow possibilities. I know how to prevent overflow on all Fullcalndar events with eventOverlap attribute, but is there a way in Fullcalendar to prevent overlap on one type of events? For…
user3013163
  • 35
  • 1
  • 1
  • 5
0
votes
1 answer

Two overlapping rectangles

I'm having a lot of trouble figuring out what is wrong with my code. Actually, I'm having a very difficult time solving the problem of two rectangles overlapping. The following code should, theoretically, work for the following rectangles: Rect1:…
0
votes
0 answers

I want slider text on overlap my image

I am trying to overlap my text on image, but its not working on Google Chrome & Opera. And its working in Safari, Firefox & IE. I uploaded both browsers screenshots, Waiting for your helpful answers.…
0
votes
5 answers

Separate sidebar from image

I don't want the sidebar to OVERLAP image. So basically I want them, side by side, I think the problem is that I have a position: absolute; in the sidebar, but when I remove it, the sidebar and image doesn't stay in place. body { …
João Guerreiro
  • 135
  • 1
  • 2
  • 8
0
votes
1 answer

Issue with checking time ranges overlapping

Issue: overlaps? method doesn't return expect value. (start_on.to_i..end_on.to_i).overlaps?(ti.start_time.to_i..ti.end_time.to_i) It returns false, but should be true. start_on: 2016-08-19 11:00:00 +0200 end_on: 2016-08-19 12:00:00…
Prezes Łukasz
  • 938
  • 1
  • 9
  • 30
0
votes
1 answer

How to create an preferences window similar to VLC with Qt?

I want to create an preferences window somehow similar to VLC. For that purpose I added a QTreeWidget for selecting the different preferences. I want to group the QWidgets, which belong together, in a parent QWidget so I can hide them all at once. I…
honiahaka10
  • 772
  • 4
  • 9
  • 29
0
votes
1 answer

Checking overlaps between times

I try to create validation that checks times overlapping. scope :overlapping_activity, ->(activity) { where("(start_on, end_on) OVERLAPS (?, ?)", activity.start_on, activity.end_on } validate…
Prezes Łukasz
  • 938
  • 1
  • 9
  • 30
0
votes
2 answers

How can I get text to NOT overlap in Small Basic?

I need to have a graphics window that displays a message over and over again as a user clicks a button. I have looked all over the internet for instructions on how to not make it overlap. This is most likely a quick fix but idk. Plz help here is my…
0
votes
1 answer

Bootstrap 3 - I want to overlap a row across columns (with transparency)

I am attempting to duplicate the below using Bootstrap 3. If there was no grey box extending from the left over the 4 price boxes (columns) it wouldn't be an issue, but I know I could screw with this for hours before finding out I did it wrong. Any…
Paul Perrick
  • 496
  • 9
  • 22
0
votes
1 answer

Overlapping images in Matlab

I am trying to overlap a set of images in Matlab. The images are of the same object at different times. In my code: for k=1:20 % code executed with output 'image' image_rotate = imrotate(image,-90); %put dataset in correct…
a.kk
  • 71
  • 6