Guest User

Untitled

a guest
Apr 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. {
  2. object: XYZ,
  3. ts : new Date()
  4. }
  5.  
  6. db.data.find({object : XYZ, ts : {$gt : t1, $lt : t2}})
  7.  
  8. // first
  9. db.data.find({object : XYZ, ts : {$gt : new Date(/* start of day */)}}).sort({ts : 1}).limit(1)
  10. // last
  11. db.data.find({object : XYZ, ts : {$lt : new Date(/* end of day */)}}).sort({ts : -1}).limit(1)
  12.  
  13. db.data.find({ts : timestamp})
  14.  
  15. // Parse a n delimited file into RAM then
  16. // then split each line on space to into a
  17. // array of tokens. Return the entire array
  18. // as string[][]
  19. let readSpaceDelimFile fname =
  20. System.IO.File.ReadAllLines(fname)
  21. |> Array.map (fun line -> line.Split [|' '|])
  22.  
  23. // Based on a two dimensional array
  24. // pull out a single column for bar
  25. // close and convert every value
  26. // for every row to a float
  27. // and return the array of floats.
  28. let GetArrClose(tarr : string[][]) =
  29. [| for aLine in tarr do
  30. //printfn "aLine=%A" aLine
  31. let closep = float(aLine.[5])
  32. yield closep
  33. |]
Add Comment
Please, Sign In to add comment