Questions tagged [intervals]

Intervals are used to measure “distance” between values.

Intervals are used to measure “distance” between values.

In the DBMS world interval typically refers to the period between 2 timestamps, many modern RDBMS systems natively supports intervals and operation with them.

More information on the intervals can be found in the wild.

2903 questions
9
votes
2 answers

Select records by time in interval between 12:00:00 and 18:00:00 on every day

I've tried to select all records in a table with the timestamp in the dateformat 2011-08-01- 12:00:00 Using the following code: SELECT f.`fly_reg`, RIGHT(f.`start_tid`,8) AS st, f.`start_hight` FROM vbsk_dk_02.fab_master_flyvedata f Where st…
user857558
  • 167
  • 1
  • 2
  • 7
9
votes
1 answer

How to check refresh interval in elastic search if it is not default

I used command curl -XPOST 'localhost:9200/_refresh?pretty' to refresh ES. I have read couple of posts where we can set refresh_interval to -1 to disable it, or the default refresh_interval is 1s. Also we can set it etc. But what is command to check…
Techie J
  • 91
  • 1
  • 2
9
votes
5 answers

Efficient way of storing date ranges

I need to store simple data - suppose I have some products with codes as a primary key, some properties and validity ranges. So data could look like this: Products code value begin_date end_date 10905 13 2005-01-01 2016-12-31 10905 …
Roman Pekar
  • 107,110
  • 28
  • 195
  • 197
9
votes
2 answers

Pandas - group by consecutive ranges

I have a dataframe with the following structure - Start, End and Height. Some properties of the dataframe: A row in the dataframe always starts from where the previous row ended i.e. if the end for row n is 100 then the start of line n+1 is 101.…
Moshe Einhorn
  • 95
  • 2
  • 4
9
votes
2 answers

Range join data.frames - specific date column with date ranges/intervals in R

Although the details of this are, of course, app specific, in the SO spirit I'm trying to keep this as general as possible! The basic problem is how to merge data.frames by date when one data.frame has specific dates and the other has a date-range.…
user2728808
  • 560
  • 3
  • 18
9
votes
1 answer

Oracle SQL query for subtracting time from timestamp

I have a problem building a query in oracle. I have table with column "DATE_CREATE", which has a type of "TIMESTAMP". Example of one value is: 2012-10-20 05:43:47:001000 I would like to build a where clause for selecting rows with create column…
marc_s
  • 1,007
  • 3
  • 14
  • 24
9
votes
1 answer

Multiple Enumerators for a Single C# Class

I have created a data structure consisting of intervals. The data structure should naturally have an enumerator that enumerates all intervals, but I would like to expose two different enumerators that enumerate the intervals in different order. One…
Mikkel R. Lund
  • 2,336
  • 1
  • 31
  • 44
9
votes
5 answers

Intersecting overlapping intervals in Java

I have an input set of date ranges that may overlap. Instead of combining these overlapping date ranges, I want to create new date ranges with adjusted dates, e.g.: |---------------------–| |-----| |--------------–| should end…
u6f6o
  • 2,050
  • 3
  • 29
  • 54
9
votes
4 answers

Execute a method every x seconds in C

Is there an example of a working timer that executes some function every x amount seconds using C. I'd appreciate an example working code.
Feras Wilson
  • 380
  • 1
  • 3
  • 13
9
votes
1 answer

Create a simple countdown in processing

I have searched up so many sites on Google to try and get this to work but NO ONE seems to have this anywhere , and if they do it's just NOT working with my program... What I am trying to achieve is to have a player recoil that when the player gets…
D34thSt4lker
  • 447
  • 1
  • 5
  • 12
8
votes
7 answers

format interval with to_char

Following SQL command select TO_CHAR(NVL(arg1 - arg2, TO_DSINTERVAL('0 00:00:00'))) from table1 produces a result of the format: +000000000 00:03:01.954000. Is it possible to enter a special format in the to_char function in order to get a result…
Georg Leber
  • 3,470
  • 5
  • 40
  • 63
8
votes
4 answers

Kotlin: How to iterate all dates within a Joda Interval?

I'd like to iterate all dates within a given Joda interval: val interval = Interval(DateTime.now().minusDays(42), DateTime.now()) How to do that in Kotlin?
s1m0nw1
  • 76,759
  • 17
  • 167
  • 196
8
votes
2 answers

Is there an implementation of _rational_ interval arithmetic in Python?

Is there an implementation of rational interval arithmetic in Python? This uses floats, not rationals. If not, is there any implementation of rationals in Python that includes ±∞ ?
user380772
8
votes
3 answers

javascript interval

How can I use interval in js? For example I want to call a function every 5 seconds?