William Stacey

William Stacey staceyw Before C# there was darkness...

Niner since 2004

MCSE, prior C# MVP
  • YOW! 2011: Bjorn Freeman-Benson - Software Psychology

    Good talk. Charles, agree that way forward for concurrency may be to do it less and copy more at least for shared state. As strange as that sounds. I have thoughts on a new sync primitive called "sync" that combines thoughts from monitor, reader/writer, and actors messages, but keeps things in the imperative world. Thoughts here. Comments welcome.

     

  • Expert Panel Q&A featuring Scott Guthrie, Dave Campbell, and Mark Russinovich

    I like the improvements Scott. Good job. Needed your web touch.
    Still have some issues on the billing side. I have a sub for $10/mth and one month is $34.00. You go to click on that bill and you get "Resource not available." Funny it happens to the only bill I have questions on?

    Shards and multi-tenant is really welcome feature.

  • Previewing The Windows Store

    I find the "share" language a bit odd and backwards. "You share 70% with us"?  I think that is the other way round. The developers share 30% with you. We are the customers, and we make the apps and share 30% with the retailer (i.e. the store).

  • SPLASH 2011: Dave Thomas - On Modern Application Development

    Dave seem to like Access.  Should note that Acces in the cloud and in Azure is now called MS LightSwitch.  IMO, even better than access, 3-tier by design, no walls, and native sql backend. to boot. Good stuff.

  • Drawbridge: A new form of virtualization for application sandboxing

    Nice. So in the future, a user could hit a exception, then "click-dump" the process (as a button in the exception window) and email to me. I could open that in VS debuging and be right in the context of the issue and even see what happened before the exception.  Probably could also add a 20 sec reply window replay what user was doing 20 seconds before the issue for even more local context.  Now that itself is a game changer. Also a neat way to publish working VS solutions for samples and demos, or office documents. The target user does not even have to have office installed and could even open from over the web. Big game changer. Nice what senerios that could enable.

  • Visual Studio Toolbox: Power Commands for Visual Studio 2010

    Thanks for the vid.  Question. Could they add a "Remove unused references" to References node? Remove any ref that is not called in the project from the list.

  • Rx Workshop: Observables versus Events

    "As does your TextChanged (and the original)."

    But calling TextChanged is up to publisher. So publisher would not call if not changed. Changing that behavior was not part of the challenge as I read it.  Was fun series in any event (pun intended). 

  • Rx Workshop: Observables versus Events

    @kurator. My code produced the desired output and the 13. It is not dependant on subscribers of TextChanged event. It is dependant on publisher calling OnTextChanged().

  • Rx Workshop: Observables versus Events

    @jyates. I think that may not follow the spirt of the challenge.

    1) Your LengthChanged event is always fired after textchanged, even if Length does not change. So it fires too much.

    2) The challenge had a template to follow and not remove getter/setter (i.e. Add, Remove) on the new event afaict.

  • Rx Workshop: Observables versus Events

    Thanks for video. Is this right?

    namespace IntroductionToRx
    {
        class Events
        {
            public event Action<string> TextChanged;
            private event Action<int> lenChanged;
            private int lastLen;
    
            public virtual void OnTextChanged(string text)
            {
                var t = TextChanged;
                if (t != null)
                    t(text);
                if (lastLen != text.Length)
                {
                    lastLen = text.Length;
                    OnLenChanged(text.Length);
                }
            }
            public virtual void OnLenChanged(int len)
            {
                var t = lenChanged;
                if (t != null)
                    t(len);
            }
            public event Action<int> LengthChanged
            {
                add
                {
                    lenChanged = (Action<int>)Delegate.Combine(lenChanged, value);
                }
                remove
                {
                    lenChanged = (Action<int>)Delegate.Remove(lenChanged, value);
                }
            }
        }
    }
    
    namespace IntroductionToRx
    {
        class Observables
        {
            ISubject<string> textChanged = new Subject<string>();
            int lastLen;
    
            public virtual void OnTextChanged(string text)
            {
                textChanged.OnNext(text);
            }
    
            public IObservable<string> TextChanged { get { return textChanged; } }
    
            public IObservable<int> LengthChanged
            {
                get
                { // Compose new "event" by filtering existing event.
                    return textChanged.Where(s => s.Length != lastLen).Do(s=>lastLen=s.Length).Select(s=>s.Length);
                }
            }
        }
    }
    
    Output
    ======================
    *** Events ***
    The
    Reactive
    Extensions
    10
    are
    3
    13
    *** Observables ***
    The
    Reactive
    Extensions
    10
    are
    3
    13

See more comments…