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

Discussions

dcuccia dcuccia
  • Chrome and the Silverlight player

    joechung said:
    alwaysmc2 said:
    *snip*

    Chrome doesn't support Silverlight's windowless mode correctly so in the near future, the Silverlight creative won't appear in Chrome on the microsoft.com homepage any more either. Ditto Safari for Windows and Opera 9, though it looks like Opera 10 alpha supports windowless Silverlight just fine.

    Most user agent sniffing code hasn't been updated to account for Chrome, which pretends to be Safari, for whatever reason:

    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.36 Safari/525.19

    Bummer...I want C9 in SL in Chrome! (waaaa waaaa waaaa...) 

    I'm not sure I get it...
    • There are plenty of "working" examples of SL apps working in full-screen (is this different from windowless?)
    • Tim Heuer teases us with "it's unsupported but all you gotta do is":

      On line 93 in Silverlight.supportedUserAgent.js, insert this line:

         1: else if (ua.indexOf('Chrome') >= 0) {
         2:     slua.Browser = 'Chrome';
         3: }
    ...but I'm not a web guy, so I'm sure there's a very good reason for not enabling it.

  • I was told today to not worry cross-thread execution when...

    gadget said:
    I check inside the method to see if an invoke is required. If so have the delegate make a recursive call to the method, otherwise perform the action.

    This is in vb but should be clear.

     Public Sub ReadKeyboard()
            If Me.InvokeRequired Then
                Dim x As Action = AddressOf ReadKeyboard
                Me.Invoke(x)
            Else
                me.Text = "Keyboard acquired"
            End If
     End Sub

    Check out the invokerequired property of the control class.
    http://msdn.microsoft.com/en-us/library/system.windows.forms.control.invokerequired.aspx

    This is a cross-cutting concern, no? I do this with the following extension methods:

    public static void InvokeOnUIThread( this Control myControl, Action action );
    public static void InvokeOnUIThread<T>( this Control myControl, Action<T> action, T parameter );

    which would be used as follows:

    this.InvokeOnUIThread( () => myControl.Text = "Keyboard acquired" );

    Asked for feeback on this earlier...what do you guys think?

  • Catch-up button

    HumanCompiler said:
    dcuccia said:
    *snip*
    A "My Threads" page is definitely something we've talked about adding and would definitely add value.  We just need to find the time to build something like this and we're currently swamped with other time sensitive projects.
    Hey HumanCompiler
    Google Reader is a bit different in that it's only querying the RSS feeds you've subscribed to which is more than likely a smaller list than all posts on Channel 9.
    I subscribe to http://channel9.msdn.com/forums/RSS/. Is that not all the threads?

  • Catch-up button

    dcuccia said:
    HumanCompiler said:
    *snip*
    I do this all the time...a "Mark all as read" feature is built in to Google Reader. Of course, this works only for finding new threads if you're subscribed to 'Channel 9' RSS feeds, but it also works if you're subscribed to comments on a particular thread.
    [deleted - duplicate post]

  • Catch-up button

    dcuccia said:
    HumanCompiler said:
    *snip*
    I do this all the time...a "Mark all as read" feature is built in to Google Reader. Of course, this works only for finding new threads if you're subscribed to 'Channel 9' RSS feeds, but it also works if you're subscribed to comments on a particular thread.
    ...so I suppose the feature would be helpful if you wanted a way of seeing all comments to all threads w/o having to subscribe to each feed.

    Another way to achieve the same thing would be create an RSS/Atom feed for 'All Comments'.

  • Catch-up button

    HumanCompiler said:
    blowdart has asked for mark all as read too.  So my explaination of why it's not an easy change is over there too.  We figured more people would read less than half of the threads that exist so we built the data to be scalable that way.  If we hear enough people say they read more than half of the threads that go through the coffeehouse, I'm sure we'd be motivated to make the change.  So far there have been 2 of you.  Smiley
    I do this all the time...a "Mark all as read" feature is built in to Google Reader. Of course, this works only for finding new threads if you're subscribed to 'Channel 9' RSS feeds, but it also works if you're subscribed to comments on a particular thread.

  • Thank god it's Monday!

    Can't wait to work on the crap I couldn't finish all weekend...

  • Unconventio​nal use of indexers

    stevo_ said:
    Ion Todirel said:
    *snip*
    I'd be honest and say I don't think it adds anything or makes it really different, to me it just serves as a barrier for people to realize whats actually going on here..
    Thanks for the thoughts Ion and stevo_.

    Is the "Get" class a barrier too? If you had factory methods, which would you prefer (assuming "Get" is used for many purposes in the DSL)?

    A[Get.Range(0,5,255)]


    or a classic

     A[Range.GetRange(0,5,255)]

  • Unconventio​nal use of indexers

    I'm playing around with trying to make array math in C# as easy and concise as in Matlab, and (besides array operators) the biggest language "mismatch" is in indexers, ranges, etc. In Matlab, I can easily get a subarray of A, such as A[0:5:255]

    As a user of a fluent interface DSL in C#, would you ever put up with unconventional use of indexers? Like:

    A[Get.Range[0,5,255]]


    ...where Range is actually a static readonly field holding an instance of class Range

        public class Get
        {
            public static readonly Range Range = new Range();
            public static readonly Size Size = new Size();
        }
    
        public class Range
        {
            public Range this[int from, int to] { get { return new Range(from, 1, to); } }
            public Range this[int from, int every, int to] { get { return new Range(from, every, to); } }
    
            private Range(int start, int every, int stop) { Start = start; Every = every;  Stop = stop; }
            private Range(int start, int stop) : this(start, 1, stop) { }
            internal Range() { } // for indexer use
    
            public int Start { get; private set; }
            public int Stop { get; private set; }
            public int Every { get; private set; }
            public int Count() { return (Stop - Start) / Every + 1; }
        }
    
        public class Size
        {
            public Size this[int d0] { get { return new Size(new int[] { d0 }); } }
            public Size this[int d0, int d1] { get { return new Size(new int[] { d0, d1 }); } }
            public Size this[int d0, int d1, int d2] { get { return new Size(new int[] { d0, d1, d2 }); } }
            public Size this[int d0, int d1, int d2, int d3] { get { return new Size(new int[] { d0, d1, d2, d3 }); } }
    
            private Size(int[] dimensions) { Dimensions = dimensions.ToArray(); }
            internal Size() { } // for indexer use
    
            public int[] Dimensions { get; private set; }
        }
    


    Obviously the following would be more C-sharpy:

    A[new Range(0,5,255)]


    But, isn't it OK to stray a bit as long as there's a consistent convention in the DSL?

  • Zeep Mobile APIs - Free SMS!

    This week on, um "This Week on C9" the guys pointed out Zeep Mobile, a free service for sending and receiving SMS messages (last 40 characters are reserved for targeted advertising).

    They have both Ruby and Python APIs available on Google code.

    Usage from "Getting Started" (Python example):

        import zeep.sms
        connection = zeep.sms.connect("<your api key>", "<your secret key>")
        connection.send_message("<user_id>", "Surfs up!")

    Based on the source code, it looks like someone with even basic web authentication skills could whip up a .NET/Silverlight version...