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

Obtain the specific range that overlap

I have two dataframes: cnv_1 chr start end 3 62860387 63000898 12 31296219 31406907 14 39762575 39769146 19 43372386 43519442 19 56419263 56572829 cnv_2 chr start end 6 30994163 30995078 19 43403531 …
0
votes
0 answers

How to deal with overlapping values in c++?

I'm currently trying to solve a programming problem that involves different ranges of values that overlap. The task is to accept input, in E-notation, and that is where the overlap of range inevitably occurs. I have 2 ranges that overlap at 1E-11.…
Yuki Mori
  • 1
  • 1
  • 2
0
votes
0 answers

Images in CollectionViewCell overlap after scrolling

Whenever I scroll images start overlapping. How can I fix this? import UIKit class ViewController: UIViewController { var collectionView : UICollectionView! let images = [#imageLiteral(resourceName:…
이재진
  • 11
  • 1
0
votes
1 answer

Make list group overlap with div

Can someone help me make my list group overlap with a
that contains a paragraph whenever a user types text in an input box? I tried making the
    element position:relative and the paragraph position:absolute but without success... Here is…
Trung Tran
  • 13,141
  • 42
  • 113
  • 200
0
votes
0 answers

How to embed multiple youtube videos without overlapping videos and audios playing at the same time?

I want to embed multiple youtube videos on one single page. Users click on the first top video to play the video, they decide they don't want to watch anymore, so they click on the second bottom video to play that one, but the first video is still…
user2343800
  • 133
  • 1
  • 4
  • 16
0
votes
0 answers

class members overlaps global variables

I'm working on a bad behaviour of my application ... I've recently upgraded my g++-4.1 to g++-4.8 and I'm experiencing memory overlaps between private members of some class instances and some variables globally defined in the main source. Trapping…
0
votes
1 answer

Prevent overlapping docked elements

Having a element docked in "fill" mode, another one on "right": Expected: _________________________ | || 2 | | 1 ||_________| | | |_____________| Got _________________________ | | 2 | | …
nicolallias
  • 1,055
  • 2
  • 22
  • 51
0
votes
3 answers

Prevent layouts from overlapping

I am including 2 layouts on my activity xml, now I want the second layout to not to overlap the first one but I do not really manage to do it.... Attached is my xml. How can I achieve this?
Marny Lopez
  • 161
  • 2
  • 16
0
votes
0 answers

How to prevent values of x axis points from overlapping each other when Graph has more than one series.?

Couldn't show the value of point on the red line which is covered black circle. Probably, near points are squishing each other. Is there a solution for fixing this ? Showing it in tooltip not a solution for my task.
0
votes
1 answer

Highcharts - linear chart hidden in combination of graphs

The highcharts examples and a combination of graphs, work great for lines and graphs. They also seem to overlap nicely. However, when I move the linear graph to show first, it gets 'hidden' behind the rest of the graphs. [] or Moving the 'line'…
Loser Coder
  • 2,338
  • 8
  • 42
  • 66
0
votes
0 answers

Android Horizontal Gridview item overlap each other

Hi everyone I am making capture image display on horizontal gridview But I have got some problem . The gridview item contains image , but items overlap each other How can I do it here is my code
gkhngngr
  • 25
  • 5
0
votes
3 answers

Cannot get element to overlap another

I have a Divi WordPress website http://linden.flywheelsites.com and I'm trying to get element ID "atlas_menu1" to overlap all other elements on the page. Somehow the element "et-page-area" or "main-content" still overlap the atlas_menu1. Can anyone…
Matthew Walker
  • 193
  • 1
  • 15
0
votes
2 answers

Overlap two Divs hides contents

We overlap two Divs using "postion:absolute" and z-index. http://jsfiddle.net/z5GXV/ The text in the green zone (div id="Zone2") is hide by text in the yellow zone (div id="Zone3"). Any help on how to display the text? Edit1: We can't use nested…
Malik
  • 347
  • 1
  • 11
  • 29
0
votes
1 answer

Overlap two Divs using float

I need to create following page layout using Divs. http://jsfiddle.net/6Lanq/ (please use horizontal and vertical scrollbar to see the exact picture. we have four zones) I accomplished it using nested divs and float but nested divs are not what is…
Malik
  • 347
  • 1
  • 11
  • 29
0
votes
1 answer

SQL to remove time overlaps between two tables

I have two tables. Each table has two fields: from_date and to_date. I need to find all the records in table A that do not overlap records in table B. I am using MSSQL 2008. CREATE TABLE Table_A(from_date datetime , to_date datetime ) CREATE TABLE…
user1480192
  • 665
  • 8
  • 23