<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Comments - C - eCraft Labs</title>
        <description></description>
        <link>/Tags/C/RSS</link>
        <language>en</language>
        <image>
            <url>http://labs.ecraft.com/Content/icons/favicon.png</url>
            <title>eCraft Labs</title>
            <link>/Tags/C/RSS</link>
            <width>64</width>
            <height>64</height>
        </image>
        <item>
            <dc:creator>Tim Viney</dc:creator>
            <title>RE: Calling web services from JavaScript with ASP.NET AJAX: Answering the Why and How questions</title>
            <description>I love this, great blog, thanks.

I'm developing an on going asp.net app that is growing arms and legs. One major page has about 10 user controls each in it's own update panel. There is a heck of alot of text in gridviews and datalists all over the page, so as you can imagine it can be a tad slugish. I'm working on a part where I need to check that a corisponding file exists on the server when a user clicks a checkbox in a large datalist. To do this check in an update panel and wate for the big roundtrip would be unexceptable I think, but could be just the ticket for my scenario I think :)

Thanks, very usefull.</description>
            <link>http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201003251024395</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201003251024395</guid>
            <pubDate>Thu, 25 Mar 2010 22:24:39 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Per Lundberg</dc:creator>
            <title>RE: Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
            <description>Valid points, yes. :-)

But perhaps there are other situations when the extension method *would* be more useful? I remember to have written something like this in a project, but I didn't find it now when looking...</description>
            <link>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003250352414</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003250352414</guid>
            <pubDate>Thu, 25 Mar 2010 15:52:41 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Simon</dc:creator>
            <title>RE: Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
            <description>..obviously there should be angle brackets. Seems the blog software ate them...</description>
            <link>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240256520</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240256520</guid>
            <pubDate>Wed, 24 Mar 2010 14:56:52 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Simon</dc:creator>
            <title>RE: Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
            <description>While extension methods are neat, in this case it's not needed at all as you can just use collection initializers like so:

IEnumerable&lt;Customer&gt; customers = new List&lt;Customer&gt; {
                new Customer { CustomerNumber=123456, Name=&quot;Customer #1&quot;},
                new Customer { CustomerNumber=123456, Name=&quot;Customer #2&quot;}};

..and while not applicable in this case, I hope you are aware of Ghostdoc.

A *class* named I&lt;Foo&gt; doesn't seem like good naming to me..</description>
            <link>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240253558</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240253558</guid>
            <pubDate>Wed, 24 Mar 2010 14:53:55 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Johnny Ribacka</dc:creator>
            <title>RE: From Windows Forms to Silverlight (WPF)</title>
            <description>I already beat the &quot;normal&quot; computer 63-0, so in order for a high score table to be of use, the AI would probably need to be better.

The trick to really wiping the floor with the computer is to play a few games until you find a starting sequence where the computer surrenders a corner to you quite early in the game. After that it is often quite easy to win in a way that leaves the computer at 0...

Hi Jonte! :-)</description>
            <link>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030257166</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030257166</guid>
            <pubDate>Wed, 03 Feb 2010 14:57:16 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Tero Tapanainen</dc:creator>
            <title>RE: From Windows Forms to Silverlight (WPF)</title>
            <description>Yes, if we want high secure version the moves should be send to the server. This way the server holds the state of the game and knows if illegal moves are tried to make. 

Actually to separate the AI etc. logic from the client and move to the server side woulnd't be that hard. Also the high score feature would be cool. Let's see if I have time to implement it.

-Tero</description>
            <link>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030149231</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030149231</guid>
            <pubDate>Wed, 03 Feb 2010 13:49:23 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Jon Wickstr&#246;m</dc:creator>
            <title>RE: From Windows Forms to Silverlight (WPF)</title>
            <description>A somewhat secure highscore could be implemented by also submitting the moves. Number of turns is quite finite in reversi...  A server could replay the game and chek the computer moves are moves it possibly would have chosen.

But there is no easy way to check the player is human...</description>
            <link>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002020802470</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002020802470</guid>
            <pubDate>Tue, 02 Feb 2010 20:02:47 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Per Lundberg</dc:creator>
            <title>RE: From Windows Forms to Silverlight (WPF)</title>
            <description>I should mention that this was on &quot;easy&quot; mode. :-)

Thanks for the source link! I might look into it some day. Some potential improvements/changes I've been thinking about:

- Add a &quot;high score&quot; table. This is an interesting challenge from a security point of view. If you just let the client report in the score after the game has been played, how can you trust the content to be reliable? A malicious user (developer) could place a handcrafted webservice call and &quot;cheat&quot; his way into the highscore chart. The only reliable way to implement this feature that I can think of would be to change the application to a client/server app, where each turn is validated by the server (rather than just the client).

This will change the app rather fundamentally, though. :-) Do you have any other ideas about how we could implement a high score listing in a secure manner?

