Rx Workshop: Reactive Coincidence

Learn how to use LINQ operators to filter, aggregate, and group data in observable sequences to produce desired results.
This should be a great series. Finally a reason I can push more people at work to learn Linq.
I attended SoCal Code Camp in San Diego last weekend. There was a session on real world Rx and Rx Koans. This gave me a great start on Rx. The Koans looks like a great way to help learn Rx. just wanted everyone to know about this codeplex project. The idea of using koans come from the Ruby community and are an effective way to learn.
"Koans - Zen Buddhist riddle: a Zen Buddhist riddle used to focus the mind during meditation and to develop intuitive thinking"
Hey,
This is the second video (after the introduction video) of the series, right? but I get the feeling that you're talking about things that I haven't seen in the first video (like when you said "if you did the last challenge you'll know where did that 'stock ticks' come from".) Maybe there's a problem with the ordering of the episodes.
Thanks for the great series anyway
@AbdouMoumen: This is actually the 3rd part.
@Charles:OK, thanks. The ordering of the videos in the series' page is a little confusing what's even more confusing is that near the end of the video, when opening the solution for the challenge, the folder says "Challenge 5: Complex Event Processing"
@AbdouMoumen: Yeah, we messed this up It's the right challenge, though. I'll circle back with Wes and Bart to ensure we have this all right...
C
@Charles:OK, I've already downloaded the whole series though, so, I'll try to figure it out
@AbdouMoumen: This is actually the 3rd part.
I went through all the videos, and it this one appears to be the last one. So skip to the 3rd one in the list of videos, and come back to this one at the end.
I just noticed that the Challenge files have the correct numbers (so this is actually the 5th episode) stick to them and you'll be fine
By the way, aren't there two more episodes? ( "Reactive Coincidence" and "Programming the Cloud")
I think I got it!
Great video, where can I download the code (Chanlleng)
TIA
Yaz
All links to the challenges are giving 404 error. Could someone fix it please?
This, I believe, the answer for same task, but taking non-stocking days into account.
return from window in
(from quote in quotes
group quote by quote.Symbol
into company
from window in company.Buffer(2, 1)
from stock in this.WithNonStockingDays(window)
where stock.Symbol == "MSFT"
select stock).Buffer(5, 4)
select new {
window.Last().Date,
window.Last().Close,
AverageHigh = window.Average(q => q.High),
AverageLow = window.Average(q => q.Low)
};
private IEnumerable<StockQuote> WithNonStockingDays(IList<StockQuote> window) {
var left = window.First();
var right = window.Last();
yield return left;
while (right.Date - left.Date > TimeSpan.FromDays(1)) {
left = new StockQuote {
Close = left.Close,
Date = left.Date.AddDays(1),
High = left.High,
Low = left.Low,
Open = left.Open,
Symbol = left.Symbol,
Volume = left.Volume
};
yield return left;
}
yield return right;
}
But how do I insert code snippets?