overlap

Overlapping intervals and the amount of overlaps

怎甘沉沦 提交于 2019-12-13 19:24:52
问题 This question might be similar to others but is a bit different. Let's say we have a set of intervals that goes like this let's say A-9 are numbers but for the sake of formatting I used letters): <-a---> <------c---> <------------MAIN> ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 <--d-> <--b-------> So we have the Main interval which goes from I to Z , the interval a that goes from M to S and so on. Now I want to have the intervals where I have the most overlaps WITHIN the main one (which is

R - output overlapping intervals

你。 提交于 2019-12-13 16:53:17
问题 fileA contains intervals (start, end), and a value assigned to that interval (value). start end value 0 123 1 #value 1 at positions 0 to 122 included. 123 78000 0 #value 0 at positions 123 to 77999 included. 78000 78004 56 #value 56 at positions 78000, 78001, 78002 and 78003. 78004 78005 12 #value 12 at position 78004. 78005 78006 1 #value 1 at position 78005. 78006 78008 21 #value 21 at positions 78006 and 78007. 78008 78056 8 #value 8 at positions 78008 to 78055 included. 78056 81000 0

Find the duration of overlap between pairs of timestamps using data.table

和自甴很熟 提交于 2019-12-13 15:13:52
问题 Similar to this question, I'd like to find the duration of overlap between pairs of timestamps using data.table . Here's my current code: library(data.table) DT <- fread( "stage,ID,date1,date2 1,A,2018-04-17 00:00:00,2018-04-17 01:00:00 1,B,2018-04-17 00:00:00,2018-04-17 00:20:00 1,C,2018-04-17 00:15:00,2018-04-17 01:00:00 2,B,2018-04-17 00:30:00,2018-04-17 01:10:00 2,D,2018-04-17 00:30:00,2018-04-17 00:50:00", sep = "," ) cols <- c("date1", "date2") DT[, (cols) := lapply(.SD, as.POSIXct),

Grid with overlapping rows?

江枫思渺然 提交于 2019-12-13 10:52:38
问题 I'm creating a card game and I want to use a grid to position the cards (div's). How can I create a grid where the rows overlap like in this image? 回答1: I did it with floats. At least it works in all browsers. HTML: <div class="card-set"> <div class="row row-1"> <!-- 1st row --> <div class="col-1-of-10"> <div class="card"></div> </div> <div class="col-1-of-10"> <div class="card"></div> </div> <div class="col-1-of-10"> <div class="card"></div> </div> <div class="col-1-of-10"> <div class="card"

Fix my random image positioning script so the images don't overlap

狂风中的少年 提交于 2019-12-13 08:58:47
问题 I made a script (here's a fiddle that builds upon my JS) for random positioning of <li> elements. The elements overlap each other, though. How can i modify my code so the items don't overlap anymore? This is the script: var images = []; function init() { $('.friend-selection li > div').each(function(){ var id = this.id; var img = $('#img_' + id); var randomTop = 500*Math.random(); //random top position var randomLeft = 500*Math.random(); //random left position $("#parent_" + id).css({ //apply

Two backgrounds with overlapping slider/carousel and navigation with Bootstrap

坚强是说给别人听的谎言 提交于 2019-12-13 06:23:59
问题 Basically, I'm trying to get my nav/slider combo to overlap on two different color backgrounds where you can resize the browser width and it displays correctly. You can view the current site/code here: http://bobbyomari.com/opa Here is a jsfiddle of the isolated nav . There are a few issues I have: When the nav collapse button appears and you click on it, the slider drops down below the nav menu. I just want that dropdown nav toggle to overlap on the slider, not push the slider down. The body

How to filter overlap rows in a big file in python

给你一囗甜甜゛ 提交于 2019-12-13 06:03:10
问题 I am trying to filter overlap rows in a big file in python.The overlap degrees is set to 25%. In other words,the number of element of intersection between any two rows is less than 0.25 times of union of them.if more than 0.25,one row is deleted.So if I have a big file with 1000 000 rows in total, the first 5 rows are as follows: c6 c24 c32 c54 c67 c6 c24 c32 c51 c68 c78 c6 c32 c54 c67 c6 c32 c55 c63 c85 c94 c75 c6 c32 c53 c67 Because the number of element of intersection between the 1st row

Overlapping call durations

六眼飞鱼酱① 提交于 2019-12-13 05:26:59
问题 Is there a way to work out if a call overlaps another call already in progress. For example I have a call that comes in at 10:00 and ends at 10:05 . Second call comes in at 10:02 and ends at 10:06 so is overlapping the first calls, how could I show this in a sql query? I have a few thousand calls to compare. Table I have uses CallID, TimeAns, TimeFin Any suggestions welcome. 回答1: Here is non-inclusive query: SELECT * FROM myCalls t1 INNER JOIN myCalls t2 on t2.CallID != t1.CallID AND t1

Python - Determine overlaps of 3 ranges

大城市里の小女人 提交于 2019-12-12 20:26:15
问题 I had a question regarding how I should go about determining overlaps of three ranges in Python without using any existing libraries : For instance if I have three ranges as (10,20)(15,25)(18,30), how should I go about finding overlaps between them ? My answer should be (18,19,20) Any help would be much appreciated. Thanks ! 回答1: The overlap goes from the highest start point to the lowest end point: ranges = [(10,20), (15,25), (18,30)] starts, ends = zip(*ranges) result = range(max(starts),

how to use neato with spline and avoid mutual edges overlapping?

三世轮回 提交于 2019-12-12 18:40:19
问题 I have a directed graph with ~20 nodes that I need to have their positions fixed. So, I'm using neato to generate my svg file. The problem is that if I use the straight lines, I have edges overlapping some of the nodes. If a set -Gsplines=true -Gsep=1 the edges avoid the nodes nicely but them the mutual nodes (that is, nodes from a -> b and b -> a) are displayed on top of each other... Below is a piece of it, for example, where edges 9 -> 12 and 12 -> are completely overlapped. Does anyone