<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html">Comments - eCraft Labs</title>
  <icon>http://labs.ecraft.com/Content/icons/favicon.ico</icon>
  <logo>http://labs.ecraft.com/Content/icons/favicon.png</logo>
  <updated>2009-12-16T14:28:14.607</updated>
  <id>http://labs.ecraft.com/comments/atom</id>
  <link rel="alternate" type="text/html" hreflang="en" href="/atom"/>
  <link rel="self" type="application/atom+xml" href="http://labs.ecraft.com/Comments/ATOM"/>
  <generator uri="http://oxite.net" version="1.0">Oxite</generator>
  <entry>
    <title type="html">Introducing eCraft Labs</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/Introducing-eCraft-Labs#c-200912160228146"/>
    <id>http://labs.ecraft.com/Blogs/Introducing-eCraft-Labs#c-200912160228146</id>
    <updated>2009-12-16T14:28:14.607</updated>
    <published>2009-12-16T14:28:14.607</published>
    <author>
      <name>Antti</name>
    </author>
    <content type="html" xml:lang="en">
      Nice blog!
    </content>
  </entry>
  <entry>
    <title type="html">Calling web services from JavaScript with ASP.NET AJAX: Answering the Why and How questions</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001150117293"/>
    <id>http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001150117293</id>
    <updated>2010-01-15T13:17:29.343</updated>
    <published>2010-01-15T13:17:29.34</published>
    <author>
      <name>Robin Lauren</name>
    </author>
    <content type="html" xml:lang="en">
      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;.
    </content>
  </entry>
  <entry>
    <title type="html">Calling web services from JavaScript with ASP.NET AJAX: Answering the Why and How questions</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001220840221"/>
    <id>http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201001220840221</id>
    <updated>2010-01-22T08:40:22.123</updated>
    <published>2010-01-22T08:40:22.123</published>
    <author>
      <name>per.lundberg@ecraft.com</name>
    </author>
    <content type="html" xml:lang="en">
      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...).
    </content>
  </entry>
  <entry>
    <title type="html">From Windows Forms to Silverlight (WPF)</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001260337423"/>
    <id>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001260337423</id>
    <updated>2010-01-26T15:37:42.34</updated>
    <published>2010-01-26T15:37:42.34</published>
    <author>
      <name>Per Lundberg</name>
    </author>
    <content type="html" xml:lang="en">
      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
    </content>
  </entry>
  <entry>
    <title type="html">From Windows Forms to Silverlight (WPF)</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001270158393"/>
    <id>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001270158393</id>
    <updated>2010-01-27T13:58:39.367</updated>
    <published>2010-01-27T13:58:39.367</published>
    <author>
      <name>Tero Tapanainen</name>
    </author>
    <content type="html" xml:lang="en">
      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

    </content>
  </entry>
  <entry>
    <title type="html">From Windows Forms to Silverlight (WPF)</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001281144305"/>
    <id>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201001281144305</id>
    <updated>2010-01-28T11:44:30.517</updated>
    <published>2010-01-28T11:44:30.517</published>
    <author>
      <name>Per Lundberg</name>
    </author>
    <content type="html" xml:lang="en">
      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
    </content>
  </entry>
  <entry>
    <title type="html">From Windows Forms to Silverlight (WPF)</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002020802470"/>
    <id>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002020802470</id>
    <updated>2010-02-02T20:02:47.053</updated>
    <published>2010-02-02T20:02:47.053</published>
    <author>
      <name>Jon Wickstr&#246;m</name>
    </author>
    <content type="html" xml:lang="en">
      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...
    </content>
  </entry>
  <entry>
    <title type="html">From Windows Forms to Silverlight (WPF)</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030149231"/>
    <id>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030149231</id>
    <updated>2010-02-03T13:49:23.183</updated>
    <published>2010-02-03T13:49:23.183</published>
    <author>
      <name>Tero Tapanainen</name>
    </author>
    <content type="html" xml:lang="en">
      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
    </content>
  </entry>
  <entry>
    <title type="html">From Windows Forms to Silverlight (WPF)</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030257166"/>
    <id>http://labs.ecraft.com/Code/From-Windows-Forms-to-Silverlight-(WPF)#c-201002030257166</id>
    <updated>2010-02-03T14:57:16.63</updated>
    <published>2010-02-03T14:57:16.63</published>
    <author>
      <name>Johnny Ribacka</name>
    </author>
    <content type="html" xml:lang="en">
      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! :-)
    </content>
  </entry>
  <entry>
    <title type="html">Tools for WPF debugging</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/Tools-for-WPF-debugging#c-201002220847297"/>
    <id>http://labs.ecraft.com/Blogs/Tools-for-WPF-debugging#c-201002220847297</id>
    <updated>2010-02-22T08:47:29.777</updated>
    <published>2010-02-22T08:47:29.777</published>
    <author>
      <name>Per Lundberg</name>
    </author>
    <content type="html" xml:lang="en">
      Thanks! Snoop was nice, even though it didn't help me solve the problem... :-)

