Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Rx Workshop: Event Processing

Download

Right click “Save as…”

Learn how to use LINQ operators to filter, aggregate, and group data in observable sequences to produce desired results. 

Download the Challenge

Tags:

Follow the Discussion

  • 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 Smiley

  • CharlesCharles Welcome Change

    @AbdouMoumen: This is actually the 3rd part. Smiley

  • @Charles:OK, thanks. The ordering of the videos in the series' page is a little confusing Smiley 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" Tongue Out

     

  • CharlesCharles Welcome Change

    @AbdouMoumen: Yeah, we messed this up Smiley It's the right challenge, though. I'll circle back with Wes and Bart to ensure we have this all right...

    C

  • BOUABDALLAH AbdelmoumenMoumen MSP

    @Charles:OK, I've already downloaded the whole series though, so, I'll try to figure it out Wink

  • ,Charles wrote

    @AbdouMoumen: This is actually the 3rd part.Smiley

    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.

  • BOUABDALLAH AbdelmoumenMoumen MSP

    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 Wink

    By the way, aren't there two more episodes? ( "Reactive Coincidence" and "Programming the Cloud")

  • MikeCmdcsoft I'm the one on the left

    I think I got it!

    Code Snippet
    1. var result = quotes
    2.     .Where(q=>q.Symbol=="MSFT")
    3.     .Select(q=> new {q.Close, q.Date, q.High, q.Low})
    4.     .Buffer(5)
    5.     .Select(list => new
    6.     {
    7.         AvgHigh=list.Average(q=>q.High),
    8.         AvgLow=list.Average(q=>q.Low),
    9.         Last=list.Last().Close,
    10.         Date=list.Last().Date
    11.     });
  • YazidYazid

    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?

  • Eugene StrizhokEugene Strizhok

    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;
    }

  • Eugene StrizhokEugene Strizhok

    But how do I insert code snippets?

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.