Advertisement
Guest User

Untitled

a guest
Jul 11th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. point = startDate;
  2. stepTimeSpan = (endDate - startDate) / (maxSteps - 1); //will fail if maxSteps = 1
  3. for (i = 0; i < maxSteps; i++)
  4. {
  5. records.Add(getClosestTo(point));
  6. point = point + stepTimeSpan;
  7. }
  8. return records;
  9.  
  10. bucketStart = startDate;
  11. bucketTimeSpan = (endDate - startDate) / maxSteps;
  12. for (i = 0; i < maxSteps; i++)
  13. {
  14. bucket = getRecordsBetween(bucketStart, bucketStart + bucketTimeSpan);
  15. records.Add( new Record( AvgDate(bucket), AvgValue(bucket) ) );
  16. bucketStart = bucketStart + bucketTimeSpan;
  17. }
  18. return records;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement