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

Need to select records that have overlapping date ranges for same product groupings

create table #productcov ( [group] varchar(20), -- as business account varchar(10), -- as business location member varchar(10), -- as member product varchar(10), -- as health product [plan] varchar(10), -- as product type StartTime…
LASQL
  • 1
  • 2
0
votes
1 answer

Why am I unable to add a button along with rendering in my jpanel, they overlap

This is the code of my main class for the game of Pong and it works fine till I add the instruction button. When I add the instruction button the screen no longer shows anything other than the button. package pongg; import…
K.K
  • 1
0
votes
1 answer

Changing contents of EditBox while processing an Event handler in VC++ mfc

When I press a button in VC++, the program starts reading data from USB which takes several minutes to be completed. During this operation I want to show the status of the progress in an edit box in the same Dialog using…
0
votes
1 answer

UISearchController searchbar overlaps CollectionView

When launching UISearchController programatically the UISearchBar overlaps CollectionView below. I've searched here and there and seems that no one had this kind of problem before. There are some limitations on how i can and cannot do it: cannot…
gutaker
  • 181
  • 3
  • 10
0
votes
2 answers

Make a placeholder div overlappable dynamically

I'm using a jQuery UI accordion as a menu on the right side of a page. However, there are occasions where the menu will be taller than the content on the left. Because of this, when expanding/contracting sections of the accordion, the scrollbar on…
David Savage
  • 1,562
  • 2
  • 18
  • 35
0
votes
2 answers

Count number of shared observations between samples using dplyr

I have a list of observations grouped by samples. I want to find the samples that share the most identical observations. An identical observation is where the start and end number are both matching between two samples. I'd like to use R and…
user964689
  • 812
  • 7
  • 20
  • 40
0
votes
3 answers

Create 2-element rows from flat array where the every second row value is also the first value of the next row

$arrayinput = array("a", "b", "c", "d", "e"); How can I achieve the following output.... output: Array ( [0] => Array ( [0] => a [1] => b ) [1] => Array ( [0] => b [1] => c ) [2]…
Yabes Nadar
  • 209
  • 2
  • 11
0
votes
1 answer

How to find the overlap between 2 cell arrays?

I want to find the overlap between this 2 cell arrays by comparing them row by row and get the overlapped rows: ex1={'BRDT','TBP';'php','alm';'BRCA1','TP53'}; ex2={'TBP','HIST1H2BH';'RB1','TK2';'php','alm'}; desire_output={'php','alm'} I have…
F.caren
  • 85
  • 1
  • 9
0
votes
1 answer

Find dates within a period interval by group

I have a panel with many IDs, begin and end dates. begin to end date create an interval of time. id begin end interval overlap 1: 1 2010-01-31 2011-06-30 2009-08-04 UTC--2011-12-27 UTC TRUE 2: 1…
user3507584
  • 3,246
  • 5
  • 42
  • 66
0
votes
1 answer

Measuring similarity/overlap of networks

Essentially, I have a spreadsheet of calls, both incoming and outgoing, for one phone number (with associated information, like time and date), which constitutes one "network". I then have a spreadsheet of both incoming and outgoing calls for a…
0
votes
3 answers

Android: Edittexts overlap eachother when I rotate the phone

I have a very simple xml file. 6 edittexts are among themselves. When I rotate the phone, they overlap. I have the 6 edittext 1) basic editttext 2) datepicker 3)timepicker 4) timepicker 5) basic edittext 6)basic edittext How can i fix this ? code is…
Berkay Berabi
  • 1,933
  • 1
  • 10
  • 26
0
votes
0 answers

Arraylist no overlapping graphics

I am creating a game program where I need to run through an array list of circle graphics set at x and y coordinates. I need to make sure that none of the circle graphics overlap each other. This is what i have and seems to work sometimes but I…
molldoll
  • 1
  • 1
0
votes
2 answers

Android Virtual Keyboard Position

I have two activity forms in Android Studio. I am trying to get it so the form will scroll and when the virtual keyboard pops up it won't cover the contents. For example: As you can see the keyboard overlaps two buttons underneith the two text…
Zack Antony Bucci
  • 571
  • 1
  • 12
  • 29
0
votes
1 answer

PostgreSQL tsrange -- overlap ignores equivalent ranges?

I have a query in my Rails app that looks like this: # Returns any records whose period intersect the specified time # @see https://www.postgresql.org/docs/9.3/static/rangetypes.html # @see…
trevorhinesley
  • 845
  • 1
  • 10
  • 36
0
votes
1 answer

Flatten overlapping sequences into a contiguous set

For a Ruby on Rails planning application I am running into an algorithm / combination problem that I have trouble solving efficiently. In my application I have 2 types of records: Availabilities (when is someone freely available, on stand-by or…
ChrisDekker
  • 1,584
  • 18
  • 39