(I was trying to use RelativeSource but failed)

Best regards,
Per
    </content>
  </entry>
  <entry>
    <title type="html">Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240253558"/>
    <id>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240253558</id>
    <updated>2010-03-24T14:53:55.883</updated>
    <published>2010-03-24T14:53:55.883</published>
    <author>
      <name>Simon</name>
    </author>
    <content type="html" xml:lang="en">
      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..
    </content>
  </entry>
  <entry>
    <title type="html">Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240256520"/>
    <id>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003240256520</id>
    <updated>2010-03-24T14:56:52.017</updated>
    <published>2010-03-24T14:56:52.017</published>
    <author>
      <name>Simon</name>
    </author>
    <content type="html" xml:lang="en">
      ..obviously there should be angle brackets. Seems the blog software ate them...
    </content>
  </entry>
  <entry>
    <title type="html">Extension Method: Convenient way to add items to an ICollection&lt;T&gt;</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003250352414"/>
    <id>http://labs.ecraft.com/Code/Extension-Method-Convenient-way-to-add-items-to-an-ICollectionT#c-201003250352414</id>
    <updated>2010-03-25T15:52:41.497</updated>
    <published>2010-03-25T15:52:41.497</published>
    <author>
      <name>Per Lundberg</name>
    </author>
    <content type="html" xml:lang="en">
      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...
    </content>
  </entry>
  <entry>
    <title type="html">Calling web services from JavaScript with ASP.NET AJAX: Answering the Why and How questions</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201003251024395"/>
    <id>http://labs.ecraft.com/Code/Calling-web-services-from-JavaScript-with-ASPNET-AJAX-Answering-the-Why-and-How-questions#c-201003251024395</id>
    <updated>2010-03-25T22:24:39.543</updated>
    <published>2010-03-25T22:24:39.543</published>
    <author>
      <name>Tim Viney</name>
    </author>
    <content type="html" xml:lang="en">
      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.
    </content>
  </entry>
  <entry>
    <title type="html">Update about Snoop</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/Update-about-Snoop#c-201005061052023"/>
    <id>http://labs.ecraft.com/Blogs/Update-about-Snoop#c-201005061052023</id>
    <updated>2010-05-06T10:52:02.32</updated>
    <published>2010-05-06T10:52:02.317</published>
    <author>
      <name>Nicklas Andersson</name>
    </author>
    <content type="html" xml:lang="en">
      I've found that for me Mole has turned out to be more useful. I started using that when there was no 64 bit Snoop. And I've also found that Snoop crashes with some more complex applications (maybe in particular applications that switch out their main widow while running?).

Mole can be found here:

