Created
September 6, 2012 10:53
-
-
Save hodzanassredin/3654744 to your computer and use it in GitHub Desktop.
hw to split seq by date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| windowBySecond (tweetsSq: seq<Tweet>) = | |
| let tweet = Seq.head tweetsSq | |
| let currSec = (toDateTime tweet.DateStr).Second | |
| let tweetsForSecond = Seq.takeWhile (fun elem -> (toDateTime elem.DateStr).Second = currSec) tweetsSq |> Seq.toList | |
| Some(Some(tweetsForSecond.Length), tweetsSq) | |
| let tweetsPerMSecond tracking = | |
| //|> Seq.map (fun t -> (toDateTime t.DateStr)) | |
| Seq.unfold (fun state -> windowBySecond state) (tweets tracking) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment