intervals

sql (oracle) counting number of overlapping intervals

僤鯓⒐⒋嵵緔 提交于 2019-12-23 05:05:37
问题 I have the following problem: Given the following table test in an oracle sql database: +----+------+-------+------+ | id | name | start | stop | +----+------+-------+------+ | 1 | A | 1 | 5 | +----+------+-------+------+ | 2 | A | 2 | 6 | +----+------+-------+------+ | 3 | A | 5 | 8 | +----+------+-------+------+ | 4 | A | 9 | 10 | +----+------+-------+------+ | 5 | B | 3 | 6 | +----+------+-------+------+ | 6 | B | 4 | 8 | +----+------+-------+------+ | 7 | B | 1 | 2 | +----+------+-------+

How can I group by specific timestamp intervals in C# using LINQ?

大城市里の小女人 提交于 2019-12-23 04:35:21
问题 I have a list with tick objects including a pair of a double value and a timestamp. I want to separate the list into child-lists depending on a time interval (for example 15 minutes). One list only has the tick objects from: 8:00:00 - 8:14-59 usw usw C#-code: var result = from tick in listTicks group tick by tick.timestamp.Hour; The datetime functions like day, hour, minute work fine but a specific interval wasn't possible for me. It is LINQ to objects. I have already got the list from the DB

JQuery Cycle Plugin - Delay Interval Between Slides Question

自闭症网瘾萝莉.ら 提交于 2019-12-23 03:23:39
问题 I'm using jQuery Cycle Plugin for an image slider. What I'm looking for is something like this: image1.jpg >> fadeout >> hold on the blank frame for a second >> fadein image2.jpg >> repeat How can I control the delay before the next fade animation starts, or the interval between 2 slide transitions? I mean when the first slide image completely fades out, I need it to pause for 1 or 2 seconds before the second image actually begins its fadein animation. ** I need to get this to work during

JQuery Cycle Plugin - Delay Interval Between Slides Question

你离开我真会死。 提交于 2019-12-23 03:23:28
问题 I'm using jQuery Cycle Plugin for an image slider. What I'm looking for is something like this: image1.jpg >> fadeout >> hold on the blank frame for a second >> fadein image2.jpg >> repeat How can I control the delay before the next fade animation starts, or the interval between 2 slide transitions? I mean when the first slide image completely fades out, I need it to pause for 1 or 2 seconds before the second image actually begins its fadein animation. ** I need to get this to work during

Qt seconds to DD HH SS

拜拜、爱过 提交于 2019-12-22 20:00:11
问题 using Qt 4.8 how can I print the time in the format DD HH SS? I have the seconds and I want to get back a string in that format. 回答1: QDateTime::fromTime_t(seconds).toString("ss hh DD"); see http://qt-project.org/doc/qt-5.0/qdatetime.html#toString If you want a duration ( your question was really unclear) try something like : QString seconds_to_DHMS(quint32 duration) { QString res; int seconds = (int) (duration % 60); duration /= 60; int minutes = (int) (duration % 60); duration /= 60; int

findInterval() with varying intervals in data.table R

我是研究僧i 提交于 2019-12-22 08:44:36
问题 I have asked this question a long time ago, but haven't found the answer yet. I do not know if this is legit in stackoverflow, but I repost it. I have a data.table in R and I want to create a new column that finds the interval for every price of the respective year/month. Reproducible example: set.seed(100) DT <- data.table(year=2000:2009, month=1:10, price=runif(5*26^2)*100) intervals <- list(year=2000:2009, month=1:10, interval = sort(round(runif(9)*100))) intervals <- replicate(10, (sample

Minimizing the number of boxes that cover a given set of intervals

大憨熊 提交于 2019-12-22 00:25:57
问题 this is a question for the algorithms gurus out there :-) Let S be a set of intervals of the natural numbers that might overlap and b a box size. Assume that for each interval, the range is strictly less than b . I want to find the minimum set of intervals of size b (let's call it M ) so all the intervals in S are contained in the intervals of M . Trivial example: S = {[1..4], [2..7], [3..5], [8..15], [9..13]} b = 10 M = {[1..10], [8..18]} // so ([1..4], [2..7], [3..5]) are inside [1..10] and

Weighted Interval Scheduling problem & Dynamic program

自闭症网瘾萝莉.ら 提交于 2019-12-21 21:35:49
问题 My question is related to this other discussion. I'm trying to implement that algorithm using the dynamic program into a recursive call. Problem statement: Job j starts at sj , finishes at fj ,and has weight or value vj . Two jobs compatible if they don't overlap. Goal: find maximum weight subset of mutually compatible jobs. The solution proposed by books is to use a solution table to store all suproblems which will be reused when needed during a recursive o iterative call. The steps to solve

How do you get a dynamic 12 business day view in Postgresql?

岁酱吖の 提交于 2019-12-21 20:46:44
问题 Here is the code I currently have that gives me the last 12 days SELECT * FROM table WHERE analysis_date >= current_date - interval '12' day; analysis_date is the date column in the table. I understand why this isn't working because it's not accounting for business days. How can I rewrite this so that I get an interval of the last 12 business days? I tried search online and found extract(dow from (date)) But I couldn't find an example where I need a weekday interval. Any help would be

Algorithm for merging overlapping intervals

一笑奈何 提交于 2019-12-21 19:58:50
问题 I have been searching for an efficient algorithm to merge overlapping intervals on a dynamic array of intervals. For example, (start time, end time) wise, [(1, 2), (4, 8), (3, 10)] becomes [(1, 2), (3, 10)] after merging because (4, 8) and (3, 10) are overlapped. Overlapping means any part of the two intervals share the same moment. I know when a full array is given the operation can be done with a stack after sorting the intervals on start time ascending order (reference: geeksforgeeks). But