&lt;a href=&quot;http://karlshifflett.wordpress.com/mole-for-visual-studio/&quot;&gt;http://karlshifflett.wordpress.com/mole-for-visual-studio/&lt;/a&gt;.
    </content>
  </entry>
  <entry>
    <title type="html">SharePoint Event Handler Gotchas</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201005110100104"/>
    <id>http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201005110100104</id>
    <updated>2010-05-11T13:00:10.433</updated>
    <published>2010-05-11T13:00:10.433</published>
    <author>
      <name>axiom</name>
    </author>
    <content type="html" xml:lang="en">
      Great work man, great.
    </content>
  </entry>
  <entry>
    <title type="html">Silverlight 4.0 Navigation Framework and Prism</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Silverilght, Prism, Navigation Framework, Navigation#c-201005170601442"/>
    <id>http://labs.ecraft.com/Code/Silverilght, Prism, Navigation Framework, Navigation#c-201005170601442</id>
    <updated>2010-05-17T18:01:44.297</updated>
    <published>2010-05-17T18:01:44.293</published>
    <author>
      <name>Anton</name>
    </author>
    <content type="html" xml:lang="en">
      Hi, Tero. Thanks for the post, really useful! But could you provide your PrismContentLoaderAsyncResult implementation?
    </content>
  </entry>
  <entry>
    <title type="html">SharePoint Event Handler Gotchas</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201005180440181"/>
    <id>http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201005180440181</id>
    <updated>2010-05-18T16:40:18.113</updated>
    <published>2010-05-18T16:40:18.11</published>
    <author>
      <name>Ryan Wentzel</name>
    </author>
    <content type="html" xml:lang="en">
      Working with the SharePoint Object Model can be so frustrating at times. Thanks for the tips.
    </content>
  </entry>
  <entry>
    <title type="html">Silverlight 4.0 Navigation Framework and Prism</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/Silverilght, Prism, Navigation Framework, Navigation#c-201005210955391"/>
    <id>http://labs.ecraft.com/Code/Silverilght, Prism, Navigation Framework, Navigation#c-201005210955391</id>
    <updated>2010-05-21T09:55:39.19</updated>
    <published>2010-05-21T09:55:39.19</published>
    <author>
      <name>Tero</name>
    </author>
    <content type="html" xml:lang="en">
      Hello Anton,

Sorry for the late reply, I added a link to the end of the post from where you can download the code.

-Tero

    </content>
  </entry>
  <entry>
    <title type="html">SharePoint Event Handler Gotchas</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201006010321144"/>
    <id>http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201006010321144</id>
    <updated>2010-06-01T15:21:14.43</updated>
    <published>2010-06-01T15:21:14.43</published>
    <author>
      <name>csr</name>
    </author>
    <content type="html" xml:lang="en">
      Hi Im doing an ItemAttachmentAdding event and I have to put a column value to &quot;1&quot; when the event happens.

I have tried without success:


properties.AfterProperties[NAME] = &quot;1&quot;;
properties.ListItem.Update();

I hope you can help me.
    </content>
  </entry>
  <entry>
    <title type="html">SharePoint Event Handler Gotchas</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201006140637404"/>
    <id>http://labs.ecraft.com/Blogs/SharePoint-Event-Handler-Gotchas#c-201006140637404</id>
    <updated>2010-06-14T06:37:40.453</updated>
    <published>2010-06-14T06:37:40.453</published>
    <author>
      <name>Andreas Finne</name>
    </author>
    <content type="html" xml:lang="en">
      Inside a synchronous event handler (-adding) you shouldn't have to do ListItem.Update(), since that is handled by SharePoint afterwards by taking the AfterProperties. On the other hand, in an asynchronous event handler (-added), you have to do ListItem.Update(), and modify the item directly instead of modifying the AfterProperties collection.

So, without having any more information that you provided, I suggest that you try without the Update() at the end.

    </content>
  </entry>
  <entry>
    <title type="html">SharePoint: Run with elevated privileges</title>
    <link rel="alternate" type="text/html" href="http://labs.ecraft.com/Code/SharePoint-Run-with-elevated-privileges#c-201007181119579"/>
    <id>http://labs.ecraft.com/Code/SharePoint-Run-with-elevated-privileges#c-201007181119579</id>
    <updated>2010-07-18T11:19:57.92</updated>
    <published>2010-07-18T11:19:57.92</published>
    <author>
      <name>CASTRO33Chandra</name>
    </author>
    <content type="html" xml:lang="en">
      Following my analysis, billions of persons in the world receive the &lt;a href=&quot;http://bestfinance-blog.com/topics/home-loans&quot;&gt;home loans&lt;/a&gt; at various creditors. So, there's a good possibility to get a term loan in all countries. 
    </content>
  </entry>
</feed>
