Skip to main content
260 votes
9 answers
331k views

Say I have an interval like 4 days 10:00:00 in postgres. How do I convert that to a number of hours (106 in this case?) Is there a function or should I bite the bullet and do something like extract(...
agnul's user avatar
  • 13.2k
243 votes
4 answers
570k views

I am trying to query my postgresql db to return results where a date is in certain month and year. In other words I would like all the values for a month-year. The only way i've been able to do it ...
John's user avatar
  • 7,257
132 votes
9 answers
117k views

How can I run a function every minute? In JavaScript I can do something like setInterval, does something similar exist in Swift? Wanted output: Hello World once a minute...
JOSEFtw's user avatar
  • 10.1k
92 votes
5 answers
69k views

I have a relation that maintains monthly historical data. This data is added to the table on the last day of each month. A service I am writing can then be called specifying a month and a number of ...
Belizzle's user avatar
  • 1,444
79 votes
10 answers
19k views

Given two dataframes df_1 and df_2, how to join them such that datetime column df_1 is in between start and end in dataframe df_2: print df_1 timestamp A B 0 2016-05-14 10:...
DougKruger's user avatar
  • 4,644
60 votes
7 answers
128k views

How can I use ranges in a switch case statement using JavaScript? So, instead of writing code for each and every single possibility, I'd like to group them in ranges, For example: switch(myInterval){ ...
Lave Loos's user avatar
  • 1,312
60 votes
3 answers
228k views

I have a question about creating vectors. If I do a <- 1:10, "a" has the values 1,2,3,4,5,6,7,8,9,10. My question is how do you create a vector with specific intervals between its elements. For ...
Luli's user avatar
  • 653
58 votes
11 answers
80k views

My application show a TimePickerDialog to set a time. I want that the timePickerDialog show the minutes with an interval of 5 minutes. This works fine with this code: private final int ...
Sergio76's user avatar
  • 3,996
52 votes
3 answers
232k views

I'm building a chart and I want to receive data for each month. Here's my first request which is working: SELECT s.GSP_nom AS nom, timestamp, AVG( v.vote + v.prix ) /2 AS avg FROM votes_serveur ...
sf_tristanb's user avatar
  • 8,875
49 votes
15 answers
54k views

I'm looking for some nice C code that will accomplish effectively: while (deltaPhase >= M_PI) deltaPhase -= M_TWOPI; while (deltaPhase < -M_PI) deltaPhase += M_TWOPI; What are my options?
P i's user avatar
  • 31.3k
48 votes
4 answers
32k views

I want to call an arbitrary function every n seconds. Basically I want something identical to SetInterval from Javascript. How can I achieve this in Scala?
src091's user avatar
  • 2,867
47 votes
8 answers
212k views

How can I determine using PHP code that, for example, I have a variable that has a value between 1 and 10, or between 20 and 40?
Gabriel Meono's user avatar
47 votes
3 answers
52k views

I'm trying to convert minutes which are in integer to interval in postgres Is there any function that will help me to convert it to interval or should i have divide it by 60 and get the final result ...
Abhijeet Gulve's user avatar
46 votes
4 answers
296k views

If I have 10 values, each of which has a fitted value F, and an upper and lower confidence interval U and L: set.seed(0815) F <- runif(10, 1, 2) L <- runif(10, 0, 1) U <- runif(10, 2, 3) ...
Kazo's user avatar
  • 1,265
46 votes
1 answer
36k views

How can I make a range in a select in PostgreSQL? I'd like to have this result: num --- 1 2 3 4 5 6 From a query like: SELECT range(1,6) AS num;
Yuri Kaszubowski Lopes's user avatar

15 30 50 per page
1
2 3 4 5
198