<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Leston's Software Development Blog</title>
	<atom:link href="http://davidleston.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidleston.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Nov 2009 08:04:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Prototyping, fighting layout bugs, and model-based testing</title>
		<link>http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/</link>
		<comments>http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 08:04:08 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://davidleston.com/?p=57</guid>
		<description><![CDATA[Recently, I&#8217;ve ran into a few interesting talks related to testing.  In this first talk, Steven Dow talks about some early studies on how prototyping has an effect on the performance of the end result.  As you&#8217;ll see in the Q&#38;A, people are hungry to know more about how we can structure tests for our [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I&#8217;ve ran into a few interesting talks related to testing.  In this first talk, <a href="http://www.stanford.edu/~spdow/">Steven Dow</a> talks about some early studies on how prototyping has an effect on the performance of the end result.  As you&#8217;ll see in the Q&amp;A, people are hungry to know more about how we can structure tests for our ideas.</p>
<a href="http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/"><p><em>Click here to view the embedded video.</em></p></a>
<p>&#8211;</p>
<p>Next, <span>Michael Tamm presents <a href="http://code.google.com/p/fighting-layout-bugs/">&#8220;Fighting Layout Bugs&#8221;, a library to detect layout bugs</a>.  This is something that will save a lot of time and prevent many layout bugs by bringing an unprecedented level of automation to testing page rendering.  This is something to keep an eye on.</span></p>
<a href="http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/"><p><em>Click here to view the embedded video.</em></p></a>
<p>&#8211;</p>
<p>Let&#8217;s talk about <a href="http://en.wikipedia.org/wiki/Model-based_testing">model-based testing</a>.  <a href="http://www.cs.waikato.ac.nz/~marku/">Mark Utting</a> gives an introduction.</p>
<a href="http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Then, <a href="http://www.cs.umd.edu/~atif/newsite/index.htm">Atif Memon</a> discusses applying model-based testing to web applications.</p>
<a href="http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Finally, <a href="http://mir.cs.illinois.edu/~marinov/">Darko Marinov</a> talks about test selection when conducting model-based testing.</p>
<a href="http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/"><p><em>Click here to view the embedded video.</em></p></a>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2009/11/prototyping-fighting-layout-bugs-and-model-based-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architecting for scalability and audit logs by explicitly modeling state transitions</title>
		<link>http://davidleston.com/2009/07/architecting-for-scalability/</link>
		<comments>http://davidleston.com/2009/07/architecting-for-scalability/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 06:38:54 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://davidleston.com/?p=47</guid>
		<description><![CDATA[In his talk, Unsleash Your Domain, Greg Young presents a dense discussion of topics about which I am passionate.  At its core, the talk is about how to guarantee a correct audit log and architect for scalability.
Before watching this talk, I suggest brushing up on the following terms if you&#8217;re not already familiar with them: [...]]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Unsleash Your Domain</strong>, <a title="Greg Young's blog" href="http://codebetter.com/blogs/gregyoung/">Greg Young</a> presents a dense discussion of topics about which I am passionate.  At its core, the talk is about how to guarantee a correct audit log and architect for scalability.</p>
<p>Before watching this talk, I suggest brushing up on the following terms if you&#8217;re not already familiar with them: <a title="Wikipedia article on domain model" href="http://en.wikipedia.org/wiki/Domain_model">domain model</a>, <a title="Entities, Value Objects, Aggregates and Roots at LosTechies.com" href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/05/20/entities-value-objects-aggregates-and-roots.aspx">aggregate root</a> and <a href="http://domaindrivendesign.org/node/132">ubiquitous language</a>. (In one system I work on, we use the words &#8220;session&#8221; and &#8220;ticket&#8221; to describe the same concept.  Precise, consistent and accurate language leads to better communication and understanding.)</p>
<p><a title="Greg Young's talk Unleash Your Domain" href="http://www.infoq.com/presentations/greg-young-unshackle-qcon08">Click here to watch the talk.</a></p>
<p>Here are some valuable lessons I see in Greg&#8217;s talk:</p>
<ul>
<li> Software runs.  It&#8217;s about action.  Most models I&#8217;ve seen focus on nouns, such as customer and order, and make actions, such as place order and cancel order, secondary concepts.  A <a title="Wikipedia article on functional software design" href="http://en.wikipedia.org/wiki/Functional_design">functional design</a> focuses  the model on actions, not aggregate roots.  Software with a focus on action makes testing and auditing, which are fundamentally about verifying action, natural.</li>
</ul>
<ul>
<li> Think of the state of an aggregate root as the result of a stream of events.  As Greg mentioned, Martin Fowler dubbed this design  <a title="Martin Fowler's article on Event Sourcing" href="http://martinfowler.com/eaaDev/EventSourcing.html">Event Sourcing</a>.  Distributed source control systems focus on changes to a file rather than versions of files.  This subtle difference is a behind much of the value distributed source control systems offer.  Greg talks about how building your state from a stream of events can result in the ability to rewind and playback history.  To see how this might be visualized, check out <a href="http://googleblog.blogspot.com/2009/05/went-walkabout-brought-back-google-wave.html">the playback feature of Google Wave, demonstrated at 49 minutes into this video</a>.As a bonus, since <a title="Wikipedial article on dataflow programming" href="http://en.wikipedia.org/wiki/Dataflow_programming">a stream is your data</a>, you can easily start writing <a title="Wikipedia article on functional programming" href="http://en.wikipedia.org/wiki/Functional_programming">code in a functional style</a>, even in <a title="How to program in Java in a functional style" href="http://www.google.com/#q=functional+programming+java">Java</a>.  Sequences are the core interface to data for <a title="Clojure's sequences" href="http://clojure.org/sequences">Clojure</a> and <a title="LINQ's iterators article by Jon Skeet" href="http://www.eggheadcafe.com/tutorials/aspnet/159e4793-6b17-4e89-bd94-3bde8a5f2d50/iterators-iterator-block.aspx">LINQ</a>.Also, Greg mentioned the the ability to use a <a title="Wikipedia article on document-oriented databases" href="http://en.wikipedia.org/wiki/Document-oriented_database">document database</a>.  These are the kinds of databases that power Google and Amazon.</li>
</ul>
<ul>
<li>Look for places to implement <a title="Eventual Consistency Is Not That Scary" href="http://smoothspan.wordpress.com/2007/12/22/eventual-consistency-is-not-that-scary/">eventual consistency</a>.  Here&#8217;s an example of an opportunity for eventual consistency:  You want to provide the ability to mark a blog post as a favorite.  Here&#8217;s a series of steps to implement eventual consistency:  You have an application responsible for rendering the blog post and if it has already been marked as a favorite.  User clicks &#8220;mark as favorite.&#8221;  This triggers a call to a different application which accepts the command, validates it, inserts the command into a queue to update the read-only data stores and response to the client that the command has been accepted.  The UI then displays the item has been marked as a favorite.  If the user refreshes the page before all read-only data stores have been updated, then they may see the blog post as not marked as a favorite.  As Greg would say, so what?  This is unlikely to happen and the consequences are small compared to scalability gained by making this operation asynchronous.</li>
</ul>
<ul>
<li>Greg talks about designing business processes as if they were to be done with paper: &#8220;<a href="http://codebetter.com/blogs/gregyoung/archive/2008/05/18/dddd-12-how-long.aspx">Paper was awesome because it never gave the impression of global consistency and it is the thinking that went into the optimization of paper processes that can help us optimize our transactional systems.</a>&#8220;  I thought his restaurant example in the talk might not click with some viewers, so I&#8217;m expanding on it here.  When you place an order at a restaurant, you&#8217;ve inserted a command in a queue.  The waitress transfers the message from the queue she&#8217;s holding to a queue for the kitchen.  The kitchen then prepares your order and notifies the waitress of the event that the order is ready to be served.  The kitchen may then decrement the inventory records.  The waitress then picks up the order and serves it to you.  The reason why this not a fully consistent state is that the cook knows about your order after you&#8217;ve placed it.  The inventory is decremented after the food is cooked.  It&#8217;s eventually consistent.  And it works.As a slight tangent, human processes are often automated because automation is thought to be the solution to poorly executed processes.  Strive to first standardize processes before automation as the process is often ill-defined.  Sometimes, simply defining a process cures problems.  From <a title="The Toyota Way Fieldbook by Jeffrey Liker and David Meier - link to Amazon" href="http://www.amazon.com/gp/product/0071448934?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0071448934">The Toyota Way Fieldbook</a>: &#8220;Standardization is a key element of the Toyota system. A process that is not standardized is fraught with chaos, variation, and the associated problems of continually “riding the wave.” According to Toyota, standardization is the baseline for continuous improvement, the time when real improvement begins and is measurable.&#8221;</li>
</ul>
<p>As a final note, one could benefit from applying one or some of the ideas in this talk.</p>
<p>Related links:</p>
<ul>
<li><a title="Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans - link to Amazon" href="http://www.amazon.com/gp/product/0321125215?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321125215">Domain-Driven Design: Tackling Complexity in the Heart of Software</a> by <a title="Interview with Eric Evans about domain-driven design" href="http://www.infoq.com/interviews/domain-driven-design-eric-evans">Eric Evans</a></li>
</ul>
<ul>
<li><a title="Wikipedia article on Bertrand Meyer" href="http://en.wikipedia.org/wiki/Bertrand_Meyer">Bertrand Meyer</a> talks about <a title="Martin Fowler's article on command and query separation" href="http://martinfowler.com/bliki/CommandQuerySeparation.html">command and query separation</a> in his book <a title="Object Oriented Software Construction by Bertrand Meyer - link to Amazon" href="http://www.amazon.com/gp/product/0136291554?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0136291554">Object Oriented Software Construction</a>.</li>
</ul>
<ul>
<li><a href="http://domaindrivendesign.org/node/91">Bounded context</a></li>
<li><a href="http://behaviour-driven.org/">Behavior Driven Development or BDD</a></li>
<li><a href="http://wiki.github.com/aslakhellesoy/cucumber/given-when-then">Given, When, Then</a></li>
</ul>
<p>&#8220;Man acts as though he were the shaper and master of language, while in fact language remains the master of man.&#8221; -  <a title="Wikipedial article on Martin Heidegger, an influential German philosopher" href="http://en.wikipedia.org/wiki/Martin_Heidegger">Martin Heidegger</a></p>
<p>Update Sept 2, 2009: I received feedback that such an architecture is only for mission critical systems. In his talk, <a title="David Pollack's talk at InfoQ" href="http://www.infoq.com/presentations/actors-scala-immutability-pollack">Buy a Feature: An Adventure in Immutability and Actor</a>, David Pollack, the creator of the <a title="Lift web framework for Scala" href="http://liftweb.net/">Lift web framework</a> for <a title="Wikipedial article on the Scala language for the JVM" href="http://en.wikipedia.org/wiki/Scala_%28programming_language%29">Scala</a>, talks about an application, <a title="the seriously fun way to prioritize serious stuff" href="http://www.innovationgames.com/the-games/Buy+a+Feature">Buy a Feature</a>, which implements this architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2009/07/architecting-for-scalability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Code</title>
		<link>http://davidleston.com/2009/07/clean-code/</link>
		<comments>http://davidleston.com/2009/07/clean-code/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 05:46:48 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://davidleston.com/?p=41</guid>
		<description><![CDATA[The Clean Code Talks concentrating on writing testable code.
In his talk, Unit Testing, Miško Hevery explains unit testing and makes a case for unit tests.
&#8230;
In his talk, Don&#8217;t look for things, Miško Hevery provides a practical guide to the Principle of Least Knowledge (aka Law of Demeter, aka Don&#8217;t Ask, Tell)
&#8230;
In his talk, Global State [...]]]></description>
			<content:encoded><![CDATA[<p>The Clean Code Talks concentrating on writing testable code.</p>
<p>In his talk, <strong>Unit Testing</strong>, <a title="Misko Hevery's about page" href="http://misko.hevery.com/about/">Miško Hevery</a> explains unit testing and makes a case for unit tests.</p>
<a href="http://davidleston.com/2009/07/clean-code/"><p><em>Click here to view the embedded video.</em></p></a>
<p>&#8230;</p>
<p>In his talk, <strong>Don&#8217;t look for things</strong>, Miško Hevery provides a practical guide to <a title="Wikipedia article on the Law of Demeter" href="http://en.wikipedia.org/wiki/Law_of_Demeter">the Principle of Least Knowledge (aka Law of Demeter, aka Don&#8217;t Ask, Tell)</a></p>
<a href="http://davidleston.com/2009/07/clean-code/"><p><em>Click here to view the embedded video.</em></p></a>
<p>&#8230;</p>
<p>In his talk, <strong>Global State and Singletons</strong>, Miško Hevery explains why global state leads to bad APIs and difficult to test code.</p>
<a href="http://davidleston.com/2009/07/clean-code/"><p><em>Click here to view the embedded video.</em></p></a>
<p>&#8230;</p>
<p>In hist talk, <strong>Inheritance, Polymorphism, &amp; Testing</strong>, Miško Hevery presents his premise that most if statements can be replaced with polymorphism and explains why one would want to do so.</p>
<a href="http://davidleston.com/2009/07/clean-code/"><p><em>Click here to view the embedded video.</em></p></a>
<p>&#8230;</p>
<p>In his talk, <strong>GuiceBerry,</strong><span> Luiz-Otavio Zorzella</span> makes a case for using dependency injection in your test code</p>
<a href="http://davidleston.com/2009/07/clean-code/"><p><em>Click here to view the embedded video.</em></p></a>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2009/07/clean-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using instant messaging for distributed application communication</title>
		<link>http://davidleston.com/2008/06/xmpp-jabber-distributed-application-messaging/</link>
		<comments>http://davidleston.com/2008/06/xmpp-jabber-distributed-application-messaging/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 03:11:51 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=37</guid>
		<description><![CDATA[During the first session of the Lightweight Languages 3 workshop (includes video of the talks), Dana Moore and Bill Wright presented ACME: Toward a LL Testing Framework for Large Distributed Systems (abstract), in which they described a distributed application which used the XMPP (aka Jabber) instant messaging protocol to communicate between nodes.
XMPP addresses many complexities [...]]]></description>
			<content:encoded><![CDATA[<p>During the first session of <a title="Hosted by the Dynamic Languages Group at the MIT Artificial Intelligence Lab" href="http://ll3.ai.mit.edu/">the Lightweight Languages 3 workshop (includes video of the talks)</a>, Dana Moore and Bill Wright presented <strong>ACME: Toward a LL Testing Framework for Large Distributed Systems</strong> (<a title="ACME - Toward a LL Testing Framework for Large Distributed Systems abstract" href="http://ll3.ai.mit.edu/abstracts.html#acme">abstract</a>), in which they described a distributed application which used <a title="article on Wikipedia" href="http://en.wikipedia.org/wiki/Extensible_Messaging_and_Presence_Protocol">the XMPP (aka Jabber) instant messaging protocol</a> to communicate between nodes.</p>
<p>XMPP addresses many complexities of inter-node communication in a distributed application, such as presence, heartbeat, queuing messages for offline nodes (offline messages), group broadcast (chat rooms), and status.</p>
<p>Here some other resources promoting instant messaging as a communication bus for distributed applications:</p>
<ul>
<li><a href="http://www.process-one.net/en/blogs/user/mremond/">Mickaël Rémond&#8217;s blog</a> talks about using XMPP (Jabber) inside distributed Erlang applications. <a href="http://www.slideshare.net/Arbow/messaging-with-erlang-and-jabber/">Here are slides from Mickaël Rémond&#8217;s presentation entitled Messaging with Erlang and Jabber</a>.</li>
<li><a href="http://www.xmpp.org/extensions/inbox/gamesessions.html">A proposed standard for game sessions using XMPP (Jabber) by by Michal Vaner</a></li>
<li><a href="http://www.hopeless-newbie.co.uk/UGS/">A proposed universal Go server using XMPP (Jabber) by Mike Albon</a></li>
<li><a href="http://www.amazon.com/gp/product/0072192844?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0072192844">Peer-to-Peer: Building Secure, Scalable, and Manageable Networks by Dana Moore and John Hebeler &#8211; book on Amazon</a></li>
<li><a title="Statistically improbable phrases found in this book: dialback key, pipe advertisement, karma value, elif type, presence subscriptions, stream header, presence packet, aim transport, success packet, roster item" href="http://www.amazon.com/gp/product/0672325365?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0672325365">Jabber Developer&#8217;s Handbook by William Wright and Dana Moore &#8211; book on Amazon</a></li>
</ul>
<p>Related links:</p>
<ul>
<li><a title="Hosted by the Dynamic Languages Group at the MIT Artificial Intelligence Lab" href="http://ll1.ai.mit.edu/">Lightweight Languages 1</a></li>
<li><a title="Hosted by the Dynamic Languages Group at the MIT Artificial Intelligence Lab" href="http://ll2.ai.mit.edu/">Lightweight Languages 2</a></li>
<li><a title="Hosted by the Dynamic Languages Group at the MIT Artificial Intelligence Lab" href="http://ll4.csail.mit.edu/">Lightweight Languages 4</a></li>
<li><a href="http://www.amazon.com/gp/product/1590596439?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1590596439">Event-Based Programming: Taking Events to the Limit by Ted Faison &#8211; book on Amazon</a></li>
<li><a href="http://www.amazon.com/gp/product/1555583385?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1555583385">IM Instant Messaging Security by John Rittinghouse &#8211; book on Amazon</a></li>
<li><a href="http://www.amazon.com/gp/product/0521876346?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0521876346">Distributed Computing: Principles, Algorithms, and Systems by Ajay D. Kshemkalyani and Mukesh Singhal &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/06/xmpp-jabber-distributed-application-messaging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network theory &#8211; detecting cascades</title>
		<link>http://davidleston.com/2008/06/network-theory-detecting-cascades/</link>
		<comments>http://davidleston.com/2008/06/network-theory-detecting-cascades/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 02:12:16 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=40</guid>
		<description><![CDATA[In his talk, Dynamics of real-world networks, Jure Leskovec discusses where to place sensors in a network to detect cascades such virus outbreaks or rising memes.  I particularly enjoyed Jure&#8217;s explanation of how the cost-effective lazy forward-selection algorithm, which his team developed, helps to balance the cost of the sensors versus the reward of early [...]]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Dynamics of real-world networks</strong>, <a title="PhD candidate in the Machine Learning Department, School of Computer Science at Carnegie Mellon University, undergraduate in  Computer Science at  University of Ljubljana, Slovenia" href="http://www.cs.cmu.edu/~jure/">Jure Leskovec</a> discusses where to place sensors in a network to detect cascades such virus outbreaks or rising memes.  I particularly enjoyed Jure&#8217;s explanation of how <a title="Cost-effective Outbreak Detection in Networks " href="http://www.scribd.com/doc/424343/Costeffective-Outbreak-Detection-in-Networks">the cost-effective lazy forward-selection algorithm</a>, which his team developed, helps to balance the cost of the sensors versus the reward of early detection.</p>
<a href="http://davidleston.com/2008/06/network-theory-detecting-cascades/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Related links:</p>
<ul>
<li><a title="Statistically improbable phrases found in this book: aristocratic kind, ordered network, preferential attachment, weak ties, river network" href="http://www.amazon.com/gp/product/0393324427?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0393324427">Nexus: Small Worlds and the Groundbreaking Theory of Networks by Mark Buchanan &#8211; book on Amazon</a></li>
<li><a title="Statistically improbable phrases found in this book: topological robustness, clustering coefficient, preferential attachment, cascading failures, epidemic threshold, protein interaction network, network thinking, collaboration networks" href="http://www.amazon.com/gp/product/0452284392?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0452284392">Linked: How Everything Is Connected to Everything Else and What It Means by Albert-Laszlo Barabasi &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/06/network-theory-detecting-cascades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging on Software Engineering Radio</title>
		<link>http://davidleston.com/2008/06/debugging-software-engineering-radio/</link>
		<comments>http://davidleston.com/2008/06/debugging-software-engineering-radio/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 01:28:33 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=33</guid>
		<description><![CDATA[Another podcast I listen to is Software Engineering Radio.  The Debugging episode talks about how testing does not prevent the need to debug, that debugging is a search problem, and tools for estimating where source for bugs are located.
Related links:

Why Programs Fail: A Guide to Systematic Debugging by Andreas Zeller &#8211; book on Amazon

]]></description>
			<content:encoded><![CDATA[<p>Another podcast I listen to is <a title="Software Engineering Radio is a podcast targeted at the professional software developer" href="http://www.se-radio.net/">Software Engineering Radio</a>.  <a title="Andreas Zeller on Debugging" href="http://www.se-radio.net/podcast/2008-06/episode-101-andreas-zeller-debugging">The Debugging episode</a> talks about how testing does not prevent the need to debug, that debugging is a search problem, and tools for estimating where source for bugs are located.</p>
<p>Related links:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/1558608664?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1558608664">Why Programs Fail: A Guide to Systematic Debugging by Andreas Zeller &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/06/debugging-software-engineering-radio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time and attention: THE soft skill of every knowledge worker</title>
		<link>http://davidleston.com/2008/06/time-attention-soft-skill-knowledge-worker/</link>
		<comments>http://davidleston.com/2008/06/time-attention-soft-skill-knowledge-worker/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 00:52:28 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=39</guid>
		<description><![CDATA[In his talk, Time and Attention, Merlin Mann talks about being conscious of what grabs your attention, negotiating requests for attention, and communicating organization culture around communication.
I enjoyed the part about defaults.  Simple tips for improving concentration:

Configure your email client to not notify you when an email arrives.
Configure your instant messenger to not notify you [...]]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Time and Attention</strong>, <a title="Merlin Mann of 43 Folders fame" href="http://www.43folders.com/">Merlin Mann</a> talks about being conscious of what grabs your attention, negotiating requests for attention, and communicating organization culture around communication.</p>
<p>I enjoyed the part about defaults.  Simple tips for improving concentration:</p>
<ul>
<li>Configure your email client to <em>not</em> notify you when an email arrives.</li>
<li>Configure your instant messenger to <em>not</em> notify you when anyone changes status.</li>
<li>Change your browser&#8217;s home page to be something simple, something that does not display recent news, quizzes, weather, traffic, recent emails in a personal email account, recent blog posts. I prefer the fastest-loading option: <a href="http://en.wikipedia.org/wiki/About:_URI_scheme#Common_about:_addresses">about:blank</a>, and I use Firefox&#8217;s built-in search.</li>
</ul>
<a href="http://davidleston.com/2008/06/time-attention-soft-skill-knowledge-worker/"><p><em>Click here to view the embedded video.</em></p></a>
<p>I recently saw Merlin Mann speak at a <a title="Professional-grade personal task management for Mac OS X" href="http://www.omnigroup.com/applications/omnifocus/">OmniFocus</a> meeting hosted by <a title="The Omni Group develops productivity applications exclusively for Mac OS X" href="http://www.omnigroup.com/">The Omni Group</a>.</p>
<p>Related links:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/0743571657?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0743571657">Getting Things Done: The Art Of Stress-Free Productivity by David Allen &#8211; audiobook on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/06/time-attention-soft-skill-knowledge-worker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing in batches and improving maintainability</title>
		<link>http://davidleston.com/2008/06/processing-in-batches-and-improving-maintainability/</link>
		<comments>http://davidleston.com/2008/06/processing-in-batches-and-improving-maintainability/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 16:12:56 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=38</guid>
		<description><![CDATA[Here&#8217;s a common pattern:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
void process&#40;final List&#60;Foo&#62; foos&#41; &#123;
    final ArrayList&#60;bar&#62; batch = new ArrayList&#60;bar&#62;&#40;batchSize&#41;;
&#160;
    for &#40;final Foo foo : foos&#41; &#123;
        if &#40;isValid&#40;foo&#41;&#41; &#123;
            final Bar transformed = transform&#40;foo&#41;;
   [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a common pattern:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> process<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> List<span style="color: #339933;">&lt;</span>Foo<span style="color: #339933;">&gt;</span> foos<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">final</span> ArrayList<span style="color: #339933;">&lt;</span>bar<span style="color: #339933;">&gt;</span> batch <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>bar<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>batchSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Foo foo <span style="color: #339933;">:</span> foos<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>isValid<span style="color: #009900;">&#40;</span>foo<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">final</span> Bar transformed <span style="color: #339933;">=</span> transform<span style="color: #009900;">&#40;</span>foo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            batch.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>transformed<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>batch.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> batchSize <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                processBatch<span style="color: #009900;">&#40;</span>batch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                batch.<span style="color: #006633;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    processBatch<span style="color: #009900;">&#40;</span>batch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// returns true if we want to process this Foo, otherwise returns false</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">boolean</span> isValid<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Foo foo<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// makes a Bar out of a Foo</span>
<span style="color: #000000; font-weight: bold;">private</span> Bar transform<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Foo foo<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> processBatch<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> ArrayList<span style="color: #339933;">&lt;</span>Bar<span style="color: #339933;">&gt;</span> bars<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    openTransaction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Bar bar <span style="color: #339933;">:</span> bars<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        executeQuery<span style="color: #009900;">&#40;</span>bar<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    closeTransaction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We have some code duplication: <code>processBatch</code> appears twice in <code>process</code>.  Also, we&#8217;re iterating over two collections in order to process each Bar: we&#8217;re iterating over <code>foos</code> in <code>process</code> and <code>bars</code> in <code>processBatch</code>.  With the help of <a href="http://code.google.com/p/google-collections/">Google Collections</a>, we can do better:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">void</span> process<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> List<span style="color: #339933;">&lt;</span>Foo<span style="color: #339933;">&gt;</span> foos<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">final</span> Iterator<span style="color: #339933;">&lt;</span>Foo<span style="color: #339933;">&gt;</span> validFoos <span style="color: #339933;">=</span> Iterators.<span style="color: #006633;">filter</span><span style="color: #009900;">&#40;</span>foos.<span style="color: #006633;">iterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, isValid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">final</span> Iterator<span style="color: #339933;">&lt;</span>Bar<span style="color: #339933;">&gt;</span> bars <span style="color: #339933;">=</span> Iterators.<span style="color: #006633;">transform</span><span style="color: #009900;">&#40;</span>validFoos, transform<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">final</span> Iterator<span style="color: #339933;">&lt;</span>Iterator<span style="color: #339933;">&lt;</span>Bar<span style="color: #339933;">&gt;&gt;</span> batches <span style="color: #339933;">=</span> Iterators.<span style="color: #006633;">partition</span><span style="color: #009900;">&#40;</span>bars, batchSize, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>batches.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">Iterator</span> batch <span style="color: #339933;">=</span> batches.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        processBatch<span style="color: #009900;">&#40;</span>batch<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> Predicate isValid <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Predicate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// returns true if we want to process this Foo, otherwise returns false</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> apply<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Foo foo<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> Function transform <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Function<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// makes a Bar out of a Foo</span>
    <span style="color: #000000; font-weight: bold;">public</span> Bar apply<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Foo foo<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> processBatch<span style="color: #009900;">&#40;</span>Iterator<span style="color: #339933;">&lt;</span>Bar<span style="color: #339933;">&gt;</span> bars<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    openTransaction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">while</span><span style="color: #009900;">&#40;</span>bars.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">final</span> Bar bar <span style="color: #339933;">=</span> batch.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        executeQuery<span style="color: #009900;">&#40;</span>bar<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    closeTransactioin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>You may want to look at the <a href="http://google-collections.googlecode.com/svn/trunk/javadoc/index.html?com/google/common/collect/Iterators.html" title="com.google.common.collect.Iterators">Javadoc for the Iterators class in Google Collections</a> to better understand what&#8217;s happening here.</p>
<p>We removed the duplicate code. And while we still have two loops, one in <code>process</code> and one in <code>processBatch</code>, these loops are iterating over the same collection: <code>foos</code>.  In addition, <code>process</code> has fewer lines of code.  Granted, we have more lines of code elsewhere, but a real <code>process</code> method is likely to be more complex.  By reducing the number of code blocks (braces) in <code>process</code>, we&#8217;re making it easier to read and maintain.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/06/processing-in-batches-and-improving-maintainability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authoring Iterators Using Google&#8217;s Collections Library</title>
		<link>http://davidleston.com/2008/06/iterators-google-collections/</link>
		<comments>http://davidleston.com/2008/06/iterators-google-collections/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 03:23:27 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=35</guid>
		<description><![CDATA[Let&#8217;s implement an iterator.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
 * Removes duplicates from the elements returned by provided iterator.
 * The provided iterator must return the elements in the order elements in the order defined by the comparator.
 * The first element of a series of duplicates is returned by this iterator.
 * @param  Type of element returned by [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s implement an iterator.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Removes duplicates from the elements returned by provided iterator.
 * The provided iterator must return the elements in the order elements in the order defined by the comparator.
 * The first element of a series of duplicates is returned by this iterator.
 * @param  Type of element returned by the iterator.
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">class</span> DedupingOrderedCollectionIterator<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> <span style="color: #000000; font-weight: bold;">implements</span> Iterator<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> PeekingIterator<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> iterator<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> Comparator<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">super</span> E<span style="color: #339933;">&gt;</span> comparator<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param iterator iterates over an ordered collection
     * @param comparator implements the same comparison used to order the collection
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> DedupingOrderedCollectionIterator<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Iterator<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">extends</span> E<span style="color: #339933;">&gt;</span> iterator, <span style="color: #000000; font-weight: bold;">final</span> Comparator<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">super</span> E<span style="color: #339933;">&gt;</span> comparator<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">iterator</span> <span style="color: #339933;">=</span> Iterators.<span style="color: #006633;">peekingIterator</span><span style="color: #009900;">&#40;</span>iterator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">comparator</span> <span style="color: #339933;">=</span> comparator<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> hasNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> E next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">final</span> E next <span style="color: #339933;">=</span> iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> comparator.<span style="color: #006633;">compare</span><span style="color: #009900;">&#40;</span>next, iterator.<span style="color: #006633;">peek</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> next<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> remove<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">UnsupportedOperationException</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>First, if you&#8217;re confused about the generic wildcards, watch <a href="http://www.youtube.com/watch?v=pi_I7oD_uGI">Josh Bloch&#8217;s presentation entitled <b>Effective Java Reloaded</b></a> and watch for the reference of &#8220;producer extends, consumer super&#8221; (aka PECS) or reference <a title="Effective Java(TM) Programming Language Guide (The Java Series) by Joshua Bloch" href="http://www.amazon.com/gp/product/0201310058?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0201310058">Josh Bloch&#8217;s second edition of Effective Java</a>.</p>
<p>Second, using <a title="Javadoc for com.google.common.collect.PeekingIterator&lt;E&gt;" href="http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/PeekingIterator.html">Google&#8217;s PeekingIterator</a> often reduces the code you need to deal with iterators.</p>
<p>Third, when implementing an iterator, you usually have to worry about what happens when <code>next()</code> is called when <code>hasNext()</code> would return false.  What exception are you supposed to throw?  And I keep coding the same implementation for <code>remove()</code> and always forget what exception it&#8217;s supposed to throw. <a title="com.google.common.collect.AbstractIterator&lt;T&gt;" href="http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/AbstractIterator.html"> Google&#8217;s AbstractIterator</a> to the rescue!</p>
<p>Here&#8217;s the same iterator written with com.google.common.collect.AbstractIterator&lt;T&gt;:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Removes duplicates from the elements returned by provided iterator.
 * The provided iterator must return the elements in the order elements in the order defined by the comparator.
 * The first element of a series of duplicates is returned by this iterator.
 * @param  Type of element returned by the iterator.
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">class</span> DedupingOrderedCollectionIterator<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> <span style="color: #000000; font-weight: bold;">extends</span> AbstractIterator<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> PeekingIterator<span style="color: #339933;">&lt;</span>E<span style="color: #339933;">&gt;</span> iterator<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> Comparator<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">super</span> E<span style="color: #339933;">&gt;</span> comparator<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * @param iterator iterates over an ordered collection
     * @param comparator implements the same comparison used to order the collection
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> DedupingOrderedCollectionIterator<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> Iterator<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">extends</span> E<span style="color: #339933;">&gt;</span> iterator, <span style="color: #000000; font-weight: bold;">final</span> Comparator<span style="color: #339933;">&lt;?</span> <span style="color: #000000; font-weight: bold;">super</span> E<span style="color: #339933;">&gt;</span> comparator<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">iterator</span> <span style="color: #339933;">=</span> Iterators.<span style="color: #006633;">peekingIterator</span><span style="color: #009900;">&#40;</span>iterator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">comparator</span> <span style="color: #339933;">=</span> comparator<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">protected</span> E computeNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">final</span> E next <span style="color: #339933;">=</span> iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> comparator.<span style="color: #006633;">compare</span><span style="color: #009900;">&#40;</span>next, iterator.<span style="color: #006633;">peek</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">return</span> next<span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> endOfData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>AbstractIterator allows you to write concise iterators with consistent behavior.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/06/iterators-google-collections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parleys.com</title>
		<link>http://davidleston.com/2008/04/parleyscom/</link>
		<comments>http://davidleston.com/2008/04/parleyscom/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 19:53:16 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Podcast]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=32</guid>
		<description><![CDATA[Parleys.com publishes talks from software conferences.  I like seeing high-quality slides alongside video of the speaker.  Paryleys&#8217; podcast is an audio only version of the talks you can watch on their site. Two of my favorite talks are:

Flow of Change which discusses managing change in source control systems
Speaker: Tony Smith, European Technical Services Manager for [...]]]></description>
			<content:encoded><![CDATA[<p><a title="View talks from software conferences" href="http://parleys.com">Parleys.com</a> publishes talks from software conferences.  I like seeing high-quality slides alongside video of the speaker.  <a title="Parley's podcast RSS feed" href="http://parleys.libsyn.com/rss">Paryleys&#8217; podcast</a> is an audio only version of the talks you can watch on their site. Two of my favorite talks are:</p>
<ul>
<li><a title="by Tony Smith, European Technical Services Manager for Perforce Software" href="http://www.parleys.com/display/V21Beta/Home#talk=1179649;slide=1;title=Flow%20of%20Change">Flow of Change</a> which discusses managing change in source control systems<br />
Speaker: Tony Smith, European Technical Services Manager for Perforce Software</li>
<li><a title="by Mary Poppendieck author of Lean Software Development: An Agile Toolkit" href="http://www.parleys.com/display/V21Beta/Home#talk=4653075;slide=12;title=The%20Truck%20Driving%20Problem">The Truck Driving Problem</a> which discusses developing innovation<br />
Speaker: Mary Poppendieck, author of <a href="http://www.amazon.com/gp/product/0321150783?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321150783">Lean Software Development: An Agile Toolkit</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/04/parleyscom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TV Ontario&#8217;s Big Ideas</title>
		<link>http://davidleston.com/2008/04/tv-ontarios-big-ideas/</link>
		<comments>http://davidleston.com/2008/04/tv-ontarios-big-ideas/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 17:32:24 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Podcast]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=31</guid>
		<description><![CDATA[I&#8217;ve received some requests to share some of my favorite podcasts. The first I&#8217;d like to share is a non-technical podcast called Big Ideas.  It&#8217;s the only regularly scheduled program dedicated to the art of the lecture and the importance of ideas in public life.  One of my favorite Big Ideas lectures is by Oxford [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve received some requests to share some of my favorite podcasts. The first I&#8217;d like to share is a non-technical podcast called Big Ideas.  It&#8217;s the only regularly scheduled program dedicated to the art of the lecture and the importance of ideas in public life.  One of my favorite Big Ideas lectures is by Oxford University&#8217;s Harvey R. Brown.  <a title="TVO Big Ideas: February 18 2007: Harvey Brown: Motion and Time" href="http://digg.com/podcasts/Big_Ideas/266255">This lecture is a fun ride on the logic train, discussing motion and time.</a> Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2008/04/tv-ontarios-big-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creative use of closures in testing.</title>
		<link>http://davidleston.com/2007/10/creative-use-of-closures-in-testing/</link>
		<comments>http://davidleston.com/2007/10/creative-use-of-closures-in-testing/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 20:52:15 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=30</guid>
		<description><![CDATA[Having moved to Java, I do miss closures.  xUnit.net has a creative use of closures in their unit testing framework:

1
2
3
4
5
6
7
8
9
&#91;Test&#93;
public void DivideByZeroThrowsException&#40;&#41;
&#123;
  Assert.Throws&#60;System.DivideByZeroException&#62;&#40;
    delegate
    &#123;
      DivideNumbers&#40;5, 0&#41;;
    &#125;&#41;;
&#125;

This code snippet was taken from xUnit.net&#8217;s documentation.
Previously, each test method could have an expected exception.  [...]]]></description>
			<content:encoded><![CDATA[<p>Having moved to Java, I do miss closures.  xUnit.net has a creative use of closures in their unit testing framework:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>Test<span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> DivideByZeroThrowsException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  Assert.<span style="color: #0000FF;">Throws</span><span style="color: #008000;">&lt;</span><span style="color: #000000;">System</span>.<span style="color: #0000FF;">DivideByZeroException</span><span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span>
    <span style="color: #FF0000;">delegate</span>
    <span style="color: #000000;">&#123;</span>
      DivideNumbers<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">5</span>, <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>This code snippet was taken from <a href="http://www.codeplex.com/xunit/Wiki/View.aspx?title=HowToUse&amp;referringTitle=Home">xUnit.net&#8217;s documentation</a>.</p>
<p>Previously, each test method could have an expected exception.  Now, one can have multiple calls which are expected to throw an exception in a single test method.  Good thinking!</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/10/creative-use-of-closures-in-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phishing and other scams.</title>
		<link>http://davidleston.com/2007/10/phishing-and-other-scams/</link>
		<comments>http://davidleston.com/2007/10/phishing-and-other-scams/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 20:42:12 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=29</guid>
		<description><![CDATA[I always find these security talks entertaining.
In his talk, Searching for Evil, Professor Ross Anderson discusses research done by himself, Dr. Richard Clayton, Tyler Moore, Steven Murdoch, and Shishir Nagaraja.
Related links:

Security Engineering: A Guide to Building Dependable Distributed Systems by Ross J. Anderson &#8211; book on Amazon


]]></description>
			<content:encoded><![CDATA[<p>I always find these security talks entertaining.</p>
<p>In his talk, <strong>Searching for Evil</strong>, Professor <a title="biography on Wikipedia" href="http://en.wikipedia.org/wiki/Ross_Anderson">Ross Anderson</a> discusses research done by himself, Dr. Richard Clayton, Tyler Moore, Steven Murdoch, and Shishir Nagaraja.<br />
<a href="http://davidleston.com/2007/10/phishing-and-other-scams/"><p><em>Click here to view the embedded video.</em></p></a></p>
<p>Related links:</p>
<ul>
<li><span class="sans"><span id="btAsinTitle"><a title="Statistically improbable phrases found in this book: birthday theorem, emission security, statistical security, jamming margin, iris codes, copyright marking, compromising emanations" href="http://www.amazon.com/gp/product/0471389226?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0471389226">Security Engineering: A Guide to Building Dependable Distributed Systems by Ross J. Anderson &#8211; book on Amazon</a><br />
</span></span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/10/phishing-and-other-scams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design by Contract</title>
		<link>http://davidleston.com/2007/10/design-by-contract/</link>
		<comments>http://davidleston.com/2007/10/design-by-contract/#comments</comments>
		<pubDate>Sun, 14 Oct 2007 20:38:22 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=28</guid>
		<description><![CDATA[I would like to see design by contract become mainstream.  JSR-305, Annotations for Software Defect Detection, is a step in the right direction.  The applicability of this standard is broader than the name suggests.  Here&#8217;s a talk about the JSR by Bill Pugh:
I would like to see compile-time and full IDE support [...]]]></description>
			<content:encoded><![CDATA[<p>I would like to see <a href="http://en.wikipedia.org/wiki/Design_by_contract">design by contract</a> become mainstream.  <a href="http://jcp.org/en/jsr/detail?id=305">JSR-305</a>, <strong>Annotations for Software Defect Detection</strong>, is a step in the right direction.  The applicability of this standard is broader than the name suggests.  Here&#8217;s a talk about the JSR by Bill Pugh:</p>
<a href="http://davidleston.com/2007/10/design-by-contract/"><p><em>Click here to view the embedded video.</em></p></a>
<p>I would like to see compile-time and full IDE support for design by contact.</p>
<p>Related links:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/0201634600?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0201634600">Design by Contract, by Example by Richard Mitchell and Jim McKim &#8211; book on Amazon</a></li>
<li><a href="http://www.amazon.com/gp/product/0735622531?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0735622531">The Practical Guide to Defect Prevention by Marc McDonald, Robert Musson, and Ross Smith &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/10/design-by-contract/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Favorite JavaOne Videos</title>
		<link>http://davidleston.com/2007/09/favorite-javaone-videos/</link>
		<comments>http://davidleston.com/2007/09/favorite-javaone-videos/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 14:50:53 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=27</guid>
		<description><![CDATA[I&#8217;ve moved over to Java.  Here are my favorite sessions from JavaOne.
Videos require free registration. You only need to register once for all the videos.
Language:

Languag-Oriented Programming and Language Workbenches
Scala is a functional and object-ortiented language that runs on the JVM, it&#8217;s similar to F# (F sharp)

Closures for Java

Fast x86 Emulation in Java This reminds [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve moved over to Java.  Here are my favorite sessions from JavaOne.<br />
Videos require free registration. You only need to register once for all the videos.<br />
Language:</p>
<ul>
<li><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-1589/index.html">Languag-Oriented Programming and Language Workbenches</a><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-1589/index.html"></a></li>
<li><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-2844/index.html">Scala is a functional and object-ortiented language that runs on the JVM</a>, it&#8217;s similar to <a href="http://en.wikipedia.org/wiki/F_Sharp_(programming_language)">F#</a> (F sharp)<br />
<a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-2844/index.html"></a></li>
<li><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-2294/index.html">Closures for Java</a><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-2294/index.html"><br />
</a></li>
<li><a href=" http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-13820/index.html">Fast x86 Emulation in Java</a> This reminds me of the <a href="http://gcc.gnu.org/projects/cli.html">CLI back-end for GCC</a><a href="http://gcc.gnu.org/projects/cli.html"><br />
</a></li>
</ul>
<p>Architecture:</p>
<ul>
<li><a href=" http://sessions.sun.com/learning/javaoneonline/sessions/2006/TS-6037/index.html">To Know the Dependencies is to Know the Architecture &#8211; Dependency Structure Matrix</a><br />
<a href="http://sessions.sun.com/learning/javaoneonline/sessions/2006/TS-6037/index.html"></a></li>
<li><a href=" http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-1419/index.html">OSGi Best Practices</a><br />
<a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-1419/index.html"></a></li>
<li><a href=" http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-7755/index.html">Advanced Spring Framework &#8211; Spring OSGi</a><br />
<a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-7755/index.html"></a></li>
<li><a href="http://developers.sun.com/learning/javaoneonline/sessions/2006/TS-4251/index.html ">Extreme Web Caching</a><a href="http://developers.sun.com/learning/javaoneonline/sessions/2006/TS-4251/index.html "> </a></li>
</ul>
<p>Concurrency:</p>
<ul>
<li><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-2885/index.html">High-Performance Java in a Multicore World &#8211; memory latency matters</a><br />
<a href="http://sessions.sun.com/learning/javaoneonline/sessions/2007/TS-2885/index.html"></a></li>
<li><a href=" http://sessions.sun.com/learning/javaoneonline/sessions/2006/TS-5354/index.html">Scaling Up a Real Application on Azul</a><a href="http://sessions.sun.com/learning/javaoneonline/sessions/2006/TS-5354/index.html"><br />
</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/09/favorite-javaone-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automated Testing &#8211; Model-Based Testing</title>
		<link>http://davidleston.com/2007/09/automated-testing-model-based-testing/</link>
		<comments>http://davidleston.com/2007/09/automated-testing-model-based-testing/#comments</comments>
		<pubDate>Sat, 22 Sep 2007 22:05:05 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=26</guid>
		<description><![CDATA[In his talk, Model-Based Testing: Black or White?, Mark Utting discusses the difference between black-box and white-box models and their affect on the ability to automate testing.
Related links:

Practical Model-Based Testing: A Tools Approach by Mark Utting and Bruno Legeard &#8211; book on Amazon

]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Model-Based Testing: Black or White?</strong>, Mark Utting discusses the difference between black-box and white-box models and their affect on the ability to automate testing.<br />
<a href="http://davidleston.com/2007/09/automated-testing-model-based-testing/"><p><em>Click here to view the embedded video.</em></p></a></p>
<p>Related links:</p>
<ul>
<li><a title="Statistically improbable phrases found in this book: model coverage criteria, test selection criteria, predicate coverage, test selection criterion, requirements identifiers" href="http://www.amazon.com/gp/product/0123725011?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0123725011">Practical Model-Based Testing: A Tools Approach by Mark Utting and Bruno Legeard &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/09/automated-testing-model-based-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signals, Truth, &amp; Design</title>
		<link>http://davidleston.com/2007/08/signals-truth-design/</link>
		<comments>http://davidleston.com/2007/08/signals-truth-design/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:51:49 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=25</guid>
		<description><![CDATA[In her talk, Signals, Truth, &#38; Design, Judith Donath discusses intentional and unintentional signals as well as truth in signals.
Related links:

The Future of Reputation: Gossip, Rumor, and Privacy on the Internet by Daniel J. Solove &#8211; book on Amazon

]]></description>
			<content:encoded><![CDATA[<p>In her talk, <strong>Signals, Truth, &amp; Design</strong>, Judith Donath discusses intentional and unintentional signals as well as truth in signals.</p>
<a href="http://davidleston.com/2007/08/signals-truth-design/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Related links:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/0300124988?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0300124988">The Future of Reputation: Gossip, Rumor, and Privacy on the Internet by Daniel J. Solove &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/signals-truth-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closures for Java</title>
		<link>http://davidleston.com/2007/08/closures-for-java/</link>
		<comments>http://davidleston.com/2007/08/closures-for-java/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:45:15 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=24</guid>
		<description><![CDATA[In his talk, Closures for Java, Neal Gafter provides a description of and an argument for closures in Java.
]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Closures for Java</strong>, Neal Gafter provides a description of and an argument for closures in Java.</p>
<a href="http://davidleston.com/2007/08/closures-for-java/"><p><em>Click here to view the embedded video.</em></p></a>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/closures-for-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new human interface</title>
		<link>http://davidleston.com/2007/08/a-new-human-interface/</link>
		<comments>http://davidleston.com/2007/08/a-new-human-interface/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:40:10 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=23</guid>
		<description><![CDATA[In his talk, Dasher: information-efficient text entry, David MacKay introduces a unique human input mechanism, Dasher. I&#8217;ve used Dasher and quite like it.
There&#8217;s a Java applet version of Dasher, but I encourage you to try a native version.
Contributions to Dasher have been made by David MacKay, David Ward, Alan Blackwell, Phil Cowans, Tim Hospedales, Iain [...]]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Dasher: information-efficient text entry</strong>, <a title="biography on Wikipedia" href="http://en.wikipedia.org/wiki/David_MacKay_(scientist)">David MacKay</a> introduces a unique human input mechanism, <a title="official site" href="http://www.dasher.org.uk/">Dasher</a>. I&#8217;ve used Dasher and quite like it.</p>
<a href="http://davidleston.com/2007/08/a-new-human-interface/"><p><em>Click here to view the embedded video.</em></p></a>
<p>There&#8217;s a <a href="http://www.dasher.org.uk/TryJavaDasherNow.html">Java applet version of Dasher</a>, but I encourage you to try a <a title="download a native version of Dasher" href="http://www.dasher.org.uk/Download.html">native version</a>.</p>
<p>Contributions to Dasher have been made by David MacKay, David Ward, Alan Blackwell, Phil Cowans, Tim Hospedales, Iain Murray, Hanna Wallach, Matthew Garrett, Chris Ball, Keith Vertanen, Tadashi Kaburagi, Brian Williams, Chris Hack, Ingrid Jendrzejewski, Frederik Eaton, and Piotr Zielinski.</p>
<p>Related links:</p>
<ul>
<li><a title="Statistically improbable phrases found in this book: weight enumerator function, variational free energy minimization, tolerable mutation rate, soliton distribution, syndrome decoding problem, posterior probability ratio, binary symmetric channel, source coding theorem, slice sampling, erasure channel" href="http://www.amazon.com/gp/product/0521642981?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0521642981">Information Theory, Inference &amp; Learning Algorithms  by David J. C. MacKay &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/a-new-human-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faster sites mean more money.</title>
		<link>http://davidleston.com/2007/08/faster-sites-mean-more-money/</link>
		<comments>http://davidleston.com/2007/08/faster-sites-mean-more-money/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:36:31 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Usability]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[response time]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=22</guid>
		<description><![CDATA[Google found that when pages took only half a second longer to appear, usage of their site dropped 25%.  In her talk, Scaling Google for Every User at the Seattle Conference on Scalability, Marissa Mayer communicated these results. The explanation of the statistic starts around 9 minutes into the video and takes about 3 minutes.
Also, [...]]]></description>
			<content:encoded><![CDATA[<p>Google found that when pages took only half a second longer to appear, usage of their site dropped 25%.  In her talk, <strong>Scaling Google for Every User</strong> at the Seattle Conference on Scalability, Marissa Mayer communicated these results. The explanation of the statistic starts around 9 minutes into the video and takes about 3 minutes.</p>
<a href="http://davidleston.com/2007/08/faster-sites-mean-more-money/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Also, <a title="Source: Todd Hoff's blog High Scalability" href="http://highscalability.com/latency-everywhere-and-it-costs-you-sales-how-crush-it">Amazon found every 100ms of latency cost them 1% in sales</a> and <a href="http://www.stevesouders.com/blog/2009/07/27/wikia-fast-pages-retain-users/">Wikia found that faster pages reduces exit rate</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/faster-sites-mean-more-money/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pharming</title>
		<link>http://davidleston.com/2007/08/pharming/</link>
		<comments>http://davidleston.com/2007/08/pharming/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:32:05 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[exploits]]></category>
		<category><![CDATA[pharming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=21</guid>
		<description><![CDATA[In his talk, Drive-By Pharming and Other WebApp Bummers, Sid Stamm discusses creative exploits.
]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Drive-By Pharming and Other WebApp Bummers</strong>, Sid Stamm discusses creative exploits.</p>
<a href="http://davidleston.com/2007/08/pharming/"><p><em>Click here to view the embedded video.</em></p></a>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/pharming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managing Email</title>
		<link>http://davidleston.com/2007/08/managing-email/</link>
		<comments>http://davidleston.com/2007/08/managing-email/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:30:04 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[getting things done]]></category>
		<category><![CDATA[knowledge work]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=20</guid>
		<description><![CDATA[In his talk, Inbox Zero, Merlin Mann discusses one of the most important soft skills of a knowledge worker.
Related links:

Getting Things Done: The Art of Stress-Free Productivity by David Allen &#8211; book on Amazon
Lifehacker: 88 Tech Tricks to Turbocharge Your Day by Gina Trapani &#8211; book on Amazon

]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Inbox Zero</strong>, <a title="biography on Wikipedia" href="http://en.wikipedia.org/wiki/Merlin_Mann">Merlin Mann</a> discusses one of the most important soft skills of a knowledge worker.</p>
<a href="http://davidleston.com/2007/08/managing-email/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Related links:</p>
<ul>
<li><a href="http://www.amazon.com/gp/product/0142000280?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0142000280">Getting Things Done: The Art of Stress-Free Productivity by David Allen &#8211; book on Amazon</a></li>
<li><a href="http://www.amazon.com/gp/product/0470050659?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0470050659">Lifehacker: 88 Tech Tricks to Turbocharge Your Day by Gina Trapani &#8211; book on Amazon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/managing-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copyright regime vs. civil liberties</title>
		<link>http://davidleston.com/2007/08/copyright-regime-vs-civil-liberties/</link>
		<comments>http://davidleston.com/2007/08/copyright-regime-vs-civil-liberties/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 07:27:52 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[patents]]></category>
		<category><![CDATA[privacy]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=19</guid>
		<description><![CDATA[In his talk, Copyright Regime vs. Civil Liberties, Rick Falkvinge, founder of the Swedish Pirate Party, makes an interesting argument.
Related links:

The same talk given at Stanford Law School
QuestionCopyright.org

]]></description>
			<content:encoded><![CDATA[<p>In his talk, <strong>Copyright Regime vs. Civil Liberties</strong>, <a title="biography on Wikipedia" href="http://en.wikipedia.org/wiki/Rick_Falkvinge">Rick Falkvinge</a>, founder of the Swedish <a href="http://en.wikipedia.org/wiki/Pirate_Party">Pirate Party</a>, makes an interesting argument.</p>
<a href="http://davidleston.com/2007/08/copyright-regime-vs-civil-liberties/"><p><em>Click here to view the embedded video.</em></p></a>
<p>Related links:</p>
<ul>
<li><a href="http://video.google.com/videoplay?docid=-2541736281918823479">The same talk given at Stanford Law School</a></li>
<li><a href="http://QuestionCopyright.org">QuestionCopyright.org</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2007/08/copyright-regime-vs-civil-liberties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Functional list processing with anonymous delegates</title>
		<link>http://davidleston.com/2006/12/functional-list-processing-with-anonymous-delegates/</link>
		<comments>http://davidleston.com/2006/12/functional-list-processing-with-anonymous-delegates/#comments</comments>
		<pubDate>Mon, 18 Dec 2006 09:55:46 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=17</guid>
		<description><![CDATA[Derrick Coetzee has an article about functional list processing with anonymous delegates. Keep code close to where it&#8217;s used.
]]></description>
			<content:encoded><![CDATA[<p>Derrick Coetzee has an article about <a href="http://blogs.msdn.com/devdev/archive/2006/06/30/652802.aspx">functional list processing with anonymous delegates</a>. Keep code close to where it&#8217;s used.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/12/functional-list-processing-with-anonymous-delegates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using @ infront of literal strings</title>
		<link>http://davidleston.com/2006/06/using-infront-of-literal-strings/</link>
		<comments>http://davidleston.com/2006/06/using-infront-of-literal-strings/#comments</comments>
		<pubDate>Fri, 16 Jun 2006 04:28:02 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=12</guid>
		<description><![CDATA[Using @ infront of literal strings lets you do:
instead of:
&#8220;C:\\directory\\file.xml&#8221;
or
&#8220;SELECT field FROM table where field=var&#8221;
you can do:
@&#8221;C:\directory\file.xml&#8221;
and
@&#8221;SELECT
field
FROM
table
WHERE
field = var&#8221;
]]></description>
			<content:encoded><![CDATA[<p>Using @ infront of literal strings lets you do:</p>
<p>instead of:<br />
&#8220;C:\\directory\\file.xml&#8221;<br />
or<br />
&#8220;SELECT field FROM table where field=var&#8221;</p>
<p>you can do:<br />
@&#8221;C:\directory\file.xml&#8221;<br />
and<br />
@&#8221;SELECT<br />
field<br />
FROM<br />
table<br />
WHERE<br />
field = var&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/06/using-infront-of-literal-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FTP with streams in .net c# vb.net</title>
		<link>http://davidleston.com/2006/06/ftp-with-streams-in-net-c-vbnet/</link>
		<comments>http://davidleston.com/2006/06/ftp-with-streams-in-net-c-vbnet/#comments</comments>
		<pubDate>Sat, 10 Jun 2006 06:28:01 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=11</guid>
		<description><![CDATA[There needs to be a good opensource ftp library for .net.  I want to be able to write to the FTP stream, not pass a byte array or even a pointer to a file.  Why can&#8217;t I get a
Stream Upload(string filename)
closing the stream would just end the file upload, not the network connection.  And I [...]]]></description>
			<content:encoded><![CDATA[<p>There needs to be a good opensource ftp library for .net.  I want to be able to write to the FTP stream, not pass a byte array or even a pointer to a file.  Why can&#8217;t I get a</p>
<p>Stream Upload(string filename)</p>
<p>closing the stream would just end the file upload, not the network connection.  And I want multiple connections and async methods.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/06/ftp-with-streams-in-net-c-vbnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen scraping poker web sites</title>
		<link>http://davidleston.com/2006/06/screen-scraping-poker-web-sites/</link>
		<comments>http://davidleston.com/2006/06/screen-scraping-poker-web-sites/#comments</comments>
		<pubDate>Sat, 10 Jun 2006 06:13:49 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=10</guid>
		<description><![CDATA[Screen scraping is very brittle.  It will require continual maintenance and will never be complete.  A good screen scraper is like writing a parser.  Extracting semantic meaning from text with a poor signal to noise ratio is non-trivial.
Ideally, you would access the data via an API or a feed.  Google, Amazon, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Screen_scraping">Screen scraping</a> is very brittle.  It will require continual maintenance and will never be complete.  A good screen scraper is like writing a parser.  Extracting semantic meaning from text with a poor signal to noise ratio is non-trivial.</p>
<p>Ideally, you would access the data via an API or a feed. <a title="Google APIs" href="http://code.google.com/more/#products-apis-android"> Google</a>, <a title="Amazon Web Services" href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fbrowse.html%3Fnode%3D3435361&amp;tag=davidleston-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Amazon</a>, <a title="Flickr APIs" href="http://www.flickr.com/services/api/">Flickr</a> and many other sites provide free programmatic access to data.  Sites like <a title="Ebates feeds" href="http://www.ebates.com/cash-back/rss-feeds.htm">Ebates</a> offer feeds of data for free.  If your data is not available for free, you may be able to purchase access to an API or feed.</p>
<p>Screen scraping can be used well for other purposes, e.g. testing the UI layer of a web application.  In this application of screen scraping, the same organization generates and tests the UI.</p>
<p>What you really want is to be inside these poker web sites.  You want to be able to be a sort of plug-in for your customers.  I suggest taking a look at <a href="http://bookburro.org/">the Book Burro extension for Firefox</a>, then visit <a title="Webbots, Spiders, and Screen Scrapers: A Guide to Developing Internet Agents with PHP/CURL by Michael Schrenk" href="http://www.amazon.com/gp/product/1593271204?ie=UTF8&amp;tag=davidleston-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=1593271204">Amazon</a>.  Book Burro adds an interface widget on top of the Amazon page with prices from other bookstores on the web.  This is a cross-platform solution.</p>
<p>I&#8217;ve read that the poker sites aren&#8217;t much bothered by &#8216;poker bots&#8217;.  As long as people gamble, they&#8217;re happy.  Maybe you could find a poker site that would let you plug in your software&#8230; or make your own site for all the users of your software to play on and they think they&#8217;re playing other people.  A game server, now that&#8217;s a completely different kind of software.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/06/screen-scraping-poker-web-sites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple Store sessions time out.</title>
		<link>http://davidleston.com/2006/04/apple-store-sessions-time-out/</link>
		<comments>http://davidleston.com/2006/04/apple-store-sessions-time-out/#comments</comments>
		<pubDate>Sat, 01 Apr 2006 08:07:55 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=8</guid>
		<description><![CDATA[You have to re-enter the store if you&#8217;ve been idle.
That&#8217;s bad.
]]></description>
			<content:encoded><![CDATA[<p>You have to re-enter the store if you&#8217;ve been idle.</p>
<p>That&#8217;s bad.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/04/apple-store-sessions-time-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faster first byte.</title>
		<link>http://davidleston.com/2006/02/faster-first-byte/</link>
		<comments>http://davidleston.com/2006/02/faster-first-byte/#comments</comments>
		<pubDate>Mon, 20 Feb 2006 08:57:18 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=7</guid>
		<description><![CDATA[override render(HtmlWriter)
HtmlWriter.Flush
DoSomeExpensiveOperation
// or join with a thread that&#8217;s loading state
base.Render(HtmlWriter)
This way, you can send the headers and navigation to the client so they&#8217;ll see something while you&#8217;re waiting for something to finish.  Perhaps the client won&#8217;t even finish downloading the headers when the render completes, you&#8217;ve gotten the first byte out faster.
]]></description>
			<content:encoded><![CDATA[<p>override render(HtmlWriter)<br />
HtmlWriter.Flush<br />
DoSomeExpensiveOperation<br />
// or join with a thread that&#8217;s loading state<br />
base.Render(HtmlWriter)</p>
<p>This way, you can send the headers and navigation to the client so they&#8217;ll see something while you&#8217;re waiting for something to finish.  Perhaps the client won&#8217;t even finish downloading the headers when the render completes, you&#8217;ve gotten the first byte out faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/02/faster-first-byte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consider restoring view state from the previous sessions.</title>
		<link>http://davidleston.com/2006/02/consider-restoring-view-state-from-the-previous-sessions/</link>
		<comments>http://davidleston.com/2006/02/consider-restoring-view-state-from-the-previous-sessions/#comments</comments>
		<pubDate>Mon, 20 Feb 2006 08:48:51 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=6</guid>
		<description><![CDATA[Many Integrated Development Environments do this.  Stickies on Mac does this.  Email clients retain sort preferences.  Why not save sort preferences in a web application? Why doesn’t my Instant Messaging client bring up the conversation windows I didn’t explicitly close?  My DVD player asks me if I want to continue from the last time I [...]]]></description>
			<content:encoded><![CDATA[<p>Many Integrated Development Environments do this.  Stickies on Mac does this.  Email clients retain sort preferences.  Why not save sort preferences in a web application? Why doesn’t my Instant Messaging client bring up the conversation windows I didn’t explicitly close?  My DVD player asks me if I want to continue from the last time I was watching that specific video.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/02/consider-restoring-view-state-from-the-previous-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should you be persisting more state?</title>
		<link>http://davidleston.com/2006/02/should-you-be-persisting-more-state/</link>
		<comments>http://davidleston.com/2006/02/should-you-be-persisting-more-state/#comments</comments>
		<pubDate>Mon, 20 Feb 2006 08:47:15 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.davidleston.com/?p=5</guid>
		<description><![CDATA[Lost state is state that has been destroyed, deleted, garbage collected or otherwise removed from storage not because of some domain specified reason.  In the best case because of limited storage capabilities, but because the value of the state is underestimated.
Microsoft Word has autosave.  By default, every ten minutes the document you’re editing is persisted [...]]]></description>
			<content:encoded><![CDATA[<p>Lost state is state that has been destroyed, deleted, garbage collected or otherwise removed from storage not because of some domain specified reason.  In the best case because of limited storage capabilities, but because the value of the state is underestimated.</p>
<p>Microsoft Word has autosave.  By default, every ten minutes the document you’re editing is persisted to disk in case of an unexpected termination of the application.  I always change this to one minute, because why would you ever want to wait ten?</p>
<p>And why doesn’t New Egg’s shopping cart remember what I had in it?  I’ve had business people tell me customers get angry when they see items in their cart many months later.  I argue, at least have it be an option to review.  Like an automated (private) wish list.</p>
<p>Suppose you have a web server produce views of product information that is expensive to acquire. Perhaps it’s over a web service or a remote database.  Often, you’ll cache this information in memory, trading aging data for faster request processing.  But what if there’s a power outage, and both the web server and database suddenly shut down.  If your application starts running before the web service or database, then your application is missing an opportunity to process requests. If you had stale data, you could still provide information to anxious customers.  Even if you didn’t want to show old quantity levels or prices, you could still provide a description, and maybe a notice that you’ll be fully operational in a moment.</p>
<p>Consider dumping in-memory state, such as a cache, to disk if the connection to the data source is lost or during low load.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidleston.com/2006/02/should-you-be-persisting-more-state/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