Best regards,
Per</description>
            <link>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001281144305</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001281144305</guid>
            <pubDate>Thu, 28 Jan 2010 11:44:30 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Tero Tapanainen</dc:creator>
            <title>RE: From Windows Forms to Silverlight (WPF)</title>
            <description>Yep, the computer could be tweaked a lot but with limited time (less that a week, mostly evenings) this was the best I could come up with :).

I added link to the full source at the end of the post.

-Tero
</description>
            <link>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001270158393</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001270158393</guid>
            <pubDate>Wed, 27 Jan 2010 13:58:39 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Per Lundberg</dc:creator>
            <title>RE: From Windows Forms to Silverlight (WPF)</title>
            <description>Yes! I won 32-31 in my first attempt to play it. (Oh, then I realized that there was one free spot as well, so the actual victory was a total of 39-25 to my advantage)

Really cool Tero, very good work. How about putting up the full source here? I'll gladly take a look at it and share my opinions.

Best regards,
Per</description>
            <link>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001260337423</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001260337423</guid>
            <pubDate>Tue, 26 Jan 2010 15:37:42 GMT</pubDate>
        </item>
        <item>
            <dc:creator>per.lundberg@ecraft.com</dc:creator>
            <title>RE: Calling web services from JavaScript with ASP.NET AJAX: Answering the Why and How questions</title>
            <description>Thanks for the comment, Robin. You're right (even though you're expressing yourself slightly incorrectly - it's the ethernet frame size, not the TCP/IP packet, that is normally limited to 1,5 kbytes - 1514 bytes including 14 bytes or so worth of header). But then again, TCP/IP packets are normally delivered in ethernet frames, so my 20 KiB TCP/IP packet is likely to be split by the TCP/IP layer in my Windows Vista into suitable ethernet frames anyway, so in practice what you say is true, even it's theoretically incorrect. ;-)

Anyway, in my example both messages will be delivered in 1 ethernet frame, so the difference is 0% in terms of packets being sent over the wire. Still, the overhead has to be processed by the target TCP/IP layer and so forth.

In real-world scenarios though, my reasoning might be more correct (even though the 97,9% performance increase is unlikely to remain :-) ). It would be interesting to see some figures of more complex scenarios of UpdatePanel vs &quot;raw&quot; Javascript. I think usually people who make more complex stuff usually prefer the UpdatePanel approach though, since it makes the solution more homogeneous (all the code in simple C# code-behind files rather than some parts in Javascript files hidden away somewhere...).</description>
            <link>http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001220840221</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001220840221</guid>
            <pubDate>Fri, 22 Jan 2010 08:40:22 GMT</pubDate>
        </item>
        <item>
            <dc:creator>Robin Lauren</dc:creator>
            <title>RE: Calling web services from JavaScript with ASP.NET AJAX: Answering the Why and How questions</title>
            <description>Your intentions are good but your reasoning is flaky. As long as a return packet is under 1.5 kB, it doesn't really matter how small it is since it's still going to fit inside one TCP/IP pcket.

I'm not a C# coder so i can't comment on the code purity issues, but i much appreciate the cleaner return value of &quot;just the facts, mam&quot;.</description>
            <link>http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001150117293</link>
            <guid isPermaLink="true">http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001150117293</guid>
            <pubDate>Fri, 15 Jan 2010 13:17:29 GMT</pubDate>
        </item>
    </channel>
</rss>