interval

MySQL INTERVAL Mins

I am trying to get the all records which are 2 hours or more old using this query $minutes = 60 * 2 SELECT COUNT(id) AS TOTAL, job_id from tlb_stats WHERE log_time >= DATE_SUB(CURRENT_DATE, INTERVAL $minutes MINUTE) GROUP BY job_id It only selects the recent records and skips the old. When I change log_time <= it only selects o...

Group together arbitrary date objects that are within a time range of each other

I want to split the calendar into two-week intervals starting at 2008-May-5, or any arbitrary starting point. So I start with several date objects: import datetime as DT raw = ("2010-08-01", "2010-06-25", "2010-07-01", "2010-07-08") transactions = [(DT.datetime.strptime(datestring, "%Y-%m-%d").date(), ...

Flash AS2 interval problem

I'm using an interval for fade in effect of some objects in flash, but for some reason I can't get it to work if it's called on more than one object. function fadeInPage (pageName) { pageName._visible = true; alpha = 0; fade = setInterval(fadeIn, 15); function fadeIn() { alpha += 5; pageName._alpha = alpha; if (alpha>...

Javascript "..." waiting dot looping with interval

Instead of using an animated gif, I would like to instead have text in a span: Waiting Waiting. Waiting.. Waiting... I would like to loop through each and then return to the first in an infinite loop. I would also like to control the interval to speed up or slow it down. I'd like to have my HTML to be: <p>Waiting<span id="dots"></...

Need code critique for time interval test script PHP

Hey again! I'm trying to write a set of scripts that will run on a page only if it has been more than 15 minutes since they last ran. Basically, an automated script updates a database of mine every half hour--and a page which displays that information and updates session variables must obviously query the database whenever it is opened...

ClearInterval() won't stop my rotate function

I'm using the jQuery Rotate plugin, to animate the rotation of an image 90 degrees, and then stop the rotation. My problem is that it won't stop rotating, even after calling clearInterval(); $(document).ready(function() { var finalAngle; var intval = setInterval(function func() { $("#myimg").rotate(1); if(type...

STL library function to partition an interval

Hi, I'd like to partition an interval such as [-1.0, 1.0] into a discrete set of equally spaced points with a specified distance or step-size between each point. For example if the step-size is 0.1 my function would return an array: -1.0, -0.9, -0.8,...., 0.9, 1.0. Now a way of doing using a vector container is a follows: vector...

Weighted Interval Scheduling problem & Dynamic program

Hi guys! 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. ...

Can one reset the Windows Native Wifi signal strength update interval?

Hi -- I'm writing a .Net class library that's to connect to a specific Wifi network whose name is known in advance, when the signal strength is above a certain threshold. It all works beautifully, EXCEPT that peformance is a bit spotty. I have a polling thread that repeatedly calls WlanGetAvailableNetworks(). This loop performs wel...

Parse and create ISO 8601 Date and time intervals, like PT15M in PHP

A library and webservice I am using, communicates time-intervals in ISO 8601: PnYnMnDTnHnMnS. I want to convert such formats to seconds. And vice versa. Seconds are a lot easier to calculate with. Example interval values are: PT1M or PT60S (1 minute) PT1H, PT60M or PT3600S (1 hour) I need two functions: parse from such values to s...

Auto-Interval precision in MS Chart

I'm currently using the charting within .NET using System.Windows.Forms.DataVisualization.Charting.Chart. Thus far it seems very powerful, and works great. However, there is a huge problem in terms of how it is auto-calculating intervals. I use a lot of double values, and in libraries like ZedGraph, it handles this perfectly. It selects ...

Haskell Range Map library

Is there a Haskell library that allows me to have a Map from ranges to values? (Preferable somewhat efficient.) let myRangeMap = RangeMap [(range 1 3, "foo"),(range 2 7, "bar"),(range 9 12, "baz")] in rangeValues 2 ==> ["foo","bar"] ...

Plot multiple functions in different intervals (Mathematica)

Hi, I need some help in Mathematica. I'm trying to plot functions that are stored in lists like: list = {{3x,1,5},{2x^2,0,4}} I need get an output similar to if I inputted: Show[Plot[3x,{x,1,5}],Plot[2x^2,{x,0,4}]] But I am not quite sure how this is achieved? Thanks in advance ...

Calculate the Y Axis interval for a chart

Hi When creating a chart of, e.g. daily sales figures for the month. Does anyone know how to calculate a suitable Y Axis interval? I've been looking at Excel which seems to choose nice intervals like 100, 200, 500, 1000, 2000 or 5000, etc depending on the numbers involved and the size of the range, but I can't work out what formular or...

Prolog, counting from an interval; (SWI-PROLOG)

Hello, I have a small question. I need to make a predicate that counts from a natural number to some other natural number. I have to implement a check too, that the second interval is bigger than the first one. However I got stuck during my way. Here is my code (SWI-PROLOG) count(O, _, O). count(A, B, C) :- count(A, B, D), C is D+1, C ...

Python: Dynamic interval data structure

Hi all, I am looking for some python code to efficiently compute interval overlaps. I've used the interval tree of the bx-python package before, but now need to delete intervals from the tree (or better yet, modify them). It seems the bx-python tree doesn't support this. Any pointers? Thanks. ...

C# ISO 8601 Time Interval validation

Dear all, I have searched for a while and can't seem to find anything that's related to this. I need to validate an ISO 8601 time interval. There is loads of stuff about ISO 8601 date times but i specifically need interval. I am using a regex and this is what I have so far; Regex regEx = new Regex(@"^P((\d+)Y)((\d+)M)((\d+)D)(T)((\d...