<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Java on Chase the Devil</title>
		<link>https://31416.org/tags/java/</link>
		<description>Recent content in Java on Chase the Devil</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Sun, 07 Jun 2026 03:43:00 +0000</lastBuildDate>
		
			<atom:link href="https://31416.org/tags/java/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>A Bachelier Normal Implied Volatility Solver</title>
				<link>https://31416.org/post/a-faster-bachelier-normal-implied-volatility-solver/</link>
				<pubDate>Sun, 07 Jun 2026 03:43:00 +0000</pubDate>
				<guid>https://31416.org/post/a-faster-bachelier-normal-implied-volatility-solver/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://www.clarusft.com/bachelier-model-fast-accurate-implied-volatility/&#34;&gt;Around 2014&lt;/a&gt;, I &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2420757&#34;&gt;proposed&lt;/a&gt; a few Bachelier implied volatility &amp;ldquo;solvers&amp;rdquo;. The first one was inspired by Steven G. Johnson&amp;rsquo;s Faddeeva package for the complex error function: it used a piecewise Chebyshev polynomial representation to have a near machine accurate representation of the Bachelier implied volatility. Why did I put &amp;ldquo;solver&amp;rdquo; in quotes? Because the problem can be reduced to a 1D function representation (as originally shown by &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=990747&#34;&gt;Choi, Kim and Kwak&lt;/a&gt; in 2009). Then, I was encouraged by Gary Kennedy to find a simpler rational function approximation, I used 3 or 4 rational functions to cover the full range of the Bachelier implied volatility function.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The Role of Erfcx and Erfc in the Black-Scholes Formula</title>
				<link>https://31416.org/post/black-formula-erfcx-erfc-backends/</link>
				<pubDate>Sat, 30 May 2026 03:43:00 +0000</pubDate>
				<guid>https://31416.org/post/black-formula-erfcx-erfc-backends/</guid>
				<description>&lt;p&gt;This note compares special-function choices at the level that matters to the &lt;a href=&#34;https://31416.org/post/a-faster-monotone-implied-volatility-solver/&#34;&gt;implied volatility solvers&lt;/a&gt;: the normalized Black beta price, not &lt;a href=&#34;https://31416.org/post/erfcx-cody-commons-johnson/&#34;&gt;standalone &lt;code&gt;erfcx(x)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For &lt;code&gt;x = log(F/K) &amp;lt;= 0&lt;/code&gt; and total volatility &lt;code&gt;s = sigma sqrt(T)&lt;/code&gt;, the beta-space OTM call price is&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;B(x, s) = 0.5 * (exp(x/2) * erfc(q1) - exp(-x/2) * erfc(q2))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;q1 = -(x/s + s/2) / sqrt(2)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;q2 = -(x/s - s/2) / sqrt(2)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The corresponding forward-normalized OTM-call price is &lt;code&gt;c = B(x, s) / sqrt(ex)&lt;/code&gt;, with &lt;code&gt;ex = exp(x)&lt;/code&gt;.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Which erfcx?</title>
				<link>https://31416.org/post/erfcx-cody-commons-johnson/</link>
				<pubDate>Sun, 24 May 2026 03:43:00 +0000</pubDate>
				<guid>https://31416.org/post/erfcx-cody-commons-johnson/</guid>
				<description>&lt;p&gt;The &lt;a href=&#34;https://31416.org/post/a-faster-monotone-implied-volatility-solver/&#34;&gt;use of erfcx&lt;/a&gt; instead of direct erfc or CDF in a Black-Scholes implied volatility solver leads to gain in accuracy and performance in general. But which erfcx should we use?&lt;/p&gt;&#xA;&lt;p&gt;This note compares practical erfcx implementations for Rust implied volatility solvers:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Commons: the local Rust port of &lt;a href=&#34;https://github.com/apache/commons-numbers/blob/master/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/BoostErf.java&#34;&gt;Apache Commons Numbers&lt;/a&gt; &lt;code&gt;BoostErf.erfcx&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Cody: the &lt;a href=&#34;https://docs.rs/jaeckel/latest/jaeckel/fn.erfcx_cody.html&#34;&gt;Cody rational approximation&lt;/a&gt; exposed by the &lt;code&gt;jaeckel = 0.2.0&lt;/code&gt; crate during this comparison, originally coming from   &lt;a href=&#34;https://www.netlib.org/slatec/src/&#34;&gt;Netlib SLATEC library&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Johnson: Steven G. Johnson&amp;rsquo;s Faddeeva implementation, as exposed by &lt;code&gt;errorfunctions = 0.2.0&lt;/code&gt;, &lt;a href=&#34;https://github.com/Cactus-proj/special-functions/tree/main/sys/faddeeva-sys&#34;&gt;&lt;code&gt;faddeeva-sys = 0.1.0&lt;/code&gt;&lt;/a&gt;, and Julia &lt;code&gt;SpecialFunctions.erfcx(::Float64)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The Commons-style implementation is a local Rust port of the &lt;a href=&#34;https://issues.apache.org/jira/si/jira.issueviews:issue-html/NUMBERS-177/NUMBERS-177.html&#34;&gt;Apache Commons Numbers/BoostErf approach&lt;/a&gt;. It computes the small central region through the local &lt;code&gt;erf&lt;/code&gt; rational approximation and uses &lt;code&gt;exp_m1(x*x)&lt;/code&gt; to avoid cancellation in &lt;code&gt;exp(x^2) * erfc(x)&lt;/code&gt; near zero. For positive inputs it uses several rational subintervals: a central polynomial/rational &lt;code&gt;erf&lt;/code&gt; branch, erfc-style rational branches around &lt;code&gt;0.5..1.5&lt;/code&gt;, &lt;code&gt;1.5..2.5&lt;/code&gt;, and &lt;code&gt;2.5..4&lt;/code&gt;,  and a rational function taken from &lt;em&gt;Rational Chebyshev approximations for the error function&lt;/em&gt;  by W. J. Cody, Math. Comp., 1969, PP. 631-638 beyond that. For very large positive &lt;code&gt;x&lt;/code&gt;, it returns &lt;code&gt;1 / (sqrt(pi) * x)&lt;/code&gt;. For negative &lt;code&gt;x&lt;/code&gt;, it uses the reflected form with a split-square exponential, returns &lt;code&gt;Inf&lt;/code&gt; below the finite overflow cutoff, and otherwise computes &lt;code&gt;2 exp(x^2) - erfcx(|x|)&lt;/code&gt; in a way that preserves more bits near the overflow boundary.&lt;/p&gt;</description>
			</item>
			<item>
				<title>A Faster Monotone Implied Volatiltty Solver</title>
				<link>https://31416.org/post/a-faster-monotone-implied-volatility-solver/</link>
				<pubDate>Sat, 23 May 2026 03:43:00 +0000</pubDate>
				<guid>https://31416.org/post/a-faster-monotone-implied-volatility-solver/</guid>
				<description>&lt;p&gt;Choi, Huh and Su have &lt;a href=&#34;https://arxiv.org/pdf/2302.08758&#34;&gt;a very good paper&lt;/a&gt; entitled  &lt;em&gt;Tighter uniform bounds for Black–Scholes implied volatility and the applications to root-finding&lt;/em&gt;. What&amp;rsquo;s particularly great is that it gives both a decent lower bound and a proof a monotone convergence using Newton&amp;rsquo;s method starting from this lower bound.&lt;/p&gt;&#xA;&lt;p&gt;The industry standard for solving the Black-Scholes implied volatility is Peter Jäckel &lt;a href=&#34;http://www.jaeckel.org/LetsBeRational.pdf&#34;&gt;&lt;em&gt;Let&amp;rsquo;s be rational&lt;/em&gt;&lt;/a&gt;. I was wondering if one could not create a robust mathematically backed solver at least as fast and accurate as Jäckel&amp;rsquo;s algorithm.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Senior Developers Don&#39;t Know OO Anymore</title>
				<link>https://31416.org/post/senior-developers-dont-know-oo-anymore/</link>
				<pubDate>Thu, 08 Mar 2018 20:56:42 +0100</pubDate>
				<guid>https://31416.org/post/senior-developers-dont-know-oo-anymore/</guid>
				<description>&lt;p&gt;It has been a while since the good old object-oriented (OO) programming is not trendy anymore. Functional programming or more dynamic programming (Python-based) have been the trend, with an excursion in template based programming for C++ guys. Those are not strict categories: Python can be used in a very OO way, but it&amp;rsquo;s not how it is marketed or considered by the community.&lt;/p&gt;&#xA;&lt;p&gt;Recently, I have seen some of the ugliest refactoring in my life as a programmer, done by someone with at least 10 years of experience programming in Java. It is a good illustration because the piece of code is particularly simple (although I won&amp;rsquo;t bother with implementation details). The original code was a simple boolean method on an object such as&lt;/p&gt;</description>
			</item>
			<item>
				<title>Modern Programming Language for Monte-Carlo</title>
				<link>https://31416.org/post/modern-programming-language-for-monte-carlo/</link>
				<pubDate>Sat, 18 Apr 2015 22:58:00 +0000</pubDate>
				<guid>https://31416.org/post/modern-programming-language-for-monte-carlo/</guid>
				<description>&lt;p&gt;A few recent programming languages sparked my interest:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://julialang.org/&#34;&gt;Julia&lt;/a&gt; because of the wide coverage of mathematical functions, and great attention to quality of the implementations. It has also some interesting web interface.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.dartlang.org&#34;&gt;Dart&lt;/a&gt;: because it&amp;rsquo;s a language focused purely on building apps for the web, and has a supposedly good VM.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.rust-lang.org/&#34;&gt;Rust&lt;/a&gt;: it&amp;rsquo;s the latest fad. It has interesting concepts around concurrency and a focus on being low level all the while being simpler than C.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I decided to see how well suited they would be on a simple Monte-Carlo simulation of a forward start option under the Black model. I am no expert at all in any of the languages, so this is a beginner&amp;rsquo;s test. I compared the runtime for executing 16K simulations times a multiplier.&lt;/p&gt;</description>
			</item>
			<item>
				<title>On the Role of Static Types and Generic Types on Productivity</title>
				<link>https://31416.org/post/on-the-role-of-static-types-and-generic-types-on-productivity/</link>
				<pubDate>Sun, 29 Jun 2014 10:40:00 +0000</pubDate>
				<guid>https://31416.org/post/on-the-role-of-static-types-and-generic-types-on-productivity/</guid>
				<description>Most developers have strong opinions on dynamic types programming languages vs static types programming languages. The former is often assumed to be good for small projects/prototyping while the later better for bigger projects. But there is a surprisingly small number of studies to back those claims.&lt;br /&gt;&lt;br /&gt;One such study is &#34;&lt;a href=&#34;http://diyhpl.us/~bryan/papers2/paperbot/7a01e5a892a6d7a9f408df01905f9359.pdf&#34; target=&#34;_blank&#34;&gt;An experiment about static and dynamic type systems: doubts about the positive impact of static type systems on development time&lt;/a&gt;&#34; and came to the conclusion that on a small project, static typing did not decrease programming time, and actually increased debugging time. However 4 years later, &#34;&lt;a href=&#34;http://users.dcc.uchile.cl/~rrobbes/p/ICPC2014-idetypes.pdf&#34; target=&#34;_blank&#34;&gt;An empirical comparison of static and dynamic type systems on API usage in the presence of an IDE: Java vs. groovy with eclipse&lt;/a&gt;&#34; shows that a developer is 2x more productive with Java than with Groovy using an unknown API. This contrasts a bit (but does not contradict) with their previous study &#34;&lt;a href=&#34;http://swp.dcc.uchile.cl/TR/2012/TR_DCC-20120418-005.pdf&#34; target=&#34;_blank&#34;&gt;Static Type Systems (Sometimes) have a Positive Impact on the Usability of Undocumented Software: An Empirical Evaluation&lt;/a&gt;&#34; that showed Groovy to be more productive on small projects. One problem is that all these studies stem from the same person.&lt;br /&gt;&lt;br /&gt;It&#39;s more interesting to look at generic types vs raw types use, where even less studies have been done. &#34;&lt;a href=&#34;http://dl.acm.org/citation.cfm?id=2509528&#34; target=&#34;_blank&#34;&gt;Do developers benefit from generic types?: an empirical comparison of generic and raw types in java&lt;/a&gt;&#34; concludes that generic types do not provide any advantages to fix typing errors, hardly surprising in my opinion. Generic types (especially with type erasure as in Java) is the typical idea that sounds good but that in practice does not really help: it makes the code actually more awkward to read and tend to make developers too lazy to create new classes that would often be more appropriate than a generic type (think Map&amp;lt;String,List&amp;lt;Map&amp;lt;String, Date&amp;gt;&amp;gt;&amp;gt;).</description>
			</item>
			<item>
				<title>throws Exception</title>
				<link>https://31416.org/post/throws-exception/</link>
				<pubDate>Tue, 27 May 2014 10:49:00 +0000</pubDate>
				<guid>https://31416.org/post/throws-exception/</guid>
				<description>There was a big debate at work around Exception declaration in a Java API. I was quite surprised that such an apparently simple subject could end up being so controversial. The controversy was around the choice of declaring in the interfaces:&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-size: x-small;&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;void myMethod() throws Exception&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;instead of&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&lt;span style=&#34;font-size: x-small;&#34;&gt;void myMethod() throws MyAPIException&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&lt;span style=&#34;font-size: x-small;&#34;&gt;void myMethod() throws MyAPIRuntimeException&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&lt;span style=&#34;font-size: x-small;&#34;&gt;void myMethod() &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where MyAPI represents either a generic API related exception or a specific exception related to the method in question.&lt;br /&gt;&lt;br /&gt;The choice of &#34;throws Exception&#34; did not even occur to me as a possibility, but after some digging, I found that some relatively famous libraries actually followed that principle at one point, for example Apache Struts 1.x or Spring MVC. &lt;br /&gt;&lt;br /&gt;More modern libraries, like Google Guava, commons-math 3.x, Struts 2.x generally favor MyAPIRuntimeException where MyAPI is actually context-specific. Some old popular libraries declare a checked Exception, for example the HibernateException in Hibernate.&lt;br /&gt;&lt;br /&gt;This seems to be a recurring subject on Stackoverflow:&lt;br /&gt;&lt;a href=&#34;http://stackoverflow.com/questions/20530221/java-interface-throws-exception-best-practice&#34; target=&#34;_blank&#34;&gt;Stackoverflow - Java interface throws Exception best practice&lt;/a&gt;&lt;br /&gt;&lt;a href=&#34;http://stackoverflow.com/questions/4283634/what-to-put-in-the-throws-clause-of-an-interface-method&#34; target=&#34;_blank&#34;&gt;Stackoverflow - What to put in the throws clause of an interface method&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But those are quite poor in terms of explanations. The best comments on this subjects are from:&lt;br /&gt;&lt;a href=&#34;http://www.artima.com/intv/handcuffs.html&#34;&gt;&lt;span class=&#34;ts&#34;&gt;Anders         Hejlsberg (C#, Delphi, Turbo Pascal creator) - The Trouble with         Checked Exceptions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;    &lt;a href=&#34;http://www.artima.com/intv/solid2.html&#34;&gt;&lt;span class=&#34;ts&#34;&gt;James         Gosling (Java creator) - Failure and Exceptions&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;This comment from Anders is particularly acute:&lt;br /&gt;    &#34;&lt;b&gt;To work around this requirement, people do ridiculous things.       For example, they decorate every method with, &#34;&lt;/b&gt;&lt;b&gt;&lt;code&gt;throws         Exception&lt;/code&gt;&lt;/b&gt;&lt;b&gt;.&#34; That just completely defeats the       feature, and you just made the programmer write more gobbledy       gunk. That doesn&#39;t help anybody.&lt;/b&gt;    &#34;&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;         &lt;br /&gt;Today I believe the API in question declares &#34;throws Exception&#34;... &lt;br /&gt;         &lt;br /&gt;&lt;br /&gt;</description>
			</item>
			<item>
				<title>5 Minutes of Xtend</title>
				<link>https://31416.org/post/5-minutes-of-xtend/</link>
				<pubDate>Tue, 08 Apr 2014 17:37:00 +0000</pubDate>
				<guid>https://31416.org/post/5-minutes-of-xtend/</guid>
				<description>&lt;p&gt;There is a relatively new JVM based language, &lt;a href=&#34;https://www.eclipse.org/xtend&#34;&gt;Xtend&lt;/a&gt;. Their homepage says &amp;ldquo;&lt;em&gt;JAVA 10, TODAY!&lt;/em&gt;&amp;rdquo;, so I thought I would give it a try, I was especially interested in operator overloading support, and the fact that it compiles to Java code, not Java byte code.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately, after 5 minutes with it, and pasting some non Java code in an xtend file, Eclipse hangs forever, even on restart. After creating another workspace, just to trash the new workspace a similar way. This is quite incredible for a nearly 2 years old project, on eclipse.org.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Julia and the Cumulative Normal Distribution</title>
				<link>https://31416.org/post/julia-and-the-cumulative-normal-distribution/</link>
				<pubDate>Tue, 13 Aug 2013 15:52:00 +0000</pubDate>
				<guid>https://31416.org/post/julia-and-the-cumulative-normal-distribution/</guid>
				<description>&lt;p&gt;I just stumbled upon &lt;!-- raw HTML omitted --&gt;Julia&lt;!-- raw HTML omitted --&gt;, a new programming language aimed at numerical computation. It&amp;rsquo;s quite new but it looks very interesting, with the promise of C like performance (thanks to LLVM compilation) with a much nicer syntax and parallelization features.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Out of curiosity, I looked at their cumulative normal distribution implementation. I found that the (complimentary) error function (directly related to the cumulative normal distribution) algorithm relies on an algorithm that can be found in the Faddeeva library. I had not heard of this algorithm or this library before, but the author, &lt;!-- raw HTML omitted --&gt;Steven G. Johnson&lt;!-- raw HTML omitted --&gt;, claims it is faster and as precise as Cody &amp;amp; SLATEC implementations. As &lt;!-- raw HTML omitted --&gt;I previously had a look at those algorithms&lt;!-- raw HTML omitted --&gt; and was quite impressed by Cody&amp;rsquo;s implementation.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;The &lt;!-- raw HTML omitted --&gt;source of Faddeeva&lt;!-- raw HTML omitted --&gt; shows a big list (100) of Chebychev expansions for various ranges of a normalized error function. I slightly modified the Faddeva code to compute directly the cumulative normal distribution, avoiding some exp(-x&lt;em&gt;x)&lt;em&gt;exp(x&lt;/em&gt;x) calls on the way.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Is it as accurate? I compared against a high precision implementation as in my previous test of cumulative normal distribution algorithms. And after replacing the exp(-x&lt;/em&gt;x) with &lt;!-- raw HTML omitted --&gt;Cody&amp;rsquo;s trick&lt;!-- raw HTML omitted --&gt; to compute it with higher accuracy, here is how it looks (referenced as &amp;ldquo;Johnson&amp;rdquo;).&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;I also measured performance on various ranges, and found out that this Johnson algorithm is around 2x faster than Cody (in Scala) and 30% faster than my optimization of Cody (using a table of exponentials for Cody&amp;rsquo;s trick).&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Octave vs Scilab for PDEs in Finance</title>
				<link>https://31416.org/post/octave-vs-scilab-for-pdes-in-finance/</link>
				<pubDate>Tue, 30 Jul 2013 12:10:00 +0000</pubDate>
				<guid>https://31416.org/post/octave-vs-scilab-for-pdes-in-finance/</guid>
				<description>&lt;p&gt;I was used to &lt;a href=&#34;https://www.scilab.org&#34;&gt;Scilab&lt;/a&gt; for small experiments involving linear algebra. I also like some of Scilab choices in algorithms: for example it provides PCHIM monotonic spline algorithm, and uses Cody for the cumulative normal distribution.&lt;/p&gt;&#xA;&lt;p&gt;Matlab like software is particularly well suited to express PDE solvers in a relatively concise manner. To illustrate some of my experiments, I started to write a Scilab script for the &lt;a href=&#34;https://31416.org/post/sabr-with-the-new-hagan-pde-approach/&#34;&gt;Arbitrage Free SABR problem&lt;/a&gt;. It worked nicely and is a bit nicer to read than my equivalent Scala program. But I was a bit surprised by the low performance.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The CUDA Performance Myth II</title>
				<link>https://31416.org/post/the-cuda-performance-myth-ii/</link>
				<pubDate>Fri, 12 Jul 2013 15:23:00 +0000</pubDate>
				<guid>https://31416.org/post/the-cuda-performance-myth-ii/</guid>
				<description>&lt;p&gt;This is a kind of following to the &lt;a href=&#34;http://chasethedevil.github.io/post/the-cuda-performance-myth/&#34;&gt;CUDA performance myth&lt;/a&gt;. There is a recent news on the java concurrent mailing list about &lt;a href=&#34;http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/SplittableRandom.java?revision=1.7&amp;amp;view=markup&#34;&gt;SplittableRandom class&lt;/a&gt; proposed for JDK8. It is a new parallel random number generator a priori usable for Monte-Carlo simulations.&lt;/p&gt;&#xA;&lt;p&gt;It seems to rely on some very recent algorithm. There are some a bit older ones: the ancestor, L&amp;rsquo;Ecuyer &lt;a href=&#34;http://www.iro.umontreal.ca/~simardr/rng/MRG32k3a.c&#34;&gt;MRG32k3a&lt;/a&gt; that can be parallelized through relatively costless skipTo methods, a Mersenne Twister variant &lt;a href=&#34;http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MTGP/&#34;&gt;MTGP&lt;/a&gt;, and even the less rigourous XorWow popularized by NVidia CUDA.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Simple &#39;Can Scala Do This?&#39; Questions</title>
				<link>https://31416.org/post/simple-can-scala-do-this-questions/</link>
				<pubDate>Tue, 11 Jun 2013 00:28:00 +0000</pubDate>
				<guid>https://31416.org/post/simple-can-scala-do-this-questions/</guid>
				<description>&lt;p&gt;Today, a friend asked me if Scala could pass primitives (such as Double) by reference. It can be useful sometimes instead of creating a full blown object. In Java there is commons lang MutableDouble. It could be interesting if there was some optimized way to do that.&lt;/p&gt;&#xA;&lt;p&gt;One answer could be: it&amp;rsquo;s not functional programming oriented and therefore not too surprising this is not encouraged in Scala.&lt;/p&gt;&#xA;&lt;p&gt;Then he wondered if we could use it for C#.&lt;/p&gt;</description>
			</item>
			<item>
				<title>SABR with the new Hagan PDE Approach</title>
				<link>https://31416.org/post/sabr-with-the-new-hagan-pde-approach/</link>
				<pubDate>Tue, 28 May 2013 15:56:00 +0000</pubDate>
				<guid>https://31416.org/post/sabr-with-the-new-hagan-pde-approach/</guid>
				<description>At a presentation of the Thalesians, Hagan has presented a new PDE based approach to compute arbitrage free prices under SABR. This is similar in spirit as Andreasen-Huge, but the PDE is directly on the density, not on the prices, and there is no one-step procedure: it&#39;s just like a regular PDE with proper boundary conditions.&lt;br /&gt;&lt;br /&gt;I was wondering how it compared to Andreasen Huge results.&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-yg9JIC5LoI0/UaSx8aHdOpI/AAAAAAAAGbo/8LI0NAKhI_A/s1600/snapshot14.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-yg9JIC5LoI0/UaSx8aHdOpI/AAAAAAAAGbo/8LI0NAKhI_A/s640/snapshot14.png&#34; height=&#34;304&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;My first implementation was quite slow. I postulated it was likely the Math.pow function calls. It turns out they could be reduced a great deal. As a result, it&#39;s now quite fast. But it would still be much slower than Andreasen Huge. Typically, one might use 40 time steps, while Andreasen Huge is 1, so it could be around a 40 to 1 ratio. In practice it&#39;s likely to be less than 10x slower, but still.&lt;br /&gt;&lt;br /&gt;While looking at the implied volatilities I found something intriguing with Andreasen Huge: the implied volatilities from the refined solution using the corrected forward volatility look further away from the Hagan implied volatilitilies than without adjustment, and it&#39;s quite pronounced at the money.&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-SgFohuLcgdE/UaSzjuSlcAI/AAAAAAAAGb4/AwXdfuDDQ7o/s1600/snapshot15.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-SgFohuLcgdE/UaSzjuSlcAI/AAAAAAAAGb4/AwXdfuDDQ7o/s640/snapshot15.png&#34; height=&#34;304&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;Interestingly, the authors don&#39;t plot that graph in their paper. They  plot a similar graph of their own closed form analytic formula, that is  in reality used to compute the forward volatility. I suppose that  because they calibrate and price through their method, they don&#39;t really  care so much that the ATM prices don&#39;t match Hagan original formula.&lt;br /&gt;&lt;br /&gt;We can see something else on that graph: Hagan PDE boundary is not as nice as Andreasen Huge boundary for high strikes (they use a Hagan like approx at the boundaries, this is why it crosses the Hagan implied volatilities there). &lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-xttZ_oNvVCk/UaS0j2wO29I/AAAAAAAAGcI/6oaerlRt0Ps/s1600/snapshot16.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-xttZ_oNvVCk/UaS0j2wO29I/AAAAAAAAGcI/6oaerlRt0Ps/s640/snapshot16.png&#34; height=&#34;304&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;If we use a simple option gamma = 0 boundary in Andreasen Huge, this results in a very similar shape as the Hagan PDE. This is because the option price is effectively 0 at the boundary.&lt;br /&gt;Hagan chose a specifically taylored Crank-Nicolson scheme. I was wondering how it fared when I reduced the number of time-steps. &lt;br /&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-691gk88PTt8/UaS2smPqGnI/AAAAAAAAGcY/_VYXXFTjVVM/s1600/snapshot17.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://1.bp.blogspot.com/-691gk88PTt8/UaS2smPqGnI/AAAAAAAAGcY/_VYXXFTjVVM/s400/snapshot17.png&#34; height=&#34;190&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The answer is: not good. This is the typical Crank-Nicolson issue. It could be interesting to adapt the method to use Lawson-Morris-Goubet or TR-BDF2, or a simple Euler Richardson extrapolation. This would allow to use less time steps, as in practice, the accuracy is not so bad with 10 time steps only.&lt;br /&gt;&lt;br /&gt;What I like about the Hagan PDE approach is that the implied vols and the probability density converge well to the standard Hagan formula, when there is no negative density problem, for example for shorter maturities. This is better than Andreasen Huge, where there seems to be always 1 vol point difference. However their method is quite slow compared to the original simple analytic formula.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update March 2014&lt;/b&gt; - I have now a paper around this &#34;&lt;a href=&#34;http://ssrn.com/abstract=2402001&#34;&gt;Finite Difference Techniques for Arbitrage Free SABR&lt;/a&gt;&#34;</description>
			</item>
			<item>
				<title>A Fast Exponential Function in Java</title>
				<link>https://31416.org/post/a-fast-exponential-function-in-java/</link>
				<pubDate>Fri, 19 Apr 2013 16:48:00 +0000</pubDate>
				<guid>https://31416.org/post/a-fast-exponential-function-in-java/</guid>
				<description>In finance, because one often dicretize the log process instead of the direct process for Monte-Carlo simulation, the Math.exp function can be called a lot (millions of times for a simulation) and can be a bottleneck. I have noticed that the simpler Euler discretization was for local volatility Monte-Carlo around 30% faster, because it avoids the use of Math.exp.&lt;br /&gt;&lt;br /&gt;Can we improve the speed of exp over the JDK one? At first it would seem that the JDK would just call either the processor exp using an &lt;a href=&#34;http://bad-concurrency.blogspot.co.uk/2012/08/arithmetic-overflow-and-intrinsics.html&#34;&gt;intrinsic function call&lt;/a&gt; and that should be difficult to beat. However what if one is ok for a bit lower accuracy? Could a simple &lt;a href=&#34;http://www.siam.org/books/ot99/OT99SampleChapter.pdf&#34;&gt;Chebyshev polynomial expansion&lt;/a&gt; be faster?&lt;br /&gt;&lt;br /&gt;Out of curiosity, I tried a Chebyshev polynomial expansion with 10 coefficients stored in a final double array. I computed the coefficient using a precise quadrature (Newton-Cotes) and end up with 1E-9, 1E-10 absolute and relative accuracy on [-1,1].&lt;br /&gt;&lt;br /&gt;Here are the results of a simple sum of 10M random numbers:&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;0.75s for Math.exp sum=1.7182816693332244E7&lt;br /&gt;0.48s for ChebyshevExp sum=1.718281669341388E7&lt;br /&gt;0.40s for FastMath.exp sum=1.7182816693332244E7&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So while this simple implementation is actually faster than Math.exp (but only works within [-1,1]), FastMath from Apache commons maths, that relies on a table lookup algorithm is just faster (in addition to being more precise and not limited to [-1,1]).&lt;br /&gt;&lt;br /&gt;Of course if I use only 5 coefficients, the speed is better, but the relative error becomes around 1e-4 which is unlikely to be satisfying for a finance application.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;0.78s for Math.exp sum=1.7182816693332244E7&lt;br /&gt;0.27s for ChebyshevExp sum=1.718193001875838E7&lt;br /&gt;0.40s for FastMath.exp sum=1.7182816693332244E7&lt;/span&gt;</description>
			</item>
			<item>
				<title>Root finding in Lord Kahl Method to Compute Heston Call Price (Part II)</title>
				<link>https://31416.org/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-ii/</link>
				<pubDate>Thu, 11 Apr 2013 16:29:00 +0000</pubDate>
				<guid>https://31416.org/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-ii/</guid>
				<description>&lt;p&gt;In my &lt;a href=&#34;https://31416.org/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price/&#34;&gt;previous post&lt;/a&gt;, I explored the &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=921336&#34;&gt;Lord-Kahl method&lt;/a&gt; to compute the call option prices under the Heston model. One of the advantages of this method is to go beyond machine epsilon accuracy and be able to compute very far out of the money prices or very short maturities. The standard methods to compute the Heston price are based on a sum/difference where both sides are far from 0 and will therefore be limited to less than machine epsilon accuracy even if the integration is very precise.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Root finding in Lord Kahl Method to Compute Heston Call Price</title>
				<link>https://31416.org/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price/</link>
				<pubDate>Tue, 09 Apr 2013 19:49:00 +0000</pubDate>
				<guid>https://31416.org/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price/</guid>
				<description>&lt;p&gt;&lt;figure&gt;&lt;img src=&#34;https://31416.org/post/Screenshot%20from%202013-04-09%2019%2042%2009.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;I just tried to implement &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=921336&#34;&gt;Lord Kahl algorithm to compute the Heston call price&lt;/a&gt;. The big difficulty of their method is to find the optimal alpha.  That&amp;rsquo;s what make it work or break. The tricky part is that the function  of alpha we want to minimize has multiple discontinuities (it&amp;rsquo;s  periodic in some ways). This is why the authors rely on the computation  of an alpha_max: bracketing is very important, otherwise your optimizer  will jump the discontinuity without even noticing it, while you really  want to stay in the region before the first discontinuity.&lt;/p&gt;</description>
			</item>
			<item>
				<title>From Double Precision Normal Density to Double Precision Cumulative Normal Distribution</title>
				<link>https://31416.org/post/from-double-precision-normal-density-to-double-precision-cumulative-normal-distribution/</link>
				<pubDate>Tue, 02 Apr 2013 14:24:00 +0000</pubDate>
				<guid>https://31416.org/post/from-double-precision-normal-density-to-double-precision-cumulative-normal-distribution/</guid>
				<description>&lt;p&gt;Marsaglia in &lt;!-- raw HTML omitted --&gt;his paper on Normal Distribution&lt;!-- raw HTML omitted --&gt; made the same mistake I initially did while trying to verify &lt;!-- raw HTML omitted --&gt;the accuracy of the normal density&lt;!-- raw HTML omitted --&gt;.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;In his table of values comparing the true value computed by Maple for some values of x to the values computed by Sun or Ooura erfc, he actually does not really use the same input for the comparison. One example is the last number: 16.6. 16.6 does not have an exact representation in double precision, even though it is displayed as 16.6 because of the truncation at machine epsilon precision. Using Python mpmath, one can see that:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&amp;gt;&amp;gt;&amp;gt; mpf(-16.6)&lt;!-- raw HTML omitted --&gt;mpf(&amp;rsquo;-16.6000000000000014210854715202004&amp;rsquo;)&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;This is the more accurate representation if one goes beyond double precision (here 30 digits). And the value of the cumulative normal distribution is:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&amp;gt;&amp;gt;&amp;gt; ncdf(-16.6)&lt;!-- raw HTML omitted --&gt;mpf(&amp;lsquo;3.4845465199503256054808152068743e-62&amp;rsquo;)&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;It is different from:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&amp;gt;&amp;gt;&amp;gt; ncdf(mpf(&amp;quot;-16.6&amp;quot;))&lt;!-- raw HTML omitted --&gt;mpf(&amp;lsquo;3.48454651995040810217553910503186e-62&amp;rsquo;)&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;where in this case it is really evaluated around -16.6 (up to 30 digits precision). Marsaglia gives this second number as reference. But all the other algorithms will actually take as input the first input. It is more meaningful to compare results using the exact same input. Using human readable but computer truncated numbers is not the best.  The cumulative normal distribution will often be computed using some output of some calculation where one does not have an exact human readable input.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;The standard code for Ooura and Schonfelder (as well as Marsaglia) algorithms for the cumulative normal distribution don&amp;rsquo;t use Cody&amp;rsquo;s trick to evaluate the exp(-x&lt;em&gt;x). This function appears in all those implementations because it is part of the dominant term in the usual expansions. Out of curiosity, I replaced this part with Cody trick. For Ooura I also made minor changes to make it work directly on the CND instead of going through the error function erfc indirection. Here are the results without the Cody trick (except for Cody):&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;and with it:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;All 3 algorithms are now of similiar accuracy (note the difference of scale compared to the previous graph), with Schonfelder being a bit worse, especially for x &amp;gt;= -20. If one uses only easily representable numbers (for example -37, -36,75, -36,5, &amp;hellip;) in double precision then, of course, Cody trick importance won&amp;rsquo;t be visible and here is how the 3 algorithms would fare with or without Cody trick:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Schonfelder looks now worse than it actually is compared to Cody and Ooura.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;To conclude, if someone claims that a cumulative normal distribution is up to double precision accuracy and it does not use any tricks to compute exp(-x&lt;/em&gt;x), then beware, it probably is quite a bit less than double precision.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Scala is Mad (part 2)</title>
				<link>https://31416.org/post/scala-is-mad-part-2/</link>
				<pubDate>Wed, 13 Feb 2013 16:20:00 +0000</pubDate>
				<guid>https://31416.org/post/scala-is-mad-part-2/</guid>
				<description>&lt;p&gt;I still did not abandon Scala despite my &lt;!-- raw HTML omitted --&gt;previous post&lt;!-- raw HTML omitted --&gt;, mainly because I have already quite a bit of code, and am too lazy to port it. Furthermore the issues I detailed were not serious enough to motivate a switch. But these days I am more and more fed up with Scala, especially because of the Eclipse plugin. I tried the newer, the beta, and the older, the stable, the conclusion is the same. It&amp;rsquo;s welcome but:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;code completion is not great compared to Java. For example one does not seem to be able to see the constructor parameters, or the method parameters can not be automatically populated.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;the plugin makes Eclipse &lt;em&gt;very&lt;/em&gt; slow. Everything seems at least 3-5x slower. On the fly compilation is also much much slower than Java&amp;rsquo;s.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;It&amp;rsquo;s nice to type less, but if overall writing is slower because of the above issues, it does not help. Beside curiosity of a new language features, I don&amp;rsquo;t see any point in Scala today, even if some of the ideas are interesting. I am sure it will be forgotten/abandoned in a couple of years. Today, if I would try a new language, I would give Google Go a try: I don&amp;rsquo;t think another big language can make it/be useful on the JVM (beside a scripting kind of language, like JavaScript or Jython).&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Google Go focuses on the right problem: concurrency. It also is not constrained to JVM limitation (on the other side one can not use a Java library - but open source stuff is usually not too difficult to port from one language to another). It has one of the fastest compilers. It makes interesting practical choices: no inheritance.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Scala is Mad</title>
				<link>https://31416.org/post/scala-is-mad/</link>
				<pubDate>Wed, 12 Dec 2012 16:07:00 +0000</pubDate>
				<guid>https://31416.org/post/scala-is-mad/</guid>
				<description>&lt;p&gt;I spent quick a bit of time to figure out why something that is usually simple to do in Java did not work in Scala: Arrays and ArrayLists with generics.&lt;/p&gt;&#xA;&lt;p&gt;For some technical reason (type erasure at the JVM level), Array sometimes need a parameter with a ClassManifest !?! a generic type like [T :&amp;lt; Point : ClassManifest] need to be declared instead of simply [T :&amp;lt; Point].&lt;/p&gt;&#xA;&lt;p&gt;And then the quickSort method somehow does not work if invoked on a generic&amp;hellip; like quickSort(points) where points: Array[T]. I could not figure out yet how to do this one, I just casted to points.asInstanceOf[Array[Point]], quite ugly.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Scala Again</title>
				<link>https://31416.org/post/scala-again/</link>
				<pubDate>Mon, 06 Feb 2012 17:52:00 +0000</pubDate>
				<guid>https://31416.org/post/scala-again/</guid>
				<description>I am trying &lt;a href=&#34;http://www.scala-lang.org/&#34;&gt;Scala&lt;/a&gt; again. Last time, several years ago, I played around with it as a web tool, combining it with a Servlet Runner like Tomcat. This time, I play around with it for some quantitative finance experiments.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Why Scala?&lt;/b&gt; It still seem the most advanced alternative to Java on the JVM, and the mix of functional programming and OO programming is interesting. Furthermore it goes quite far as it ships with its own library. I was curious to see if I could express some things better with Scala.&lt;br /&gt;&lt;br /&gt;Here are my first impressions after a week:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I like the &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;object&lt;/span&gt; keyword. It avoids the messy singleton pattern, or the classes with many static methods. I think it makes things much cleaner to not use static at all but distinguish between &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;object&lt;/span&gt; &amp;amp; &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;class&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;I like the &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;Array[Double]&lt;/span&gt;, and especially &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;ArrayBuffer[Double]&lt;/span&gt;. Finally we don&#39;t have to worry between the &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;Double&lt;/span&gt; and &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;double&lt;/span&gt; performance issues.&lt;/li&gt;&lt;li&gt;I was a bit annoyed by &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;a(i)&lt;/span&gt; instead of &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;a[i]&lt;/span&gt; but it makes sense. I wonder if there is a performance implication for arrays, hopefully not.&lt;/li&gt;&lt;li&gt;I like the real properties, automatic getter/setter: less boilerplate code, less getThis(), setThat(toto).&lt;/li&gt;&lt;li&gt;Very natural interaction with Java libraries. &lt;/li&gt;&lt;li&gt;I found a good use of &lt;b&gt;case classes&lt;/b&gt; (to my surprise): typically an enum that can have some well defined parameters, and that you don&#39;t want to make a class (because it&#39;s not). My use case was to define boundaries of a spline.&lt;/li&gt;&lt;li&gt;I love the formatter in the scala (eclipse) IDE. Finally a formatter in eclipse that does not produce crap.&lt;/li&gt;&lt;/ul&gt;Now things I still need time to get used to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; member variable declared implicitly in the constructor. I first made the mistake (still?) to declare some variables twice.&lt;/li&gt;&lt;li&gt;I got hit by starting a line with a &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;+&lt;/span&gt; instead of ending with a &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;+&lt;/span&gt;. It is dangerous, but it certainly makes the code more consistent.&lt;/li&gt;&lt;li&gt;Performance impacts: I will need to take a look at the bytecode for some scala constructs to really understand the performance impact of some uses. For example I tend to use while loops instead of for comprehension after some scary post of the Twitter guys about for comprehension. But at first, it looks as fast as Java.&lt;/li&gt;&lt;li&gt;I wrote my code a bit fast. I am sure I could make use of more Scala features.&lt;/li&gt;&lt;li&gt;The scala IDE in eclipse 3.7.1 has known issues. I wish it was a bit more functional, but it&#39;s quite ok (search for references works, renaming works to some extent).&lt;/li&gt;&lt;li&gt;Scala unit tests: I used scala tests, but it seems a bit funny at first. Also I am not convinced by the syntax that avoid method names and prefer test(&#34;test name&#34;). It makes it more difficult to browse the source code.&lt;/li&gt;&lt;/ul&gt;Some things they should consider:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Integrate directly a Log API. I just use SLF4J without any scala wrapper, but it feels like it should be part of the standard API (even if that did not work out so well for Sun).&lt;/li&gt;&lt;li&gt;Double.Epsilon is not the machine epsilon: very strange. I found out somewhere else there was the machine epsilon, don&#39;t remember where because I ended up just making a small &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;object&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Unit tests should be part of the standard API.&lt;/li&gt;&lt;/ul&gt;Overall I found it quite exciting as there are definitely new ways to solve problems. It was a while since I had been excited with actual coding.</description>
			</item>
			<item>
				<title>exp(y*log(x)) Much Faster than Math.pow(x,y)</title>
				<link>https://31416.org/post/expylogx-much-faster-than-math.powxy/</link>
				<pubDate>Fri, 08 Apr 2011 23:03:00 +0000</pubDate>
				<guid>https://31416.org/post/expylogx-much-faster-than-math.powxy/</guid>
				<description>&lt;p&gt;Today I found out that replacing &lt;em&gt;Math.pow(x,y)&lt;/em&gt; by &lt;em&gt;Math.exp(y&lt;/em&gt;Math.log(x))* made me gain 50% performance in my program. Of course, both x and y are double in my case. I find this quite surprising, I expected better from Math.pow.&lt;/p&gt;</description>
			</item>
			<item>
				<title>SIMD and Mersenne-Twister</title>
				<link>https://31416.org/post/simd-and-mersenne-twister/</link>
				<pubDate>Sat, 05 Feb 2011 13:18:00 +0000</pubDate>
				<guid>https://31416.org/post/simd-and-mersenne-twister/</guid>
				<description>&lt;p&gt;Since 2007, there is a new kind of Mersenne-Twister (MT) that exploits SIMD architecture, the &lt;a href=&#34;http://www.math.sci.hiroshima-u.ac.jp/%7Em-mat/MT/SFMT/&#34;&gt;SFMT&lt;/a&gt;. The Mersenne-Twister has set quite a standard in random number generation for Monte-Carlo simulations, even though it has flaws.&lt;/p&gt;&#xA;&lt;p&gt;I was wondering if SFMT improved the performance over MT for a Java implementation. There is actually on the same page a decent Java port of the original algorithm. When I ran it, it ended up slower by more than 20% than the classical Mersenne-Twister (32-bit) on a 64-bit JDK 1.6.0.23 for Windows.&lt;/p&gt;</description>
			</item>
			<item>
				<title>The CUDA Performance Myth</title>
				<link>https://31416.org/post/the-cuda-performance-myth/</link>
				<pubDate>Mon, 03 Jan 2011 16:07:00 +0000</pubDate>
				<guid>https://31416.org/post/the-cuda-performance-myth/</guid>
				<description>&lt;p&gt;There is an &lt;a href=&#34;http://arxiv.org/PS_cache/arxiv/pdf/0901/0901.0638v4.pdf&#34;&gt;interesting&lt;/a&gt; article on how to generate efficiently the inverse of the normal cumulative distribution on the GPU. This is useful for Monte-Carlo simulations based on normally distributed variables.&lt;/p&gt;&#xA;&lt;p&gt;Another result of the paper is a method (breakless algorithm) to compute it apparently faster than the very good &lt;a href=&#34;http://www.mth.kcl.ac.uk/~shaww/web_page/papers/Wichura.pdf&#34;&gt;Wichura&amp;rsquo;s AS241&lt;/a&gt; algorithm on the CPU as well keeping a similar precision. The key is to avoid branches (if-then) at the cost of not avoiding log() calls. As the algorithm is very simple, I decided to give it a try in Java.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Another Look at Java Matrix Libraries</title>
				<link>https://31416.org/post/another-look-at-java-matrix-libraries/</link>
				<pubDate>Mon, 29 Nov 2010 12:45:00 +0000</pubDate>
				<guid>https://31416.org/post/another-look-at-java-matrix-libraries/</guid>
				<description>&lt;p&gt;A while ago, &lt;a href=&#34;https://31416.org/post/the-pain-of-java-matrix-libraries&#34;&gt;I was already looking&lt;/a&gt; for a good Java Matrix library, complaining that there does not seem any real good one where development is still active: the 2 best ones are in my opinion &lt;a href=&#34;http://math.nist.gov/javanumerics/jama/&#34;&gt;Jama&lt;/a&gt; and &lt;a href=&#34;http://dsd.lbl.gov/~hoschek/colt/&#34;&gt;Colt&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Recently I tried to &lt;a href=&#34;http://www.wilmott.com/detail.cfm?articleID=345&#34;&gt;price options via RBF&lt;/a&gt; (radial basis functions) based on &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1648878&#34;&gt;TR-BDF2&lt;/a&gt; time stepping.&#xA;This is a problem where one needs to do a few matrix multiplications and inverses (or better, LU solve) in a loop. The size of the matrix is typically 50x50 to 100x100, and one can loop between 10 and 1000 times.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java enum Is Evil</title>
				<link>https://31416.org/post/java-enum-is-evil/</link>
				<pubDate>Thu, 12 Aug 2010 17:32:00 +0000</pubDate>
				<guid>https://31416.org/post/java-enum-is-evil/</guid>
				<description>Before Java 1.5, I never really complained about the lack of &lt;b&gt;&lt;span class=&#34;Apple-style-span&#34; style=&#34;font-family: &#39;Courier New&#39;, Courier, monospace;&#34;&gt;&lt;span class=&#34;Apple-style-span&#34; style=&#34;color: purple;&#34;&gt;enum&lt;/span&gt;&lt;/span&gt;&lt;/b&gt; keyword. Sure the &lt;a href=&#34;http://java.sun.com/developer/Books/shiftintojava/page1.html&#34;&gt;old enum via class pattern&lt;/a&gt; was a bit verbose at first (N.B.: Java 1.5 enums can also be verbose once you start adding methods to them). But more importantly, you would often use the table lookup pattern in combination.&lt;br /&gt;&lt;br /&gt;The problem with Java 1.5 &lt;b&gt;&lt;span class=&#34;Apple-style-span&#34; style=&#34;font-family: &#39;Courier New&#39;, Courier, monospace;&#34;&gt;&lt;span class=&#34;Apple-style-span&#34; style=&#34;color: purple;&#34;&gt;enum&lt;/span&gt;&lt;/span&gt;&lt;/b&gt; is that it is not Object-Oriented. You &lt;u&gt;can&#39;t extend&lt;/u&gt; an &lt;b&gt;&lt;span class=&#34;Apple-style-span&#34; style=&#34;color: purple;&#34;&gt;&lt;span class=&#34;Apple-style-span&#34; style=&#34;font-family: &#39;Courier New&#39;, Courier, monospace;&#34;&gt;enum&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;, you can&#39;t add an element in an existing enum. Many will say &#34;but that&#39;s what enum is for, a static list of things&#34;. In my experience, &amp;nbsp;the list of things often changes with time, or needs to be extended at one point. Furthermore, most people (including me when I am very lazy) end up writing switch statements on enum values. Enum promotes bad programming practices.&lt;br /&gt;&lt;br /&gt;Think twice about using enum, this is often not what you want.</description>
			</item>
			<item>
				<title>A Very Interesting Feature of Scala</title>
				<link>https://31416.org/post/a-very-interesting-feature-of-scala/</link>
				<pubDate>Sat, 07 Aug 2010 12:35:00 +0000</pubDate>
				<guid>https://31416.org/post/a-very-interesting-feature-of-scala/</guid>
				<description>I tried Scala &lt;a href=&#34;http://chasethedevil.blogspot.com/2007/09/fast-web-development-with-scala.html&#34;&gt;a few years ago&lt;/a&gt;. There are several good ideas in it, but I found the language to be a bit too complicated to master. But I recently stubbled upon &lt;a href=&#34;http://lamp.epfl.ch/~dragos/files/scala-spec.pdf&#34;&gt;a paper on Scala generics&lt;/a&gt;&amp;nbsp;that might change my mind about using Scala.&lt;br /&gt;&lt;br /&gt;Scala Generics used to work in a similar way as Java Generics: via type erasure. One main reason is compatibility with Java, another is that C++ like templates make the code base blow up. Scala Generics offered some additional behavior (the variance/covariance notion).&amp;nbsp;C++ templates, however, have some very interesting aspects: one is that everything is done at compile time, the other is &amp;nbsp;performance. If the generics are involved in any kind of computation intensive task, all the Java type conversion will create a significant overhead.&lt;br /&gt;&lt;br /&gt;Now Scala has &lt;b&gt;&lt;a href=&#34;http://www.scala-lang.org/api/current/scala/specialized.html&#34;&gt;@specialized&lt;/a&gt;&lt;/b&gt;&amp;nbsp;(since Scala 2.8). Annotating a generic type with @specialized will generate code. One has the choice to accept the performance penalty or to get all the performance but accept the code blow up. I think this is very useful.&lt;br /&gt;&lt;br /&gt;If you read the paper you will see that the performance implications of this are not always small.&lt;br /&gt;&lt;br /&gt;UPDATE: I thank the readers for pointing that this work only with primitive types to avoid autoboxing. It is still valuable but less than I first thought.</description>
			</item>
			<item>
				<title>Diffusion Limited Aggregation Applet</title>
				<link>https://31416.org/post/diffusion-limited-aggregation-applet/</link>
				<pubDate>Wed, 09 Jun 2010 14:05:00 +0000</pubDate>
				<guid>https://31416.org/post/diffusion-limited-aggregation-applet/</guid>
				<description>Yes, I wrote an applet. I know it is very 1990s but, amazingly, it still does the job quite well. Ok, next time I should really use Flash to do this.&lt;br /&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/_9RyqGT46Fbk/TA-C4-xEq8I/AAAAAAAAFH8/OwEFEpO4eA8/s1600/dla.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://1.bp.blogspot.com/_9RyqGT46Fbk/TA-C4-xEq8I/AAAAAAAAFH8/OwEFEpO4eA8/s320/dla.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The Applet simulates &lt;a href=&#34;http://en.wikipedia.org/wiki/Diffusion-limited_aggregation&#34;&gt;Diffusion Limited Aggregation&lt;/a&gt; as described in Chaos And Fractals from Peitgen, Juergens, and Saupe. It represents ions randomly wandering around (in a Brownian motion) until they are caught by an attractive force in electrochemical deposition experiment. This kind of phenomenon occurs at all scales, for example it happens in the distribution of galaxies. You can play around with the applet at &lt;a href=&#34;http://31416.appspot.com/dla.vm&#34;&gt;http://31416.appspot.com/dla.vm&lt;/a&gt;</description>
			</item>
			<item>
				<title>Java &amp; 3D Surface</title>
				<link>https://31416.org/post/java--3d-surface/</link>
				<pubDate>Fri, 18 Dec 2009 16:07:00 +0000</pubDate>
				<guid>https://31416.org/post/java--3d-surface/</guid>
				<description>&lt;p&gt;I have been looking all around the web for a Java library that can draw a simple 3D surface. And I did not find any. Most charting library, including the well known JFreeChart, can only draw 2D charts.&lt;/p&gt;&#xA;&lt;p&gt;I am quite shocked that something that has been in Excel for 15 years is still not available in Java. And it&amp;rsquo;s not easy to make your own.&lt;/p&gt;</description>
			</item>
			<item>
				<title>double[][] Is Fine</title>
				<link>https://31416.org/post/double-is-fine/</link>
				<pubDate>Thu, 26 Nov 2009 14:51:00 +0000</pubDate>
				<guid>https://31416.org/post/double-is-fine/</guid>
				<description>In my previous post, I suggest that keeping a double[] performs better than keeping a double[][] if you do matrix multiplications and other operations.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is actually not true. I benchmarked 3 libraries, Colt (uses double[]), Apache Commons Math (uses double[][]) and Jama (uses double[][] cleverly). At first it looks like Jama has a similar performance as Colt (they avoid [][] slow access by a clever algorithm). But once hotspot hits, the difference is crazy and Jama becomes the fastest (Far ahead).&lt;/div&gt;&lt;br /&gt;&lt;table border=&#34;1&#34;&gt;&lt;tr&gt;&lt;td colspan=&#34;4&#34;  valign=&#34;bottom&#34;  align=&#34;center&#34;  style=&#34; font-size:10pt;&#34;&gt;&lt;b&gt;JDK 1.6.0 Linux 1000x1000 matrix multiplication on Intel Q6600&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;left&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;loop index&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;left&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;Colt&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;left&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;Commons Math&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;left&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;Jama&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;1&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;11.880748&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;24.455125&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;9.828977&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;2&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;11.874975&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;24.265102&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;9.848916&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;3&lt;/td&gt;&lt;br /&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.772616&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;14.374153&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;9.826572&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;4&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.759679&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;14.368105&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.655915&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;5&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.799622&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;15.238928&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.649129&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;6&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.780556&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;14.741863&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.668104&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;7&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.72831&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;15.509909&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.646811&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;8&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.79838&lt;/td&gt;&lt;br /&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;15.724348&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.646069&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.726143&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000;&#34;&gt;15.988762&lt;/td&gt;&lt;br /&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.646052&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-bottom:thin solid #000000; border-left:thin solid #000000;&#34;&gt;10&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-bottom:thin solid #000000; border-left:thin solid #000000;&#34;&gt;9.784505&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-bottom:thin solid #000000; border-left:thin solid #000000;&#34;&gt;15.121782&lt;/td&gt;&lt;td  valign=&#34;bottom&#34;  align=&#34;right&#34;  style=&#34; font-size:10pt; border-top:thin solid #000000; border-bottom:thin solid #000000; border-left:thin solid #000000; border-right:thin solid #000000;&#34;&gt;2.644572&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td  style=&#34;&#34;&gt;&lt;/td&gt;&lt;td colspan=&#34;10&#34;  valign=&#34;bottom&#34;  align=&#34;left&#34;  style=&#34; font-size:10pt;&#34;&gt;We don&#39;t include matrix construction time, and fetching the result. Only the multiplication is taken into account.&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;The difference is less pronounced on smaller matrices, but still there. Jama looks very good in this simple test case. In more real scenarios, the difference is not so obvious. For example Commons Math SVD is faster than Jama one.</description>
			</item>
			<item>
				<title>Java Calendar Is Broken On JVM Upgrade</title>
				<link>https://31416.org/post/java-calendar-is-broken-on-jvm-upgrade/</link>
				<pubDate>Wed, 19 Aug 2009 13:47:00 +0000</pubDate>
				<guid>https://31416.org/post/java-calendar-is-broken-on-jvm-upgrade/</guid>
				<description>We ran into an interesting issue with TimeZone and Dates. If you print the same date on different JVMs, it might show a different printed date.&lt;br /&gt;&lt;br /&gt;The reason behind this is the daylight saving time conventions. An old JVM won&#39;t necessarily have the same daylight saving time for a given TimeZone than a latest JVM, and therefore will interpret the date differently.&lt;br /&gt;&lt;br /&gt;Here is the output of a very simple program on 2 different JVMs. The number is the long number used to represent the date. I only use SimpleDateFormat with different TimeZone:&lt;br /&gt;&lt;br /&gt;JVM 1.5.0_12&lt;br /&gt;loading date=Sat Jul 18 06:59:36 CEST 2009, number=1247893176505&lt;br /&gt;using formatter in EST: &lt;span style=&#34;font-weight: bold;&#34;&gt;7/17/09 11:59 PM&lt;/span&gt;&lt;br /&gt;using formatter in Asia/Singapore: 7/18/09 12:59 PM&lt;br /&gt;&lt;br /&gt;JVM 1.5.0_20&lt;br /&gt;loading date=Sat Jul 18 06:59:36 CEST 2009, number=1247893176505&lt;br /&gt;using formatter in EST: &lt;span style=&#34;font-weight: bold;&#34;&gt;7/18/09 12:59 AM&lt;/span&gt;&lt;br /&gt;using formatter in Asia/Singapore: 7/18/09 12:59 PM&lt;br /&gt;&lt;br /&gt;The source code:&lt;pre&gt;&lt;br /&gt;public class DateBug {       &lt;br /&gt;   &lt;br /&gt;    private static String FILE_NAME = &#34;datebug.txt&#34;;&lt;br /&gt;   &lt;br /&gt;    public static void load() throws IOException {&lt;br /&gt;        FileReader fr = new FileReader(FILE_NAME);&lt;br /&gt;        BufferedReader br = new BufferedReader(fr);&lt;br /&gt;        String l = br.readLine();&lt;br /&gt;        br.close();&lt;br /&gt;        long time = new Long(l);&lt;br /&gt;        Date d = new Date(time);&lt;br /&gt;        System.out.println(&#34;loading date=&#34;+d+&#34;, number=&#34;+d.getTime());&lt;br /&gt;        SimpleDateFormat formatter = new SimpleDateFormat();&lt;br /&gt;        formatter.setTimeZone(TimeZone.getTimeZone(&#34;EST&#34;));&lt;br /&gt;        System.out.println(&#34;using formatter in EST: &#34;+formatter.format(d));&lt;br /&gt;        formatter.setTimeZone(TimeZone.getTimeZone(&#34;Asia/Singapore&#34;));&lt;br /&gt;        System.out.println(&#34;using formatter in Asia/Singapore: &#34;+formatter.format(d));&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;    public static void saveNew() throws IOException {&lt;br /&gt;        Calendar c = Calendar.getInstance(TimeZone.getTimeZone(&#34;EST&#34;));&lt;br /&gt;        c.set(2009, 06, 17, 23, 59);&lt;br /&gt;        Date d = c.getTime();&lt;br /&gt;        System.out.println(&#34;saving date=&#34;+d+&#34;, number=&#34;+d.getTime());&lt;br /&gt;        SimpleDateFormat formatter = new SimpleDateFormat();&lt;br /&gt;        formatter.setTimeZone(TimeZone.getTimeZone(&#34;EST&#34;));&lt;br /&gt;        System.out.println(&#34;using formatter in EST: &#34;+formatter.format(d));&lt;br /&gt;        formatter.setTimeZone(TimeZone.getTimeZone(&#34;Asia/Singapore&#34;));&lt;br /&gt;        System.out.println(&#34;using formatter in Asia/Singapore: &#34;+formatter.format(d));&lt;br /&gt;       &lt;br /&gt;        FileWriter fw = new FileWriter(FILE_NAME);&lt;br /&gt;        PrintWriter pw = new PrintWriter(fw);&lt;br /&gt;        pw.println(d.getTime());&lt;br /&gt;        pw.close();&lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;    public static void main(String[] args) throws IOException {&lt;br /&gt;        System.out.println(&#34;JVM &#34;+System.getProperty(&#34;java.version&#34;));&lt;br /&gt;        if (args.length == 1) {&lt;br /&gt;            if (args[0].equals(&#34;save&#34;)) {&lt;br /&gt;                saveNew();&lt;br /&gt;            }&lt;br /&gt;        } else {&lt;br /&gt;            load();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;What does this mean? This means that if you entered in a GUI in the first JVM a particular date &amp;amp; time using EST time zone. This will change when you read back in the second JVM.&lt;br /&gt;This suggests that if you want to keep the same dates, you are better off saving in UTC where daylight saving time is not used and trick DateFormat. But I have to say this looks quite ugly.</description>
			</item>
			<item>
				<title>Java int Overflow Behavior</title>
				<link>https://31416.org/post/java-int-overflow-behavior/</link>
				<pubDate>Mon, 15 Jun 2009 16:15:00 +0000</pubDate>
				<guid>https://31416.org/post/java-int-overflow-behavior/</guid>
				<description>&lt;p&gt;A coworker recently asked me if there was a guaranteed behavior in the case of int overflow. He gave the specific example on:&lt;/p&gt;&#xA;&lt;p&gt;can we rely that int x = Integer.MAX_VALUE + 1 is the same for every JVM on any platform?&lt;/p&gt;&#xA;&lt;p&gt;I thought the answer would be easy to find in the Java specifications document. But I was wrong. It is not clearly defined.&lt;/p&gt;&#xA;&lt;p&gt;I found a trick that suggests this behavior is indeed standard and will stay the same, it is related to type casting. Java guarantees that the cast of a long just truncates the long to int precision. Therefore if&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#902000&#34;&gt;long&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;l&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Integer.&lt;span style=&#34;color:#4070a0&#34;&gt;MAX_VALUE&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;l&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;l&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;1;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;x&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;)l;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Static Fields and Inheritance</title>
				<link>https://31416.org/post/static-fields-and-inheritance/</link>
				<pubDate>Mon, 15 Jun 2009 16:02:00 +0000</pubDate>
				<guid>https://31416.org/post/static-fields-and-inheritance/</guid>
				<description>Someone asked me recently to find out the real reason why the code from this thread fails. This is a fairly bad code, and not even a very good way to point out the problem. But the question is nonetheless interesting.&lt;br /&gt;&lt;br /&gt;&lt;pre class=&#34;jive-pre&#34;&gt;&lt;code class=&#34;jive-code jive-java&#34;&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt; Toto &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;extends&lt;/b&gt;&lt;/span&gt; TotoParent&lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;final&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/span&gt; Toto a = &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/span&gt; Toto (&lt;span style=&#34;color:red;&#34;&gt;&#34;a&#34;&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/span&gt; Toto(String a)&lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;super&lt;/b&gt;&lt;/span&gt;(a);&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt; java.util.ArrayList;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt; java.util.List;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;abstract&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt; TotoParent &lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/span&gt; List&lt;string&gt; list = &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/span&gt; ArrayList&lt;string&gt;();&lt;br /&gt; &lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/span&gt; TotoParent(String a) &lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;  list.add(a);&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;protected&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/span&gt; List&lt;string&gt; get() &lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/span&gt; list;&lt;br /&gt;  &lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt; org.junit.Test;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;import&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/span&gt; org.junit.Assert.*;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt; TotoTest &lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; @Test&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color:navy;&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/span&gt; testGet()&lt;span style=&#34;color:navy;&#34;&gt;{&lt;/span&gt;&lt;br /&gt;  assertEquals(1, Toto.get().size());&lt;br /&gt; &lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color:navy;&#34;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;I am quite used to static initialization, and would have answered the same as the first answer in the thread:&lt;br /&gt;&#34;Get is static and associated with TotoParent, so that is the same as calling TotoParent.get().size()&#34;. I would have even thought that the compiler would compile the call Toto.get() to TotoParent.get(). But running javap, you can see it is still compiled as TotoParent.get(). So there is still a lookup done. This is why the first answer is actually not that correct.&lt;br /&gt;&lt;br /&gt;The important bit here is that Toto is never initialized, even if we call Toto.get(). The java specs (invaluable reference) explains clearly that calling a static method not declared in the class does not initialize the class.&lt;br /&gt;&lt;br /&gt;Calling Toto.get() is not exactly the same as calling TotoParent.get().&lt;br /&gt;If TotoParent.get() called another TotoSuperParent.get():&lt;br /&gt;Toto.get() -&gt; TotoParent.get() -&gt; TotoSuperParent.get()&lt;br /&gt;We compile then later we change to make TotoParent have a specific implementation of get(). Toto will then be automatically aware of it, without even recompiling it.&lt;br /&gt;&lt;br /&gt;&lt;a href=&#34;http://java.sun.com/docs/books/jls/third_edition/html/execution.html&#34; target=&#34;_blank&#34;&gt;http://java.sun.com/docs/&lt;wbr&gt;books/jls/third_edition/html/&lt;wbr&gt;execution.html&lt;/a&gt;&lt;br /&gt;paragraph 12.4.1</description>
			</item>
			<item>
				<title>Benchmarking Languages Is Difficult</title>
				<link>https://31416.org/post/benchmarking-languages-is-difficult/</link>
				<pubDate>Wed, 03 Jun 2009 16:53:00 +0000</pubDate>
				<guid>https://31416.org/post/benchmarking-languages-is-difficult/</guid>
				<description>I often looked at the famous computer languages shootout for fun. Recently I noticed they had the infamous &lt;a href=&#34;http://shootout.alioth.debian.org/u32q/benchmark.php?test=threadring&amp;amp;lang=all&#34;&gt;thread ring test&lt;/a&gt;. I posted not very long ago several &lt;a href=&#34;http://chasethedevil.blogspot.com/2009/01/end-of-rings-around-plain-java-better.html&#34;&gt;blog entries about it showing how silly&lt;/a&gt; this test was.&lt;br /&gt;&lt;br /&gt;Looking at the existing Java implementation for the test I decided to try to submit the tricky one using a pool of thread, and pooling message processing rather creating 1 thread per node. To my surprise, it was accepted without questions and I did have the best score for a Java program for a while. Shortly after &lt;a href=&#34;http://shootout.alioth.debian.org/u32q/benchmark.php?test=threadring&amp;amp;lang=java&amp;amp;id=3&#34;&gt;someone else&lt;/a&gt; copied my program and got rid of various stuff not useful for the particular benchmark (breaking the interesting part of the design) and got accepted as well with of course a better result.&lt;br /&gt;&lt;br /&gt;I decided to see if I could make an &lt;a href=&#34;http://shootout.alioth.debian.org/u32q/benchmark.php?test=threadring&amp;amp;lang=java&amp;amp;id=6&#34;&gt;even more silly program&lt;/a&gt; - tailored for the test only. I managed to be orders of magnitude faster - 1 thread, no synchronization, everything processed in a FIFO (linkedlist) queue. This is actually a standard way to reimplement recursion. But I was honest enough not to hide that I consider that kind of program to cheat the test and got my entry in the &#34;interesting alternatives&#34;.&lt;br /&gt;&lt;br /&gt;In reality there is no difference in the &#34;cheating&#34; between my new program and the program that got accepted in the official list, they both cheat by using only 1 thread and process everything 1 by 1. There is not 1 thread per node in any of the program, and they can avoid any concurrency issues. One &#34;looks&#34; better because it uses a pool of 503 threads (but really use only 1 or 2 threads) and the other does not hide its use of 1 thread for processing. But this is not evident to people accepting the programs.&lt;br /&gt;&lt;br /&gt;When I look at the haskell code, I can not really tell if it is creating 503 threads in the language or a pool or ..., you have to know each language quite well and sometimes it is not that easy to define what cheating is. Therefore this kind of benchmark is a bit disappointing. One should force the use of the same algorithm. But can you do so (a functional language won&#39;t use the same algo as a procedural one)?</description>
			</item>
			<item>
				<title>Cholesky &amp; Jakarta Commons Math</title>
				<link>https://31416.org/post/cholesky--jakarta-commons-math/</link>
				<pubDate>Fri, 15 May 2009 19:01:00 +0000</pubDate>
				<guid>https://31416.org/post/cholesky--jakarta-commons-math/</guid>
				<description>&lt;p&gt;In Finance, &lt;a href=&#34;http://en.wikipedia.org/wiki/Cholesky_decomposition&#34;&gt;Cholesky&lt;/a&gt; is a useful way to decompose Matrix. It is not so simple to find a BSD licensed code using cholesky (most of them are GPL like &lt;a href=&#34;http://www.google.com/codesearch/p?hl=en#W_wVDN7F3h4/tetrad-4.3.2-0/src/edu/cmu/tetrad/util/MatrixUtils.java&amp;amp;q=cholesky%20SEMEditor&amp;amp;l=1332&#34;&gt;this one&lt;/a&gt;). There is &lt;a href=&#34;http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/linear/decomposition/CholeskyDecompositionImpl.java?view=co&#34;&gt;one&lt;/a&gt; in &lt;a href=&#34;http://commons.apache.org/math/&#34;&gt;Apache Commons Maths&lt;/a&gt; library, which is a very interesting library. However for performance, it is still not very practical for some things like Cholesky.&lt;/p&gt;&#xA;&lt;p&gt;Looking at the source one can easily understand why. I did a small (many people will say not representative 1 million loop test) and finds out:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java Logging Still Crap in 2009</title>
				<link>https://31416.org/post/java-logging-still-crap-in-2009/</link>
				<pubDate>Fri, 24 Apr 2009 15:01:00 +0000</pubDate>
				<guid>https://31416.org/post/java-logging-still-crap-in-2009/</guid>
				<description>&lt;p&gt;When java logging API was first introduced in JDK 1.4 in 2002, it caused quite a lot a fuss around, with everybody asking &amp;ldquo;Why did not they just include Log4j instead of creating their own bastard child?&amp;rdquo;.&lt;/p&gt;&#xA;&lt;p&gt;I remember having looked at it very shortly before continuing using Log4j on all projects I have been involved with.&lt;/p&gt;&#xA;&lt;p&gt;Today, while doing a very small project, I tried once more to use &lt;a href=&#34;http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html&#34;&gt;java logging&lt;/a&gt;. The main reason is that I was lazy to add a dependency to one more jar for this small project. While trying I found out that:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Bachelier vs. Black</title>
				<link>https://31416.org/post/bachelier-vs.-black/</link>
				<pubDate>Mon, 23 Mar 2009 17:58:00 +0000</pubDate>
				<guid>https://31416.org/post/bachelier-vs.-black/</guid>
				<description>&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/ScfCRxmTocI/AAAAAAAACzk/5_lPpPc7LzU/s1600-h/bachelier_vs_black_normal.png&#34;&gt;&lt;img style=&#34;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 300px;&#34; src=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/ScfCRxmTocI/AAAAAAAACzk/5_lPpPc7LzU/s400/bachelier_vs_black_normal.png&#34; alt=&#34;&#34; id=&#34;BLOGGER_PHOTO_ID_5316431495761732034&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;&lt;br /&gt;Black and Scholes gives a strange result for the price of a binary option under high volatility.  You will learn here how to simulate a stock price evolution using Java, and how to show it using JFreeChart library. It starts with more complex concepts (don&#39;t be afraid) and goes done towards simpler things.&lt;br /&gt;&lt;br /&gt;I could not write all that in a blog format, so I created a old HTML page about it &lt;a href=&#34;http://31416.appspot.com/static/bachblack/Bachelier_vs_Black.html&#34;&gt;here&lt;/a&gt; and a &lt;a href=&#34;http://31416.appspot.com/static/bachblack/Bachelier_vs_Black.pdf&#34;&gt;PDF version&lt;/a&gt;.&lt;br /&gt;&lt;span style=&#34;text-decoration: underline;&#34;&gt;&lt;/span&gt;</description>
			</item>
			<item>
				<title>Senior Developers Team Productivity X4 (from MS Research Paper)</title>
				<link>https://31416.org/post/senior-developers-team-productivity-x4-from-ms-research-paper/</link>
				<pubDate>Tue, 10 Feb 2009 10:44:00 +0000</pubDate>
				<guid>https://31416.org/post/senior-developers-team-productivity-x4-from-ms-research-paper/</guid>
				<description>There is a very interesting &lt;a href=&#34;http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf&#34;&gt;MS Research paper about test driven development&lt;/a&gt; (TDD). It is one of the only real study about it that I know of. The paper conclusions from experiments over 4 TDD teams vs 4 traditional teams is:&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&#34;font-style: italic;&#34;&gt;&#34;TDD seems to be applicable in various domains and can significantly reduce the defect density of developed software without significant productivity reduction of the development team&#34;&lt;/span&gt;&lt;/blockquote&gt;Their data gives also other interesting results:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An experienced team (5 people over 10 years + 2 people under 5 years) : 155KLOC C# code (+60 test).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;A junior team (3 people under 10 years + 6 people under 5 years): 41 KLOC Java code (+28 test).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;If you do the ratio of KLOC/man month, you have the following graph:&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://2.bp.blogspot.com/_9RyqGT46Fbk/SZFVEkXM8JI/AAAAAAAACts/_pwwDhnKTt0/s1600-h/MSPaperKLOCMonth.png&#34;&gt;&lt;img style=&#34;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 252px;&#34; src=&#34;http://2.bp.blogspot.com/_9RyqGT46Fbk/SZFVEkXM8JI/AAAAAAAACts/_pwwDhnKTt0/s400/MSPaperKLOCMonth.png&#34; alt=&#34;&#34; id=&#34;BLOGGER_PHOTO_ID_5301111773360615570&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;&lt;br /&gt;I know this is very far from scientific evidence and more like astrology, but still, the most conservative ratio for senior/junior is &lt;span style=&#34;font-weight: bold;&#34;&gt;4.23&lt;/span&gt;!</description>
			</item>
			<item>
				<title>The End Of Rings Around Plain Java - A Better Concurrency Test</title>
				<link>https://31416.org/post/the-end-of-rings-around-plain-java---a-better-concurrency-test/</link>
				<pubDate>Thu, 15 Jan 2009 15:54:00 +0000</pubDate>
				<guid>https://31416.org/post/the-end-of-rings-around-plain-java---a-better-concurrency-test/</guid>
				<description>&lt;p&gt;In my &lt;a href=&#34;https://31416.org/post/running-rings-around-plain-java---the-killer-code&#34;&gt;previous post&lt;/a&gt;, I was wondering why single thread was faster. D Andreou gave the correct explanation: as we send only 1 start message and as each node only send 1 message to the next one, there is always only 1 message being processed. So the test is optimum on 1 thread. It does not make much sense to make a multithreading benchmark on a problem that is fundamentally single threaded.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Running Rings Around Plain Java - The Killer Code</title>
				<link>https://31416.org/post/running-rings-around-plain-java---the-killer-code/</link>
				<pubDate>Thu, 08 Jan 2009 13:21:00 +0000</pubDate>
				<guid>https://31416.org/post/running-rings-around-plain-java---the-killer-code/</guid>
				<description>&lt;p&gt;I wrote my &lt;a href=&#34;https://31416.org/post/running-rings-around-plain-java&#34;&gt;previous&lt;/a&gt; post too fast. I found a very simple change that increases the speed x6!&lt;/p&gt;&#xA;&lt;p&gt;The idea is too process messages in a ThreadPoolExecutor. As my Nodes are Runnable, I just needed to initialize a common ThreadPoolExecutor, and in a sendMessage, execute the runnable each time.&lt;/p&gt;&#xA;&lt;p&gt;Here is the full code:&#xA; &#xA;&#xA;&lt;font face=&#34;monospace&#34;&gt;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;OptimizedRing {&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;ExecutorService executor;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;main(String[]&amp;nbsp;args)&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;throws&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Exception {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;OptimizedRing ring = &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;OptimizedRing();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RingNode node = ring.startRing(Integer.parseInt(args[&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;]));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;node.sendMessage(&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StartMessage());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode startRing(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;n)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RingNode[]&amp;nbsp;nodes = spawnNodes(n, startTimer());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;connectNodes(n, nodes);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;nodes[&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Timer startTimer()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Timer timer = &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Timer();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Thread(timer).start();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;timer;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode[]&amp;nbsp;spawnNodes(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;n, &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;final&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Timer timer)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;constructing nodes&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;long&lt;/b&gt;&lt;/font&gt;&amp;nbsp;start = System.currentTimeMillis();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;executor = Executors.newFixedThreadPool(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;4&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RingNode[]&amp;nbsp;nodes = &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode[n+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;1&lt;/font&gt;&lt;/span&gt;];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;i = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;; i &amp;lt; n ; i++)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodes[i]&amp;nbsp;= &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode(i, timer, &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;null&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;long&lt;/b&gt;&lt;/font&gt;&amp;nbsp;end = System.currentTimeMillis();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;Took &amp;quot;&lt;/font&gt;&lt;/span&gt;+(end-start)+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;ms to construct &amp;quot;&lt;/font&gt;&lt;/span&gt;+n+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot; nodes&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;nodes;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;connectNodes(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;n, RingNode[]&amp;nbsp;nodes)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;connecting nodes&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodes[n]&amp;nbsp;= nodes[&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;i=&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;; i&amp;lt;n; i++)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodes[i].connect(nodes[i+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;1&lt;/font&gt;&lt;/span&gt;]);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;interface&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Message {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String getType();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StartMessage &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Message {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;String getType()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;START&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StopMessage &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Message {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;String getType()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;STOP&amp;quot;&lt;/font&gt;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;CancelMessage &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Message {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;String getType()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;CANCEL&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;TokenMessage &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Message {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;nodeId;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;value;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;TokenMessage(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;nodeId, &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;value)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt;.nodeId = nodeId;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt;.value = value;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;String getType()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;TOKEN&amp;quot;&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Runnable {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;nodeId;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Timer timer;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode nextNode;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;BlockingQueue&amp;lt;Message&amp;gt; queue = &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;LinkedBlockingQueue&amp;lt;Message&amp;gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt;&amp;nbsp;isActive = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;false&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;RingNode(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;id, Timer timer, RingNode nextNode)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nodeId = id;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt;.timer = timer;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt;.nextNode = nextNode;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;connect(RingNode node)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextNode = node;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isActive = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;true&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;sendMessage(Message m)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;queue.add(m);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;executor.execute(&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;this&lt;/b&gt;&lt;/font&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;run()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(isActive)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Message m = queue.take();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(m &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StartMessage)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;Starting messages&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer.sendMessage(m);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextNode.sendMessage(&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;TokenMessage(nodeId, &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(m &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StopMessage)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;Stopping&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextNode.sendMessage(m);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isActive = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;false&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#0000ff&#34;&gt;//&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(m &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt;&amp;nbsp;TokenMessage)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(((TokenMessage)m).nodeId == nodeId)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt;&amp;nbsp;nextValue = ((TokenMessage)m).value + &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;1&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(nextValue % &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;10000&lt;/font&gt;&lt;/span&gt;&amp;nbsp;== &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;0&lt;/font&gt;&lt;/span&gt;)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;log(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;Around ring &amp;quot;&lt;/font&gt;&lt;/span&gt;+nextValue+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot; times&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(nextValue == &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;1000000&lt;/font&gt;&lt;/span&gt;)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer.sendMessage(&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StopMessage());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timer.sendMessage(&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;CancelMessage());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextNode.sendMessage(&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StopMessage());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isActive = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;false&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextNode.sendMessage(&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;TokenMessage(nodeId, nextValue));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nextNode.sendMessage(m);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(InterruptedException ie)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ie.printStackTrace();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;log(String s)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(System.currentTimeMillis()+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot; &amp;quot;&lt;/font&gt;&lt;/span&gt;+nodeId+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;: &amp;quot;&lt;/font&gt;&lt;/span&gt;+s);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;static&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Timer &lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;implements&lt;/b&gt;&lt;/font&gt;&amp;nbsp;Runnable {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;BlockingQueue&amp;lt;Message&amp;gt; queue = &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt;&amp;nbsp;LinkedBlockingQueue&amp;lt;Message&amp;gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt;&amp;nbsp;timing = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;false&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;private&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;long&lt;/b&gt;&lt;/font&gt;&amp;nbsp;startTime;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;sendMessage(Message m)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#0000ff&#34;&gt;//we don&#39;t need to change this implementation as timer is rarely called&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;queue.add(m);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt;&amp;nbsp;run()&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;while&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;true&lt;/font&gt;&lt;/span&gt;)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Message m;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt;&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;m = queue.take();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(m &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StartMessage)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;startTime = System.currentTimeMillis();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timing = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;true&lt;/font&gt;&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(m &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt;&amp;nbsp;StopMessage)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#2e8b57&#34;&gt;&lt;b&gt;long&lt;/b&gt;&lt;/font&gt;&amp;nbsp;end = System.currentTimeMillis();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot;Start=&amp;quot;&lt;/font&gt;&lt;/span&gt;+startTime+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot; Stop=&amp;quot;&lt;/font&gt;&lt;/span&gt;+end+&lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;&amp;quot; Elapsed=&amp;quot;&lt;/font&gt;&lt;/span&gt;+(end-startTime));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;timing = &lt;span style=&#34;background-color: #f2f2f2&#34;&gt;&lt;font color=&#34;#ff00ff&#34;&gt;false&lt;/font&gt;&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(m &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt;&amp;nbsp;CancelMessage)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;font color=&#34;#a52a2a&#34;&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt;&amp;nbsp;(InterruptedException e)&amp;nbsp;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.printStackTrace();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;}&lt;br&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;table class=&#34;&#34; id=&#34;swje&#34; bgcolor=&#34;#eeeeee&#34; border=&#34;2&#34; bordercolor=&#34;#ffffff&#34; cellpadding=&#34;3&#34; cellspacing=&#34;2&#34; width=&#34;100%&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34; width=&#34;33%&#34;&gt;Code&lt;br&gt;&lt;/td&gt;&lt;br /&gt;&lt;td style=&#34;text-align: center;&#34; width=&#34;33%&#34;&gt;Spawn&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: center;&#34; width=&#34;33%&#34;&gt;Send 100M messages&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&#34;33%&#34;&gt;Scala Actors&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;15ms&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;270104ms&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&#34;33%&#34;&gt;SimpleRing&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;11ms&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;493073ms&lt;br&gt;&lt;/td&gt;&lt;br /&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&#34;33%&#34;&gt;OptimizedRing (4 threads)&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;6ms&lt;br&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;&lt;span&gt;84727ms&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&#34;33%&#34;&gt;OptimizedRing (5+ threads)&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;5ms&lt;br&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;&lt;span&gt;62593ms&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width=&#34;33%&#34;&gt;OptimizedRing (1 thread)&lt;br&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;5ms&lt;br&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&#34;text-align: right;&#34; width=&#34;33%&#34;&gt;&lt;span&gt;60660ms&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;I finally saw my 4 cores used! Max multithreaded throughput is achieved at 5 threads. However 1 thread is faster. Is this related to memory bandwith limit?&lt;br /&gt;&lt;br /&gt;Now I am left wondering if actors are really that important if one can achieve much higher throughput using plain Java and very simple concepts (BlockingQueue, ThreadPoolExecutor). Worse, this test is actually faster with only 1 thread...&#xA;&#xA;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Running rings around plain Java</title>
				<link>https://31416.org/post/running-rings-around-plain-java/</link>
				<pubDate>Thu, 08 Jan 2009 12:26:00 +0000</pubDate>
				<guid>https://31416.org/post/running-rings-around-plain-java/</guid>
				<description>&lt;p&gt;Alex Miller has a very &lt;a href=&#34;http://tech.puredanger.com/2009/01/05/scala-ring/&#34;&gt;interesting test of Actors&lt;/a&gt;. He finds out Scala performance is relatively low compared to Erlang, and Kilim is very near Erlang. But Kilim code is the most difficult to read in the lot.&lt;/p&gt;&#xA;&lt;p&gt;I thought it would be simple to just do the same test in plain Java. I wrote the code for it duplicating the scala logic using Threads instead of Actors.&lt;/p&gt;&#xA;&lt;p&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;SimpleRing&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;main&lt;/span&gt;(String&lt;span style=&#34;color:#666&#34;&gt;[]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;args)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;throws&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Exception&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;SimpleRing&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;ring&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;SimpleRing();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;RingNode&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;node&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;ring.&lt;span style=&#34;color:#4070a0&#34;&gt;startRing&lt;/span&gt;(Integer.&lt;span style=&#34;color:#4070a0&#34;&gt;parseInt&lt;/span&gt;(args&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;0&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;));&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;node.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StartMessage());&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;startRing&lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;n)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;RingNode&lt;span style=&#34;color:#666&#34;&gt;[]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;spawnNodes(n,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;startTimer());&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;connectNodes(n,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;0&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Timer&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;startTimer&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;Timer&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Timer();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Thread(timer).&lt;span style=&#34;color:#4070a0&#34;&gt;start&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode&lt;span style=&#34;color:#666&#34;&gt;[]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;spawnNodes&lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;n,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;final&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Timer&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;constructing nodes&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;long&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;start&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;currentTimeMillis&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;RingNode&lt;span style=&#34;color:#666&#34;&gt;[]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;n&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;1&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;for&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;i&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;0;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;i&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;n&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;++&lt;/span&gt;)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode(i,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;null&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Thread(nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;).&lt;span style=&#34;color:#4070a0&#34;&gt;start&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#60a0b0;font-style:italic&#34;&gt;//later use pool&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;long&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;end&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;currentTimeMillis&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;Took &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;(end&lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt;start)&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;ms to construct &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;n&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34; nodes&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;connectNodes&lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;n,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode&lt;span style=&#34;color:#666&#34;&gt;[]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;connecting nodes&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;n&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;0&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;for&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;0;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;&amp;lt;&lt;/span&gt;n;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;++&lt;/span&gt;)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;connect&lt;/span&gt;(nodes&lt;span style=&#34;color:#666&#34;&gt;[&lt;/span&gt;i&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;1&lt;span style=&#34;color:#666&#34;&gt;]&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;interface&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;Message&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;String&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;getType&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;StartMessage&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;implements&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;String&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;getType&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;START&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;StopMessage&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;implements&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;String&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;getType&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;STOP&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;            &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;CancelMessage&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;implements&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;String&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;getType&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;CANCEL&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;TokenMessage&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;implements&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodeId;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;value;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;TokenMessage&lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodeId,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;value)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;this&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;nodeId&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodeId;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;this&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;value&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;value;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;String&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;getType&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;return&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;TOKEN&amp;#34;&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;RingNode&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;implements&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Runnable&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodeId;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Timer&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nextNode;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;BlockingQueue&lt;span style=&#34;color:#666&#34;&gt;&amp;lt;&lt;/span&gt;Message&lt;span style=&#34;color:#666&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;queue&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;LinkedBlockingQueue&lt;span style=&#34;color:#666&#34;&gt;&amp;lt;&lt;/span&gt;Message&lt;span style=&#34;color:#666&#34;&gt;&amp;gt;&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;RingNode&lt;/span&gt;(&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;id,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Timer&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;RingNode&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nextNode)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;nodeId&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;id;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;this&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;timer&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timer;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;this&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;nextNode&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nextNode;&lt;span style=&#34;color:#bbb&#34;&gt;                        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;connect&lt;/span&gt;(RingNode&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;node)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;nextNode&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;node;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;sendMessage&lt;/span&gt;(Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;m)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;queue.&lt;span style=&#34;color:#4070a0&#34;&gt;add&lt;/span&gt;(m);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;run&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;while&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;true&lt;/span&gt;)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;try&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;queue.&lt;span style=&#34;color:#4070a0&#34;&gt;take&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;instanceof&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StartMessage)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;log(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;Starting messages&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;timer.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(m);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;nextNode.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;TokenMessage(nodeId,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;0));&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;instanceof&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StopMessage)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;log(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;Stopping&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;nextNode.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(m);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;break&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;instanceof&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;TokenMessage)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(((TokenMessage)m).&lt;span style=&#34;color:#4070a0&#34;&gt;nodeId&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;==&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nodeId)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;int&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nextValue&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;((TokenMessage)m).&lt;span style=&#34;color:#4070a0&#34;&gt;value&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;1;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(nextValue&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;%&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;10000&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;==&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;0)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                                &lt;/span&gt;log(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;Around ring &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;nextValue&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34; times&amp;#34;&lt;/span&gt;);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(nextValue&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;==&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;1000000)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                                &lt;/span&gt;timer.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StopMessage());&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                                &lt;/span&gt;timer.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;CancelMessage());&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                                &lt;/span&gt;nextNode.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StopMessage());&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                                &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;break&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                                &lt;/span&gt;nextNode.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;TokenMessage(nodeId,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;nextValue));&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                            &lt;/span&gt;nextNode.&lt;span style=&#34;color:#4070a0&#34;&gt;sendMessage&lt;/span&gt;(m);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;catch&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(InterruptedException&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;ie)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;ie.&lt;span style=&#34;color:#4070a0&#34;&gt;printStackTrace&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;log&lt;/span&gt;(String&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;s)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;println&lt;/span&gt;(System.&lt;span style=&#34;color:#4070a0&#34;&gt;currentTimeMillis&lt;/span&gt;()&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;nodeId&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;: &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;s);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;static&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;class&lt;/span&gt; &lt;span style=&#34;color:#0e84b5;font-weight:bold&#34;&gt;Timer&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;implements&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;Runnable&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;BlockingQueue&lt;span style=&#34;color:#666&#34;&gt;&amp;lt;&lt;/span&gt;Message&lt;span style=&#34;color:#666&#34;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;queue&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;new&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;LinkedBlockingQueue&lt;span style=&#34;color:#666&#34;&gt;&amp;lt;&lt;/span&gt;Message&lt;span style=&#34;color:#666&#34;&gt;&amp;gt;&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;boolean&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;timing&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;false&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;private&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;long&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;startTime;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;sendMessage&lt;/span&gt;(Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;m)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;queue.&lt;span style=&#34;color:#4070a0&#34;&gt;add&lt;/span&gt;(m);&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;public&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;void&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#06287e&#34;&gt;run&lt;/span&gt;()&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;while&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;true&lt;/span&gt;)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;Message&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;m;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;try&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;queue.&lt;span style=&#34;color:#4070a0&#34;&gt;take&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;instanceof&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StartMessage)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;startTime&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;currentTimeMillis&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;timing&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;true&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;instanceof&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;StopMessage)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;&lt;span style=&#34;color:#902000&#34;&gt;long&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;end&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;currentTimeMillis&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;System.&lt;span style=&#34;color:#4070a0&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color:#4070a0&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34;Start=&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;startTime&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34; Stop=&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;end&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;&lt;span style=&#34;color:#4070a0&#34;&gt;&amp;#34; Elapsed=&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;(end&lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt;startTime));&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;timing&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;false&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;                                        &#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;else&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;if&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(m&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;instanceof&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;CancelMessage)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                        &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;break&lt;/span&gt;;&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020;font-weight:bold&#34;&gt;catch&lt;/span&gt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;(InterruptedException&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;e)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;{&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                    &lt;/span&gt;e.&lt;span style=&#34;color:#4070a0&#34;&gt;printStackTrace&lt;/span&gt;();&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;                &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;            &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;        &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#bbb&#34;&gt;    &lt;/span&gt;}&lt;span style=&#34;color:#bbb&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;I was a bit surprised by the result. It was slow and only 1 thread was really active at one time. This is why the test is particularly good. It is not trivial to reproduce the functionality in plain Java in an effective manner. It really shows how the concept of Actors can be useful.&lt;/p&gt;</description>
			</item>
			<item>
				<title>More Double Troubles</title>
				<link>https://31416.org/post/more-double-troubles/</link>
				<pubDate>Tue, 06 Jan 2009 12:12:00 +0000</pubDate>
				<guid>https://31416.org/post/more-double-troubles/</guid>
				<description>We saw in a previous entry how one has to be careful with &lt;a href=&#34;http://chasethedevil.blogspot.com/2008/12/doublenan-is-evil.html&#34;&gt;Double.NaN&lt;/a&gt;. Today we will see how regular double can cause problems. By the way the NaN issue was not Java specific and this issue is also general in different programming languages.&lt;br /&gt;&lt;br /&gt;A coworker was shocked that in Java (I was a bit surprised he saw that only today, but it is true it can be surprising that such a simple thing does not work as expected):&lt;br /&gt;&lt;pre  wrap=&#34;&#34; style=&#34;font-family:courier new;&#34;&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;408.16 - 40.82 = &lt;span style=&#34;font-weight: bold;&#34;&gt;367.34000000000003&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;In C, this would lead to the same result. This is all due to the &lt;a href=&#34;http://en.wikipedia.org/wiki/Double_precision&#34;&gt;binary represention of double numbers&lt;/a&gt;. Using the formula 2^(exponent)*1.mantissa where mantissa is on 52 bits, we have&lt;br /&gt;&lt;br /&gt;408.16 decomposition:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;exponent = 256. Then 408.16/256 = 1.594375 = 1 + 0x9828F5C28F5C28F5C28F5C... * 2^-52&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We round to 52 bits, the mantissa is 0x9828F5C28F5C3 = 2676827028518339.&lt;/li&gt;&lt;li&gt;As a decimal, the internal value is (2676827028518339/2^52+1) * 256 = 408.1600000000000250111042987555265426635742&lt;/li&gt;&lt;/ul&gt;40.82 decomposition:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;exponent = 32. Then 40.82/32= 1.275625 = 1 + 0x468F5C28F5C28F5C...*2^-52&lt;/li&gt;&lt;li&gt;Rounded to 52 bits, the mantissa is 0x468F5C28F5C29 = 1241304647293993&lt;br /&gt;&lt;/li&gt;&lt;li&gt;As a decimal, the internal value is (1241304647293993/2^52 + 1)*32 = 40.8200000000000002842170943040400743484497&lt;/li&gt;&lt;/ul&gt;The difference in decimal becomes 367.34000000000002472... which becomes &lt;span style=&#34;font-weight: bold;&#34;&gt;367.34000000000003&lt;/span&gt; when represented in binary (to convince yourself you can apply the same technique).&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;font-family:arial;&#34; &gt;The Solution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One solution to this problem is to use &lt;a href=&#34;http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigDecimal.html&#34;&gt;java.math.BigDecimal&lt;/a&gt; which stores a number as 2 integers, one for the digits, one for the exponent power of 10 (and not 2).&lt;br /&gt;The correct code would become:&lt;br /&gt;&lt;span style=&#34;;font-family:courier new;font-size:85%;&#34;  &gt;&lt;br /&gt;BigDecimal value = BigDecimal.valueOf(408.16).subtract(BigDecimal.valueOf(40.82));&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;value would then be 367.34.&lt;br /&gt;&lt;br /&gt;But BigDecimal has also many potential for bugs. For example, you should &lt;span style=&#34;font-weight: bold;&#34;&gt;never use the constructor taking a double but always the one taking a String&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;new BigDecimal(408.16) = 408.16000000000002501110429875552654266357421875&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This is because of the binary representation of 408.16 as a double. 408.16 is only an approximation of 408.16!&lt;br /&gt;&lt;br /&gt;Another trick with BigDecimal is&lt;span style=&#34;font-weight: bold;&#34;&gt; not to use equals(Object) but compareTo(Object)&lt;/span&gt; because 408.160 is not equal to 408.16 using equals.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;font-family:arial;&#34; &gt;Why Could not They Make it Work With Double?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you were too lazy to follow the steps of the explanation. There is a simpler explanation. Imagine the representation of a number in base 3 with 2 &#34;digits&#34;. Let&#39;s imagine 1/3 is represented as 0.1 (this is a very simple number representation) 1/3+1/3+1/3 becomes 0.1+0.1+0.1 = 1.0 (in base 3) = 1.0 if we convert to base 10. Now in base 10, 1/3 can only be represented as 0.3, so 1/3+1/3+1/3 = 0.3+0.3+0.3 = 0.9 &lt;&gt; 1.0.&lt;br /&gt;So BigDecimal is only interesting to handle ... decimals! In the enterprise world, this should be most apps. It is a bit sad it appeared so late in the JDK. It should really be a primitive type.</description>
			</item>
			<item>
				<title>Java Programmers Are Idiots?</title>
				<link>https://31416.org/post/java-programmers-are-idiots/</link>
				<pubDate>Wed, 17 Dec 2008 20:16:00 +0000</pubDate>
				<guid>https://31416.org/post/java-programmers-are-idiots/</guid>
				<description>&lt;p&gt;My brother just sent me a funny quote. I don&amp;rsquo;t know if it is true or not:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;entwickeln Sie lieber überzeugende Lösungen anstatt viele Stunden mit Coding zu verbringen? Ist Ihnen die Produktivität Ihres Teams wichtig?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Mark Driver, &lt;strong&gt;VP Research von Gartner&lt;/strong&gt;, kommentierte kürzlich&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;Here’s a simple equation. In terms of mental fortitude&amp;hellip;&#xA;1 Smalltalk developer = 2.5 C++ developers&#xA;1 C++ developer = 1.5 Java developers&amp;rdquo;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You don&amp;rsquo;t need german to understand. Of course it can not be true. How can anyone measure mental fortitude? And how does it related with productivity is another issue.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Double.NaN Is Evil</title>
				<link>https://31416.org/post/double.nan-is-evil/</link>
				<pubDate>Tue, 09 Dec 2008 16:23:00 +0000</pubDate>
				<guid>https://31416.org/post/double.nan-is-evil/</guid>
				<description>I &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_0&#34;&gt;don&#39;t&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_1&#34;&gt;know&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_2&#34;&gt;what&lt;/span&gt; Sun &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_3&#34;&gt;had&lt;/span&gt; in &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_4&#34;&gt;mind&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_5&#34;&gt;when&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_6&#34;&gt;creating&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_7&#34;&gt;Double.NaN&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_8&#34;&gt;number&lt;/span&gt;. &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_9&#34;&gt;It&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_10&#34;&gt;is&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_11&#34;&gt;very&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_12&#34;&gt;inintuitive&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_13&#34;&gt;to&lt;/span&gt; use. I &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_14&#34;&gt;am&lt;/span&gt; sure &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_15&#34;&gt;every&lt;/span&gt; single &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_16&#34;&gt;developer&lt;/span&gt; out &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_17&#34;&gt;there&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_18&#34;&gt;fell&lt;/span&gt; in &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_19&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_20&#34;&gt;trap&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_21&#34;&gt;of&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_22&#34;&gt;trying&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_23&#34;&gt;to&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_24&#34;&gt;find&lt;/span&gt; out if a double &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_25&#34;&gt;was&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_26&#34;&gt;NaN&lt;/span&gt; or &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_27&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_28&#34;&gt;using&lt;/span&gt;:&lt;br /&gt;&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_29&#34;&gt;&lt;/span&gt;&lt;blockquote style=&#34;font-weight: bold; font-family: courier new;&#34;&gt;&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_29&#34;&gt;Double.NaN&lt;/span&gt; == &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_30&#34;&gt;myDouble&lt;/span&gt;&lt;/blockquote&gt;&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_30&#34;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_31&#34;&gt;This&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_32&#34;&gt;does&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_33&#34;&gt;not&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_34&#34;&gt;work&lt;/span&gt; (I &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_35&#34;&gt;don&#39;t&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_36&#34;&gt;know&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_37&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_38&#34;&gt;real&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_39&#34;&gt;reason&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_40&#34;&gt;why&lt;/span&gt;), &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_41&#34;&gt;one&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_42&#34;&gt;has&lt;/span&gt; &lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_43&#34;&gt;to&lt;/span&gt; use:&lt;br /&gt;&lt;blockquote style=&#34;font-weight: bold; font-family: courier new;&#34;&gt;&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_44&#34;&gt;Double.isNaN&lt;/span&gt;(&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_45&#34;&gt;myDouble&lt;/span&gt;)&lt;/blockquote&gt;&lt;br /&gt;&lt;span class=&#34;blsp-spelling-error&#34; id=&#34;SPELLING_ERROR_46&#34;&gt;Not&lt;/span&gt; intuitive!</description>
			</item>
			<item>
				<title>Grails Spring Union Not Surprising</title>
				<link>https://31416.org/post/grails-spring-union-not-surprising/</link>
				<pubDate>Thu, 27 Nov 2008 17:18:00 +0000</pubDate>
				<guid>https://31416.org/post/grails-spring-union-not-surprising/</guid>
				<description>&lt;p&gt;Looking out at some &lt;a href=&#34;https://31416.org/posts/the-2008-java-web-framework&#34;&gt;old post&lt;/a&gt;. I found out I was not far from the truth in January 2008 when I stated:&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&amp;ldquo;In 2008 the Ruby On Rails mentality will continue to prevail. In the Java world, Grails is the most likely to benefit from it. (&amp;hellip;) It could also be something based around Spring as their current MVC solution is not very good and very old fashioned.&amp;quot;&lt;!-- raw HTML omitted --&gt;I don&amp;rsquo;t think I will be right with the provocative &lt;a href=&#34;https://31416.org/posts/java-is-dead&#34;&gt;Java is dead&lt;/a&gt;. A post recently titled &lt;a href=&#34;http://weblogs.java.net/blog/javakiddy/archive/2008/11/no_future_in_ja.html&#34;&gt;No Future In Java&lt;/a&gt; makes some good points about where the future of Java still is: the web applications. Grails is probably today the best contender in the Java world, far ahead from the others, and it leverages the Java developers. However I am not sure one can say that RIA is a fad, or that RIA will only be done in a super powerful browser in the future. Microsoft might be a game changer here. The real advantages of the browser application so far are: easy deployment (the killer argument IMHO), &amp;ldquo;simple&amp;rdquo; security. I would not be surprised if in the near future, Microsoft advertises a solution for RIA easily deployed, based on standard protocols (HTTP?), a bit like IBM does with &lt;a href=&#34;http://www.ibm.com/developerworks/websphere/techjournal/0608_xu/0608_xu.html&#34;&gt;Eclipse RIA&lt;/a&gt;, but much more ambitious.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java Is Dead</title>
				<link>https://31416.org/post/java-is-dead/</link>
				<pubDate>Fri, 21 Nov 2008 20:24:00 +0000</pubDate>
				<guid>https://31416.org/post/java-is-dead/</guid>
				<description>&lt;p&gt;These days, I have the feeling that Java is dead. Even if, or maybe because I have used Java so much in the past 10 years, I have this feeling.&lt;/p&gt;&#xA;&lt;p&gt;In 1998 Java was revolutionary. It was a very simple to learn object oriented language with modern concepts and familiar syntax. Furthermore the standard library had neat features like internet networking and it could be integrated in the browser. All this at a time when the internet just started to be popular.&lt;/p&gt;</description>
			</item>
			<item>
				<title>OO Desillusion</title>
				<link>https://31416.org/post/oo-desillusion/</link>
				<pubDate>Thu, 28 Aug 2008 17:00:00 +0000</pubDate>
				<guid>https://31416.org/post/oo-desillusion/</guid>
				<description>&lt;p&gt;I have read many inspiring books about object oriented programming. I find &lt;a href=&#34;http://archive.eiffel.com/doc/oosc/&#34;&gt;B. Meyer Object Oriented Software Construction&lt;/a&gt; one of the best in the lot. B. Meyer tries to explain in a progressive way why OO is better, by introducing it bit by bit. I have read different related &lt;a href=&#34;http://en.wikipedia.org/wiki/Design_Patterns&#34;&gt;design patterns&lt;/a&gt; book, the GoF one, Martin Fowler ones. I have been programming Java for about 10 years now. And yet, today, I feel unconvinced.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java Compilation Performance / Processor Speed</title>
				<link>https://31416.org/post/java-compilation-performance--processor-speed/</link>
				<pubDate>Tue, 01 Jul 2008 19:50:00 +0000</pubDate>
				<guid>https://31416.org/post/java-compilation-performance--processor-speed/</guid>
				<description>&lt;p&gt;I just found out my laptop was faster in default settings than my home desktop to compile a resonably sized project (5 min vs 6 min). I was surprised as I thought the disk in the desktop would make a big difference. The processor in my desktop is not that great (simple pentium e2180). My laptop has a 2ghz core2duo processor. In Ghz processor are of the same speed.&lt;/p&gt;&#xA;&lt;p&gt;I tried to overclock my home pc to see what difference it could make, I made it run at 2.6Ghz instead of the standard 2Ghz. The compilation time dropped to 4.5 min.&lt;/p&gt;</description>
			</item>
			<item>
				<title>DecimalFormat Is Broken</title>
				<link>https://31416.org/post/decimalformat-is-broken/</link>
				<pubDate>Wed, 14 May 2008 18:19:00 +0000</pubDate>
				<guid>https://31416.org/post/decimalformat-is-broken/</guid>
				<description>A friend of mine recently noticed that the good old DecimalFormat class is &#34;broken&#34;. If you try to parse a string that is not a number but is starting with a number, the DecimalFormat.parse will return what it managed to parse.&lt;br /&gt;&lt;br /&gt;The correct behavior should be to throw a parse exception IMHO. Judging from an old post in the Sun bug tracker, The folks at Sun don&#39;t think it really is, they call the default mode of parsing the &#34;lenient&#34; mode. It accepts bad inputs. Then why throwing ParseException at all and why not return 0/NaN when the first character is not a number? Why accepting &lt;span style=&#34;font-family: courier new;&#34;&gt;1toto2&lt;/span&gt; as a number and not &lt;span style=&#34;font-family: courier new;&#34;&gt;toto2&lt;/span&gt;?&lt;br /&gt;&lt;br /&gt;In reality it can really create unexpected problems. For example, in France,&lt;span style=&#34;font-family: courier new;&#34;&gt; 0.1&lt;/span&gt; is &lt;span style=&#34;font-family: courier new;&#34;&gt;0,1&lt;/span&gt; because of the Locale conventions. If a user enters&lt;span style=&#34;font-family: courier new;&#34;&gt; 0.1&lt;/span&gt; in a French Locale, a method using DecimalFormat.parse will interpret it as &lt;span style=&#34;font-family: courier new;&#34;&gt;0&lt;/span&gt; without throwing any exception.&lt;br /&gt;&lt;br /&gt;Note that DateFormat does not have that problem, at one point Sun added setLenient flag to be able to be in non Lenient mode. It would be very simple to do it with DecimalFormat, I did it myself as an exercise. In DecimalFormat.subparse, the 2 last break statements should stop processing in lenient mode. Lines 1528 to 1531:&lt;br /&gt;&lt;span style=&#34;font-size:85%;&#34;&gt; &lt;span style=&#34;font-family: courier new;&#34;&gt;                        sawExponent = true;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    break; // Whether we fail or succeed, we exit this loop&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                else {&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    break;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt; become:&lt;br /&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                         sawExponent = true;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    } else {&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                        if (isLenient()) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                            parsePosition.index = oldStart;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                            parsePosition.index = oldStart;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                            return false;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                        }&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    break; // we succeed, we exit this loop&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    &lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                else {&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    if (isLenient()) {&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                        parsePosition.index = oldStart;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                        parsePosition.errorIndex = oldStart;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                        return false;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    }&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                    break;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;                }&lt;/span&gt;&lt;/span&gt;</description>
			</item>
			<item>
				<title>Using MiG Layout For Better Swing Development</title>
				<link>https://31416.org/post/using-mig-layout-for-better-swing-development/</link>
				<pubDate>Tue, 29 Apr 2008 18:27:00 +0000</pubDate>
				<guid>https://31416.org/post/using-mig-layout-for-better-swing-development/</guid>
				<description>&lt;p&gt;I have forgotten a few libraries in my &lt;a href=&#34;https://31416.org/post/better-java-swing-development&#34;&gt;Better Swing Development&lt;/a&gt; article, and notably &lt;a href=&#34;http://www.miglayout.com&#34;&gt;MiGLayout&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;GridBagLayout is too verbose, and still feels too clumsy. This is why a while back I wrote &lt;a href=&#34;http://easygridbag.sourceforge.net&#34;&gt;a small tool&lt;/a&gt; to help visualize various GridBagLayouts for people who are not used to it. But it would have been much simpler to use a better layout instead.&lt;/p&gt;&#xA;&lt;p&gt;MiGLayout is good, I managed to have good results without almost any practices on not so simple layouts. It also makes the code more concise.&lt;/p&gt;</description>
			</item>
			<item>
				<title>SwiXml Review</title>
				<link>https://31416.org/post/swixml-review/</link>
				<pubDate>Thu, 24 Apr 2008 12:19:00 +0000</pubDate>
				<guid>https://31416.org/post/swixml-review/</guid>
				<description>Externalizing the screen layout is a natural step for many applications. It can be because a customer might want a slightly different presentation, or just for the sake of clearly separating layout code, or for using a kind of screen generator. Back in 2003, I wrote &lt;a href=&#34;http://easygridbag.sourceforge.net&#34;&gt;a small utility to help with GridBagLayout&lt;/a&gt;, nothing fantastic,  but there was the feature of saving a generated layout in XML (or Beanshell) and using it in an application.&lt;br /&gt;&lt;br /&gt;&lt;a href=&#34;http://swixml.org&#34;&gt;SwiXml&lt;/a&gt; saves a bit more than a layout as it instantiates the components as well, allowing to represent a hierarchy of components in XML. But it does not more than that. The &#34;no generation&#34; approach is interesting, I bet the author thinks the XML should be kept concise enough to be used easily without using a kind of generator. the XML is almost a mirror of Java code, but fortunately makes layouts more compact and easier to read. I tried version 1.51, and while it is quite well done, its documentation is a bit lacking and to me an important functionality is missing:&lt;br /&gt;&lt;br /&gt;There is no &#34;component&#34; tag by default. One needs to explicitely name the class of component we want to add. I think there could be a component tag that instantiate an 0 parameter constructor by default, using reflection for example. The class of component to instantiate would be found through the field name.&lt;br /&gt;&lt;br /&gt;Fortunately SwiXml is quite well done and this is not that big of an issue since you can just interpret new tags with 1 line of code:&lt;br /&gt;&lt;span style=&#34;color: rgb(0, 0, 153);font-family:courier new;font-size:85%;&#34;  &gt;&lt;blockquote&gt;&lt;/blockquote&gt;engine.getTaglib().registerTag(&#34;datecombobox&#34;, DateComboBox.class);&lt;/span&gt;&lt;br /&gt;for a Jide DateComboBox.&lt;br /&gt;&lt;br /&gt;I said documentation was lacking, because in my first non Hello World trial, I wanted to use the standard constant names for GridBagConstraints (RELATIVE,REMAINDER, FIRST_LINE, LAST_LINE, ...). Putting &lt;span style=&#34;color: rgb(0, 0, 153);font-family:courier new;font-size:85%;&#34;  &gt;&amp;lt;gridbagconstraint anchor=&#34;FIRST_LINE&#34;&amp;gt;&lt;/span&gt;did not work. By reading the code, I found out you could achieve it but you have to do &lt;span style=&#34;color: rgb(0, 0, 153);font-family:courier new;font-size:85%;&#34;  &gt;&amp;lt;gridbagconstraint anchor=&#34;GridBagConstraint.FIRST_LINE&#34;&amp;gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In the end SwiXml left me with a good impression. It is non intrusive, and handle well enough what it is done for. One major drawback, you can only use either BorderLayout or GridBagLayout or FormLayout (from JGoodies).</description>
			</item>
			<item>
				<title>Better Java Swing Development</title>
				<link>https://31416.org/post/better-java-swing-development/</link>
				<pubDate>Thu, 17 Apr 2008 20:55:00 +0000</pubDate>
				<guid>https://31416.org/post/better-java-swing-development/</guid>
				<description>It has been a while since I have looked at the different options for building GUIs in Java. I like the approach taken by Eclipse, they provide not only GUI components, but a complete GUI application framework. Several years ago, I have stolen ideas from it (how they manage plugins) and applied it for Swing applications. This worked out quite well. The Netbeans platform now offers a more interesting alternative if you have to do Swing. The major drawback when compared to Eclipse, is that since the beginning Eclipse was all about making a platform, while Netbeans copied that idea only relatively recently and is less active about making it so. IBM uses Eclipse foundations for many of their products successfully.&lt;br&gt; &lt;br&gt;Unfortunately on many projects, a Swing application is already there and all you have to do is add more screens, more forms. What I am trying to see here, is what could help Swing development is those cases.&lt;br&gt;&lt;a href=&#34;http://www.jgoodies.com/&#34;&gt;&lt;br&gt; &lt;b&gt;JGoodies&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;JGoodies is old now, but can be quite useful in creating nice looking forms quickly. It is basically all around a layout better tailored to forms that the can do everything GridBagLayout.&lt;br&gt;It can help but it does not make a significant difference vs good practices with the GridBagLayout.&lt;br&gt; &lt;b&gt;&lt;a href=&#34;http://www.jidesoft.com&#34;&gt;&lt;br&gt;Jide Software&lt;/a&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;Jidesoft provides much more than JGoodies, but is not free (except the &lt;a href=&#34;https://jide-oss.dev.java.net/&#34;&gt;Jide Common Layer&lt;/a&gt;). I have used it in the past and found their API quite clean and easy to use. They offer more elaborated Swing components that should be part of the JDK. They started to go to the platform area only recently with their Jide Desktop Application Framework, which is not free either. I am not sure I would base an application around an unfree framework.&lt;br&gt; &lt;a href=&#34;http://swixat.org/&#34;&gt;&lt;br&gt;&lt;b&gt;SwiXAT&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;It is a recent BSD licensed project based on top of Swix. It is basically MVC for Swix, with command binding in XML. I need to look more into it, it seems to provide an &amp;quot;application framework&amp;quot; as well where you have to launch your app through a SwixAt class (which IMHO sucks). I hope it is not a requirement and that only parts of it can be used and integrated into an existing application. I will hopefully have time to try it more concretely and will blog about it. In any cases it looks interesting.&lt;br&gt; &lt;br&gt;&lt;b&gt;&lt;a href=&#34;http://www.swixml.org/&#34;&gt;SwiXml&lt;/a&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;An Apache licensed project, it seems like a decently used way of laying out swing components in XML, inspired by XUL. It might just be enough. Or is it just too similar to&amp;nbsp; Java code translated to XML? I need to investigate this more.&lt;br&gt; &lt;br&gt;&lt;b&gt;&lt;a href=&#34;http://www.sun.com/software/javafx/index.jsp&#34;&gt;JavaFX&lt;/a&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;JavaFX is probably the serious alternative to SwiXml. I like the idea of a better grammar to lay out and assemble components instead of using XML. Unfortunately it seems a bit invasive to start using for a part only of an application&lt;br&gt; &lt;br&gt;I took a quick look at Swing Application Framework (JDNC2 redone once again). While it has interesting use of annotations, it seems very far from what Eclipse offers. And I don&amp;#39;t feel like it will improve working with Swing a lot. I think except JavaFx, Sun seriously fucked around during many years with Swing. IBM has been much more focused and effective.&lt;br&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt;</description>
			</item>
			<item>
				<title>The 2008 Java Web Framework</title>
				<link>https://31416.org/post/the-2008-java-web-framework/</link>
				<pubDate>Tue, 22 Jan 2008 11:50:00 +0000</pubDate>
				<guid>https://31416.org/post/the-2008-java-web-framework/</guid>
				<description>One of my first web framework was a custom one, based on the book Web Development with&lt;a href=&#34;http://www.amazon.com/Development-JavaServer-Pages-Duane-Fields/dp/193011012X/ref=pd_bbs_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1200994688&amp;amp;sr=8-2&#34;&gt;  Java Server Pages&lt;/a&gt;. That was in 1999, when Struts was not yet known. But it was web-MVC, very near from what Struts gave later, without the custom tag stuff (custom tags were not yet part of JSP specifications).&lt;br&gt;&lt;br&gt; Until 2007, Struts was IMHO the most used web framework and the default choice, even though many contenders appeared, with more features, better code. 2007 saw the maturity of some of these framework. As similar framework to Struts, I particularly like Stripes, because the API is very lean. Some component frameworks got a lot of buzz as well, Tapestry some time ago, and today Wicket. I tried both, and while they are very interesting, and can be very productive for some tasks (web application more than web site), I am not convinced they are the tech of 2008. Web Applications are better done with Flex, or GWT. &lt;br&gt;&lt;br&gt;The major news in the past few years has been Ruby On Rails. Everybody tried to replicate it in every language (with their own twist):&amp;nbsp; Django in Python, Lift in Scala, ErlyWeb in Erlang, Cake in PHP, Grails (along with now abandonned Sails, and less populair Trails) in Java. And some people fought for making the point they had the idea before Rails. But Rails is what made Rails-like development popular. &lt;br&gt;After trying Rails soon after it was out (way before 1.0) and more recently (just before 2.0), I was amazed by the progress of Rails. I was impressed in 2004 about Rails, because the approach was new and effective. I disliked a bit the choice of Ruby. In the end in the project we ended up rewriting the persistence layer because our application was very specific. And I ported the app very quickly to Java. In 2007, I was even more impressed, and did not need to dwelve into arcanes of Rails anymore, but merely using it was enough to do lots and lots of things. &lt;br&gt;&lt;br&gt;In 2008 the Ruby On Rails mentality will continue to prevail. In the Java world, Grails is the most likely to benefit from it. But I would not be surprised if there was another new Rails-like contender in the game (Rails on JRuby?). It could also be something based around Spring as their current MVC solution is not very good and very old fashioned. &lt;br&gt;</description>
			</item>
			<item>
				<title>Apache DbUtils Completely Useless</title>
				<link>https://31416.org/post/apache-dbutils-completely-useless/</link>
				<pubDate>Fri, 02 Nov 2007 17:17:00 +0000</pubDate>
				<guid>https://31416.org/post/apache-dbutils-completely-useless/</guid>
				<description>&lt;p&gt;I am disappointed about the Jarkarta Commons DbUtils project. I give a link to it, because it&amp;rsquo;s a bad project (even if written in clean code). It is very simple, but it really does not do much for you.&lt;/p&gt;&#xA;&lt;p&gt;I was looking for a very simple abstraction of JDBC. I thought bringing Spring in my project would be overkill. After trying DbUtils, I think again. It does not help. It does not handle frequent cases well, and it does not save many lines of code.&lt;/p&gt;</description>
			</item>
			<item>
				<title>I fell in the trap of Boolean.getBoolean()</title>
				<link>https://31416.org/post/i-fell-in-the-trap-of-boolean.getboolean/</link>
				<pubDate>Fri, 12 Oct 2007 16:10:00 +0000</pubDate>
				<guid>https://31416.org/post/i-fell-in-the-trap-of-boolean.getboolean/</guid>
				<description>I was struggling to find a bug in a very simple application, it ended up being something as simple as using the damned Boolean.getBoolean(&amp;quot;true&amp;quot;) call instead of Boolean.valueOf(&amp;quot;true&amp;quot;).booleanValue() call. &lt;br&gt;&lt;br&gt;The Boolean.getBoolean method is something you almost never need to use, as it checks if a particular system property is true or false. There is a similar method for Integer.getInteger, and a quick &lt;a href=&#34;http://toadbalancing.blogspot.com/2005/10/java-api-pitfalls-booleangetbooleanstr.html&#34;&gt; google search shows&lt;/a&gt; I am not the only one to think those method should never have been part of the basic API for Boolean/Integer. It is too easy to confuse with parseBoolean/parseInt, especially as parseBoolean does not exist in JDKs prior to JDK  1.5 (parseInt is older).&lt;br&gt;&lt;br&gt;I can not imagine the improductivity this method has produced given its part of one of the most used class in the world.&lt;br&gt;</description>
			</item>
			<item>
				<title>Fast Web Development With Scala</title>
				<link>https://31416.org/post/fast-web-development-with-scala/</link>
				<pubDate>Tue, 25 Sep 2007 14:02:00 +0000</pubDate>
				<guid>https://31416.org/post/fast-web-development-with-scala/</guid>
				<description>I am currently experimenting with Scala. It seems quite convenient for web applications. Using Tomcat, it is possible to have a very productive developer environment.&lt;br /&gt;Here is a sample Embedded Tomcat you can start in a Scala project:&lt;br /&gt;&lt;div align=&#34;left&#34; class=&#34;java&#34;&gt;&lt;table border=&#34;0&#34; cellpadding=&#34;3&#34; cellspacing=&#34;0&#34; bgcolor=&#34;#ffffff&#34;&gt;   &lt;tr&gt;  &lt;!-- start source code --&gt;   &lt;td nowrap=&#34;nowrap&#34; valign=&#34;top&#34; align=&#34;left&#34;&gt;    &lt;code&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;java.io._;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;org.apache.catalina._;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;org.apache.catalina.startup._;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#000000&#34;&gt;object&amp;nbsp;TomcatScalaServer&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;CATALINAHOME&amp;nbsp;:&amp;nbsp;File&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;File&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;../newsbeef.com&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;WEBAPPS&amp;nbsp;:&amp;nbsp;File&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;File&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;CATALINAHOME,&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;webapps&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;ROOT&amp;nbsp;:&amp;nbsp;File&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;File&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;CATALINAHOME,&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;web&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;HOSTNAME&amp;nbsp;:&amp;nbsp;String&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;localhost&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;PORT&amp;nbsp;:&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;int&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;8080&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;def&amp;nbsp;await&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;while&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;true&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;try&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.println&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;sleeping&amp;nbsp;100s&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Thread.sleep&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;100000&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;catch&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;case&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ie&amp;nbsp;:&amp;nbsp;InterruptedException&amp;nbsp;=&amp;gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;def&amp;nbsp;start&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;server&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Embedded&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;server.setCatalinaHome&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;CATALINAHOME.getAbsolutePath&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;engine&amp;nbsp;=&amp;nbsp;server.createEngine&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;engine.setDefaultHost&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;HOSTNAME&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;host&amp;nbsp;=&amp;nbsp;server.createHost&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;HOSTNAME,&amp;nbsp;WEBAPPS.getAbsolutePath&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;engine.addChild&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;host&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;context&amp;nbsp;=&amp;nbsp;server.createContext&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;ROOT.getAbsolutePath&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;context.setParentClassLoader&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Thread.currentThread&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.getContextClassLoader&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;context.setReloadable&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;true&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;host.addChild&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;context&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;server.addEngine&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;engine&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;http&amp;nbsp;=&amp;nbsp;server.createConnector&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;HOSTNAME,&amp;nbsp;PORT,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;false&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;server.addConnector&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;http&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;server.start&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;def&amp;nbsp;main&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;args:&amp;nbsp;Array&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;[&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;])&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;start&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;await&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;/code&gt;       &lt;/td&gt;  &lt;!-- end source code --&gt;   &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;Here is a sample Scala Servlet outputing html directly. This is a simple example, but it shows something important. With Scala, the view layer can just be regular scala classes. There is no need for JSP or other templating languages as Scala already embbeds XML very nicely. By using the reloadable feature of Tomcat (there are also other pure Scala ways) and Eclipse autocompile, changes are instantanously taken in account.&lt;br /&gt;&lt;div align=&#34;left&#34; class=&#34;java&#34;&gt;&lt;table border=&#34;0&#34; cellpadding=&#34;3&#34; cellspacing=&#34;0&#34; bgcolor=&#34;#ffffff&#34;&gt;   &lt;tr&gt;  &lt;!-- start source code --&gt;   &lt;td nowrap=&#34;nowrap&#34; valign=&#34;top&#34; align=&#34;left&#34;&gt;    &lt;code&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;javax.servlet.http._;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;class&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ScalaServlet&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;extends&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;HttpServlet&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;override&amp;nbsp;def&amp;nbsp;init&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;override&amp;nbsp;def&amp;nbsp;doGet&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;request&amp;nbsp;:&amp;nbsp;HttpServletRequest&amp;nbsp;,&amp;nbsp;response&amp;nbsp;:&amp;nbsp;HttpServletResponse&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;service&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;request,&amp;nbsp;response&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;override&amp;nbsp;def&amp;nbsp;service&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;req:&amp;nbsp;HttpServletRequest,resp:&amp;nbsp;HttpServletResponse&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;{&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;val&amp;nbsp;pw&amp;nbsp;=&amp;nbsp;resp.getWriter&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;var&amp;nbsp;output&amp;nbsp;=&amp;nbsp;&amp;lt;html&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Scala&amp;nbsp;Servlet&amp;nbsp;Test&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;lt;body&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;lt;h1&amp;gt;Hello&amp;nbsp;World!&amp;lt;/h1&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;lt;/body&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;lt;/html&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;pw.println&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;output&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;pw.flush&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;/code&gt;       &lt;/td&gt;  &lt;!-- end source code --&gt;   &lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;Now I am eagerly waiting for improvements in the Eclipse Scala plugin (Organise imports, class navigation).</description>
			</item>
			<item>
				<title>Spring Web Services, Finally!</title>
				<link>https://31416.org/post/spring-web-services-finally/</link>
				<pubDate>Thu, 23 Aug 2007 11:22:00 +0000</pubDate>
				<guid>https://31416.org/post/spring-web-services-finally/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;http://static.springframework.org/spring-ws/site/&#34;&gt;Spring Web Services&lt;/a&gt; seems to be the technology I have been looking for recently. I am not a Spring bigot (too XML oriented), but here the Spring folks have something right.&lt;/p&gt;&#xA;&lt;p&gt;I used to work with Web Services the simple way: create a java class (or EJB), expose it as Web Service through Axis or RAD, generating the WSDL in the process. And then a client would just be the reverse, take the WSDL, use a tool (Axis or RAD) that creates client Java classes from it automatically. Simple, easy.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Original Pattern: ServletRequest in ThreadLocal</title>
				<link>https://31416.org/post/original-pattern-servletrequest-in-threadlocal/</link>
				<pubDate>Thu, 02 Aug 2007 12:07:00 +0000</pubDate>
				<guid>https://31416.org/post/original-pattern-servletrequest-in-threadlocal/</guid>
				<description>&lt;p&gt;After seeing &lt;a href=&#34;http://www.scala-lang.org/&#34;&gt;Scala&lt;/a&gt; had elements of Erlang through Actors, I decided to take a closer look at the language. There is an interesting new web framework in Scala, called &lt;a href=&#34;http://liftweb.net/&#34;&gt;Lift&lt;/a&gt;. One drawback of Lift is that it seems to be very cutting edge and not that easy to grasp. While reading its source code, I stumbled upon a strange pattern:&#xA;&lt;em&gt;Storing the ServletRequest in a ThreadLocal&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I had not seen that before, and was wondering why one would do such a thing. It seems to be unintuitive. I found my answer through&amp;hellip; GWT widgets. In &lt;a href=&#34;http://gwt-widget.sourceforge.net/?q=node/39&#34;&gt;this page&lt;/a&gt;, the author explain motivations behind doing such a thing:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Why Eclipse Is Better</title>
				<link>https://31416.org/post/why-eclipse-is-better/</link>
				<pubDate>Fri, 27 Jul 2007 14:37:00 +0000</pubDate>
				<guid>https://31416.org/post/why-eclipse-is-better/</guid>
				<description>&lt;p&gt;Initially I adopted Eclipse instead of Emacs because it was more powerful to search code, and it allowed refactoring. I regularly tried other IDEs but always end up back to Eclipse, even though there has been less big improvements in Eclipse in the past years (but lots of small ones).&lt;/p&gt;&#xA;&lt;p&gt;I just saw today that Eclipse allowed &lt;a href=&#34;http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html&#34;&gt;programmatic refactoring&lt;/a&gt;. Now that&amp;rsquo;s something quite amazing, and I don&amp;rsquo;t think other IDEs do that yet.  &lt;a href=&#34;http://langexplr.blogspot.com/2007/07/creating-java-refactorings-with-scala.html&#34;&gt;Someone&lt;/a&gt; even had fun writing an Eclipse extension in Scala to add a particular kind of refactoring to Eclipse.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Tapestry5 vs Wicket: 1 - 0</title>
				<link>https://31416.org/post/tapestry5-vs-wicket-1---0/</link>
				<pubDate>Wed, 11 Jul 2007 12:49:00 +0000</pubDate>
				<guid>https://31416.org/post/tapestry5-vs-wicket-1---0/</guid>
				<description>Getting started with &lt;a href=&#34;http://tapestry.apache.org/tapestry5/&#34;&gt;Tapestry 5&lt;/a&gt; is easier than with &lt;a href=&#34;http://incubator.apache.org/wicket/&#34;&gt;Wicket 1.3&lt;/a&gt;. Some readers will complain that it is again the view of someone who has no deep knowledge of either Tapestry or Wicket. But I think it is important for projects to be easily accessible to developers. Wicket seems to have more buzz around these days, and has a detailed wiki with plenty of useful information in it. But that&amp;#39;s the problem I see with Wicket, it is not simple to do simple things, that is why there is so much information to do simple things in the Wicket wiki. &lt;br&gt;&lt;br&gt;Granted my test was based on a specific case for component frameworks, I was not so much interested into statefulness, I wanted to display a bookmarkable &amp;quot;user page&amp;quot; with content coming from hibernate.This  kind of behaviour is quite general in web applications, especially in web  2.0.&lt;br&gt;&lt;br&gt;It was relatively easy to have the page working with Wicket, although I was disappointed at their hibernate integration. Hibernate integration in wicket means either using the full databinder project, or creating your own solution. I chose the later based on source code from databinder, but I actually rewrote everything in the end. I was disappointed that  &lt;a href=&#34;http://databinder.net/&#34;&gt;databinder&lt;/a&gt;, a specific Hibernate oriented framework did not really &lt;a href=&#34;http://www.hibernate.org/42.html&#34;&gt;handle Hibernate sessions the simplest way possible&lt;/a&gt;. Tapestry5 &lt;a href=&#34;http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-hibernate/src/main/java/org/apache/tapestry/hibernate/HibernateModule.java?revision=548175&amp;amp;view=markup&#34;&gt; got that right&lt;/a&gt;. To manage Hibernate sessions right, I had to dwelve into Wicket code as no documentation offers insight about inner workings of wicket. The code was too complex for my taste. In my short experience, I saw it seemed the developers are changing it to the better, removing some unnecessary abstractions. &lt;br&gt;&lt;br&gt;In the end I got frustrated many times with Wicket, and did not manage to have a bookmarkable page the way I wanted. You can have a bookmarkable page, but after some action on the page, it would become unbookmarkable. Furthermore, the structure of the URL is not very flexible without yourself rewriting completely the bookmarkable page feature of Wicket. &lt;br&gt;&lt;br&gt;With Tapestry5, I was at first worried about the small amount of documentation on the site, the use of maven in the tutorial. I was wrong, documentation proved to be exactly what I needed, and detailed enough. It is much easier to understand how Tapestry5 works after reading the doc than Wicket. Concepts in Tapestry5 are simpler and more powerful. Maven use is in the end not that big of a deal, I am still not as comfortable with it but I am productive enough that it is not an issue, much more productive than with Wicket. The standard tutorial setup is a very good one. &lt;br&gt;&lt;br&gt;Doing a bookmarkable page was trivial, it also was easy to have the format i wanted, and it was kept after action in the location bar. Hibernate integration was trivial, since Tapestry5 provides the tapestry-hibernate module, a few classes that helps managing the session and transactions for you. The only drawback is maybe the yet another inversion control system to learn. Tapestry5 IoC is very near from Guice in its philosophy. I wish Guice was made the default for IoC in Tapestry5. &lt;br&gt;&lt;br&gt;To conclude, there is no doubt about it, Tapestry5 is the winner.&lt;br&gt;</description>
			</item>
			<item>
				<title>NetBeans 6.0M10 out without announcement yet!</title>
				<link>https://31416.org/post/netbeans-6.0m10-out-without-announcement-yet/</link>
				<pubDate>Sat, 30 Jun 2007 07:15:00 +0000</pubDate>
				<guid>https://31416.org/post/netbeans-6.0m10-out-without-announcement-yet/</guid>
				<description>&lt;p&gt;I just found it while browsing netbeans website, here is the &lt;a href=&#34;http://dlc.sun.com.edgesuite.net/netbeans/download/6.0/milestones/m10/&#34;&gt;link&lt;/a&gt;. Netbeans is starting to be much more interesting that it used to be before  5.5, even though shortcuts are a pain, because so different from most other editors, and not always defined for important tasks. I like the all integrated feeling without plugin and slugishness by default.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Use ORM For Better Performance</title>
				<link>https://31416.org/post/use-orm-for-better-performance/</link>
				<pubDate>Tue, 12 Jun 2007 12:59:00 +0000</pubDate>
				<guid>https://31416.org/post/use-orm-for-better-performance/</guid>
				<description>This is not something I would have though a few years ago. It is something I learnt after working on many different projects, some using an ORM layer like Hibernate, Entity EJBs, or JDO, some using JDBC approach via Spring Templates or custom frameworks. Many projects that use ORM have performance problems, that don&amp;#39;t seem that common with projects using JDBC. But the size of the database model of ORM projects is often much bigger than the one of JDBC projects (which actually makes sense). If you have only a few queries to do, why bother with ORM? This would be complexity for nothing.  &lt;br&gt;&lt;br&gt;But for most enterprise projects, the size of the database model is quite big, and the model itself can be complex (many relations between many tables). With this kind of model, ORM is more efficient. It is faster to develop with, creates less bugs due to string misspelled, or types badly read. It is also better performing. Doing 1 giant query to retrieve everything in 1 step is not faster, especially if you don&amp;#39;t always need all the information retrieved. In a complex model, many cases are specifics, only useful in 10% of the cases. The temptation is high with a JDBC approach to do one giant query, because it is substantially longer (and more work) to do N queries.&amp;nbsp; With ORM, it is a bit the opposite, by default N queries is easier to do. The problem is that N(ORM) tends to be very high if one is not careful with the mapping to  &lt;a href=&#34;http://www.hibernate.org/118.html#A23&#34;&gt;avoid the N+1 problem&lt;/a&gt;. However it is simpler to reduce the number of queries by joining tables, rather than splitting queries, ORM performance optimization feels more natural. &lt;br&gt;&lt;br&gt;Martin Fowler tends to be also pro ORM in its &lt;a href=&#34;http://www.martinfowler.com/articles/dblogic.html&#34;&gt;&amp;quot;Domain Logic and SQL&amp;quot; article&lt;/a&gt;. He also mentions something interesting about SQL query optimization: &lt;br&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;&lt;p&gt;It&amp;#39;s also worth pointing out that this example is one that plays to a database&amp;#39;s strengths. Many queries don&amp;#39;t have the strong elements of selection and aggregation that this one does, and won&amp;#39;t show such a performance change. In addition multi-user scenarios often cause surprising changes to the way queries behave, so real profiling has to be done under a realistic multi-user load. You may find that locking issues outweigh anything you can get by faster individual queries.&lt;/p&gt;      &lt;a name=&#34;id2249937&#34;&gt;&lt;/a&gt;     &lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>People Using Spring, EJBs Don&#39;t Know Basic JDBC</title>
				<link>https://31416.org/post/people-using-spring-ejbs-dont-know-basic-jdbc/</link>
				<pubDate>Wed, 30 May 2007 12:03:00 +0000</pubDate>
				<guid>https://31416.org/post/people-using-spring-ejbs-dont-know-basic-jdbc/</guid>
				<description>&lt;p&gt;I recently found a bug in software we are developing. I traced it and found the root was improper JDBC handling. The application is written using EJBs, Spring and plenty of other relatively complex technologies. I was surprised that developers who were able to use all those technologies had no understanding of basic JDBC.&lt;/p&gt;&#xA;&lt;p&gt;They fetched all the data (including double, decimal numbers) from the database as String using rs.getString() !&lt;/p&gt;</description>
			</item>
			<item>
				<title>Wizards Bad For Productivity</title>
				<link>https://31416.org/post/wizards-bad-for-productivity/</link>
				<pubDate>Wed, 16 May 2007 14:56:00 +0000</pubDate>
				<guid>https://31416.org/post/wizards-bad-for-productivity/</guid>
				<description>&lt;p&gt;IBM RAD comes with many wizards, to create EJBs, to create Web Services, do struts mapping&amp;hellip; They are quite well done, making EJB &amp;lt; 3.0 usable, and Web Services look simple.&lt;/p&gt;&#xA;&lt;p&gt;But wizards sucks at:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;typos correction&lt;/li&gt;&#xA;&lt;li&gt;repetition&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;But when you do a typo in your wizards, then all the files generated/changed are wrong, and you don&amp;rsquo;t necessarily know if you can just do a search and replace. Plus you don&amp;rsquo;t necessarily know all the files that were affected by the typo.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Less Productive With Maven2.</title>
				<link>https://31416.org/post/less-productive-with-maven2./</link>
				<pubDate>Sun, 29 Apr 2007 17:10:00 +0000</pubDate>
				<guid>https://31416.org/post/less-productive-with-maven2./</guid>
				<description>&lt;p&gt;My &lt;a href=&#34;https://31416.org/post/maven-game-over-try-again&#34;&gt;first trials&lt;/a&gt; of Maven were failures. As I am stubborn, I tried again, on a new project, a quite simple one. It works, but it makes some easy things overkill. And the default way of using it makes a developer lose lots of time.&lt;/p&gt;&#xA;&lt;p&gt;If I have a project with common classes, a standalone app, and a web app, then logically you do 3 projects, 2 of them depending on the common one. That&amp;rsquo;s how the default maven setup works, and that&amp;rsquo;s what their documentation presents. Now when using maven eclipse, this will create 3 project, none depending on each other. If you modify something in the common code, it won&amp;rsquo;t be seen by any of the other code, you have to publish it with maven first, this takes way too much time. Furthermore I did not see any way to force rebuild the common automatically from one of the other project. If you modify code in common and web app project, you need to call maven twice. I find all this very counterproductive, because you do those steps extremely often. Now there are probably some ways to do that with Maven2, but it is not the default behavior. I could add project dependencies in eclipse manually, and forget about maven while working in eclipse, but then the maven eclipse plugin is really useless. And you&amp;rsquo;ll face the same issues when you want to use maven tomcat deploy.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java Concurrency In Practice Book Review</title>
				<link>https://31416.org/post/java-concurrency-in-practice-book-review/</link>
				<pubDate>Wed, 14 Feb 2007 16:33:00 +0000</pubDate>
				<guid>https://31416.org/post/java-concurrency-in-practice-book-review/</guid>
				<description>My reference book on Java concurrency is Doug Lea&amp;#39;s &lt;span style=&#34;font-style: italic;&#34;&gt;&lt;span class=&#34;srTitle&#34;&gt;Concurrent Programming in Java: Design Principles and Patterns&lt;/span&gt;&lt;/span&gt;. He is one of the authors of this new book,  &lt;span style=&#34;font-style: italic;&#34;&gt;Java Concurrency In Practice&lt;/span&gt;. There is also Joshua Bloch, author of &lt;span style=&#34;font-style: italic;&#34;&gt;Effective Java&lt;/span&gt;, that many people love (but I am less a fan of it, even if I would recommend it to Java newbies), and author of  &lt;span style=&#34;font-style: italic;&#34;&gt;Java Puzzlers&lt;/span&gt;, that I found more fun.&lt;br&gt;&lt;br&gt;With such authors, I had relatively high expectations. I was surprised that there is not much material in common between Doug Lea&amp;#39;s book and this one, which is a good thing. It&amp;#39;s a different presentation, that focuses on different problems.  &lt;br&gt;&lt;br&gt;There is some very interesting material, I especially enjoyed chapter 16 on the Java Memory Model. There are not many&amp;nbsp; books with information on it. I did not know that initializing a final member in the constructor was providing thread safety for the accessor method of the corresponding field if there is no other modifying method, no synchronization needed. And not having the member declared as final was breaking the safety. &lt;br&gt;&lt;br&gt;I also had not heard of &lt;a href=&#34;http://en.wikipedia.org/wiki/Amdahl%27s_Law&#34;&gt;Amdahl&amp;#39;s law&lt;/a&gt;  before. It seems quite intuitive, but then the example in the book about processing parallel tasks using a synchronized LinkedList (improvement up to 3 threads, no more later due to time spent on synchronization) shows that the reality is not that intuitive. &lt;br&gt;&lt;br&gt;I enjoyed how the book is written, and how information is presented. There is for example their concept of publication and escape (in chapter 3) which tells you important things, like not starting a Thread in a constructor (and if you still want to do it they present a nice way to do it). &lt;br&gt;&lt;br&gt;I think this book is a simpler read that Doug Lea original book, and probably a better introduction (that still goes very deep) to Java concurrency programming.</description>
			</item>
			<item>
				<title>Why are you not using Entity EJB 1.1?</title>
				<link>https://31416.org/post/why-are-you-not-using-entity-ejb-1.1/</link>
				<pubDate>Wed, 07 Feb 2007 16:38:00 +0000</pubDate>
				<guid>https://31416.org/post/why-are-you-not-using-entity-ejb-1.1/</guid>
				<description>&lt;p&gt;I am currently quite busy learning about Websphere Commerce. I was surprised to notice that they still use Entity EJBs 1.1. My experience was that many companies turned away from Entity EJBs, sometimes from the beginning, preferring TopLink or Hibernate (later).&lt;/p&gt;&#xA;&lt;p&gt;I know that Entity EJBs are more heavy to use than Hibernate, but with the proper tooling support, it&amp;rsquo;s not really a big issue. Are there more fundamental reasons? There are probably some mapping limitations, but IBM implementation is apparently quite good in term of features.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Social (Web) Revelation: Tags Are Lame</title>
				<link>https://31416.org/post/social-web-revelation-tags-are-lame/</link>
				<pubDate>Tue, 16 Jan 2007 10:26:00 +0000</pubDate>
				<guid>https://31416.org/post/social-web-revelation-tags-are-lame/</guid>
				<description>&lt;p&gt;I had a revelation yesterday while thinking about &lt;a href=&#34;http://del.icio.us&#34;&gt;del.icio.us&lt;/a&gt;, the most well known social bookmarks site. I find out that I almost never use my tags, and I am often not satisfied by results when I search using tags. What use can you make of 100s of tags? in the end only less than 10 are usable to classify very different stuff. And even then compared to a search it&amp;rsquo;s not a much useful classification.&lt;/p&gt;</description>
			</item>
			<item>
				<title>1 year of mac mini - the deception point</title>
				<link>https://31416.org/post/1-year-of-mac-mini---the-deception-point/</link>
				<pubDate>Mon, 08 Jan 2007 15:56:00 +0000</pubDate>
				<guid>https://31416.org/post/1-year-of-mac-mini---the-deception-point/</guid>
				<description>&lt;p&gt;I am less enthusiastic about the Apple experience than I was one year ago.&lt;/p&gt;&#xA;&lt;p&gt;I am quite enthusiastic with the hardware in general, except the keyboard. The computer is small and quiet, and there are not many competitors at this price on the market.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Experience as a developer&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I feel frustrated with MacOs X as a development environment, when compared with Ubuntu Linux. I always miss the multiple desktop, despite expose magnificient look. The standard behaviour for the terminal, bash, vim, etc. are more convenient in Linux. Installing software and updates is much more convenient on Linux thanks to the open source repositories.&#xA;The key bindings for special characters is awful for a programmer on the Apple keyboard, because non standard, and not even written on the keyboard. Installing linux on a mac mini intel is not trivial, but I am considering it seriously.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Tired Of Bad Singletons</title>
				<link>https://31416.org/post/tired-of-bad-singletons/</link>
				<pubDate>Thu, 04 Jan 2007 11:50:00 +0000</pubDate>
				<guid>https://31416.org/post/tired-of-bad-singletons/</guid>
				<description>While looking through some code for a project, I saw that:&lt;br&gt;&lt;br&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;&amp;nbsp; public static final ProductYP instance = new ProductYP(); &lt;br&gt;&amp;nbsp; &lt;br&gt;&amp;nbsp; public ProductYP()&lt;br&gt;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (instance != null)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new RuntimeException(&amp;quot;Only one instance allowed&amp;quot;);&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; prods = new HashMap();&lt;br&gt;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&amp;nbsp; public static ProductYP getInstance() &lt;br&gt;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return instance;&lt;br&gt;&amp;nbsp; }&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;And I don&amp;#39;t think it was done by a newbie... It&amp;#39;s actually not far from being correct, it&amp;#39;s just that the guy obviously does not know about private constructors. I have seen several broken singleton implementations in previous projects and had several debates on the  &lt;a href=&#34;http://www.cs.umd.edu/%7Epugh/java/memoryModel/DoubleCheckedLocking.html&#34;&gt;double-checked locking pattern&lt;/a&gt; (&lt;a href=&#34;http://en.wikipedia.org/wiki/Double-checked_locking&#34;&gt;it works since JDK1.5&lt;/a&gt; with volatiles but is useless). I am upset to see another half broken implementation. Everybody should have read at least  &lt;a href=&#34;http://java.sun.com/developer/technicalArticles/Programming/singletons/&#34;&gt;this&lt;/a&gt;.&lt;br&gt;&lt;br&gt;What have you seen as broken singletons?&lt;br&gt;&lt;br&gt;</description>
			</item>
			<item>
				<title>Declaring Your Logger - No Problem</title>
				<link>https://31416.org/post/declaring-your-logger---no-problem/</link>
				<pubDate>Fri, 29 Dec 2006 11:45:00 +0000</pubDate>
				<guid>https://31416.org/post/declaring-your-logger---no-problem/</guid>
				<description>&lt;p&gt;I used to like the &lt;a href=&#34;http://www.javaspecialists.co.za/archive/newsletter.do?issue=137&amp;amp;locale=en_US&#34;&gt;java specialists newsletter&lt;/a&gt;, most news used to be a bit challenging. Nowadays however the quality is lower. In the  &lt;a href=&#34;http://www.javaspecialists.co.za/archive/newsletter.do?issue=137&amp;amp;locale=en_US&#34;&gt;latest news&lt;/a&gt;, the author proposes to use the StackTrace to get the class name, in order to declare a Logger independently of any explicit reference to the class name.&lt;/p&gt;&#xA;&lt;p&gt;While this is a clever hack, it still requires some code to be duplicated in every class, compared to Aspect/IoC approach. But was there really a problem with declaring loggers the usual way in the first place?&lt;/p&gt;</description>
			</item>
			<item>
				<title>Very Quick Django Trial -&gt; Bye Bye Django</title>
				<link>https://31416.org/post/very-quick-django-trial---bye-bye-django/</link>
				<pubDate>Thu, 21 Dec 2006 17:48:00 +0000</pubDate>
				<guid>https://31416.org/post/very-quick-django-trial---bye-bye-django/</guid>
				<description>I tried a bit &lt;a href=&#34;http://djangoproject.com&#34;&gt;django&lt;/a&gt; for one very simple thing, where django is not of much use, but it was a way to try it with something else than examples on the site. &lt;br&gt;&lt;br&gt;Even if django templates features seem very good and very convenient when reading the docs (for example the extends keyword), I found out that the template system is very annoying. Firstly one has to learn another templating system. Secondly, and much more importantly, the debug facilities for templates are close to non existent. I have a better memory using ruby on rails templates (which are not the best either). &lt;br&gt;&lt;br&gt;Java templates, based on Velocity, JSPs or JSF are much nicer to debug. PHP (which I consider an ugly language that can unfortunately often gets the job done) used to be crap at debugging, but with eclipse plugin phpeclipse it is much better these days. &lt;br&gt;&lt;br&gt;I think templates play a very important role in web application development, and I am surprised that a framework with so many good ideas fails in reality (at least for me) because debugging templates is a pain. Hopefully it will become better one day, but until then bye bye Django. &lt;br&gt;</description>
			</item>
			<item>
				<title>A Proof That JavaScript Sucks.</title>
				<link>https://31416.org/post/a-proof-that-javascript-sucks./</link>
				<pubDate>Fri, 15 Dec 2006 16:51:00 +0000</pubDate>
				<guid>https://31416.org/post/a-proof-that-javascript-sucks./</guid>
				<description>&lt;p&gt;Google developed &lt;a href=&#34;http://code.google.com/webtoolkit&#34;&gt;GWT&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Why would GWT be so well acclaimed if JavaScript was a good language. When you talk about GWT to someone (a developer preferably), the first reaction is often&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;great I don&amp;rsquo;t need to do any JavaScript&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I recently discovered another similar open source project, &lt;a href=&#34;http://www.zkoss.org&#34;&gt;ZK&lt;/a&gt;. The&#xA;first thing you can read on the website is&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;ZK is an open source Ajax Web framework that enables rich user interface for web applications  &lt;em&gt;with no JavaScript&lt;/em&gt; and little programming.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>Building With Ant &#43; Maven Antlib?</title>
				<link>https://31416.org/post/building-with-ant--maven-antlib/</link>
				<pubDate>Thu, 14 Dec 2006 10:51:00 +0000</pubDate>
				<guid>https://31416.org/post/building-with-ant--maven-antlib/</guid>
				<description>&lt;p&gt;I discovered a new baby in the build world. Some open source projects use a combination of ant and maven. I thought you could vaguely use ant from maven. But I did not know of &lt;a href=&#34;http://maven.apache.org/ant-tasks.html&#34;&gt;Maven Antlib&lt;/a&gt; that allows you to use maven2 from Ant. Why would you use Maven2 from Ant?&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;because Maven2 requires to adapt your project to its standard hierarchy, or to have excellent Maven2 skills to create your own archetype for each existing project.&lt;/li&gt;&#xA;&lt;li&gt;because everybody knows Ant, but Ant does not manage dependencies well. Maven2 Antlib can be used just for that: managing dependencies.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
			</item>
			<item>
				<title>The Hibernate Network Proxy, A Dumb Idea.</title>
				<link>https://31416.org/post/the-hibernate-network-proxy-a-dumb-idea./</link>
				<pubDate>Mon, 04 Dec 2006 14:41:00 +0000</pubDate>
				<guid>https://31416.org/post/the-hibernate-network-proxy-a-dumb-idea./</guid>
				<description>&lt;p&gt;A friend of mine had a good idea for a Java project named &amp;ldquo;hibernate proxy&amp;rdquo;. I renamed it &amp;ldquo;hibernate network proxy&amp;rdquo; because hibernate proxies are already a well known concept among hibernate users (it allows lazy loading through a Java Proxy class).&lt;/p&gt;&#xA;&lt;p&gt;The hibernate network proxy, is a way to use hibernate remotely, that is to proxy hibernate calls through TCP (or even HTTP) to another machine, that will execute the session.saveOrUpdate or the session.load, etc. calls and return the corresponding objects, serialize them and deserialize them for use on the client.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Workaround When Eclipse Fucks Off With CVS</title>
				<link>https://31416.org/post/workaround-when-eclipse-fucks-off-with-cvs/</link>
				<pubDate>Tue, 28 Nov 2006 11:42:00 +0000</pubDate>
				<guid>https://31416.org/post/workaround-when-eclipse-fucks-off-with-cvs/</guid>
				<description>Until recently, I always found Eclipse CVS support to be excellent. The synchronize view was really a big plus to do clean commits, without forgetting any file.&lt;br&gt; &lt;br&gt; But I have encountered several problem with Eclipse 3.2+:&lt;br&gt; &lt;br&gt; &lt;blockquote&gt;On one project, it keeps putting the build directory into CVS, and I can&#39;t find how to change that setting. Each time I open the project I have to change the CVS/Entries file.&lt;br&gt;   &lt;br&gt; On another, where I have lots of files in, Eclipse delete some of the files (checked in CVS) regularly, although not often. It won&#39;t retrieve them back again from CVS. It seems to be the same files each time. I have no clue why.&lt;br&gt;   &lt;br&gt; The diff sometimes tells me the whole file has changed while there is absolutely no change.&lt;br&gt;   &lt;br&gt; I could not make the merge work. It kept on complaining about some parameters.&lt;br&gt;   &lt;br&gt; &lt;/blockquote&gt; And now the workaround for all those cases: &lt;br&gt; &lt;blockquote&gt;&lt;b&gt;The good old CVS command line.&lt;br&gt;   &lt;br&gt;   &lt;/b&gt;&lt;/blockquote&gt; I never remember how do to a merge with the command line, so I each time go to google and read&lt;a  href=&#34;http://www.csc.calpoly.edu/%7Ejdalbey/205/Resources/cvsBranchMerge.html&#34;&gt; this merge example page&lt;/a&gt;. Here are the very simple steps if you are in a branch and want to merge:&lt;br&gt; &lt;ol&gt;   &lt;li&gt;     &lt;pre&gt;cvs update -A mypoem.txt (use head as local repository)&lt;/pre&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;pre class=&#34;source&#34;&gt;cvs update -j release-1 (merge release-1 changes into local repository)&lt;/pre&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;pre class=&#34;source&#34;&gt;cvs update mypoem.txt&lt;/pre&gt;   &lt;/li&gt;   &lt;li&gt;     &lt;pre class=&#34;source&#34;&gt;cvs commit mypoem.txt&lt;/pre&gt;   &lt;/li&gt; &lt;/ol&gt; &lt;br&gt;</description>
			</item>
			<item>
				<title>Maven: Game Over, Try Again</title>
				<link>https://31416.org/post/maven-game-over-try-again/</link>
				<pubDate>Fri, 24 Nov 2006 17:51:00 +0000</pubDate>
				<guid>https://31416.org/post/maven-game-over-try-again/</guid>
				<description>&lt;p&gt;I am writing only as a newbie on Maven2. I tried to use it several times on small projects, but each time I found out that the time involved to make it work with an existing project was too much a pain in the a**. When confronted to very simple hierarchies that are not the standard of the documentation, I was a bit lost on how to arrange things, except changing the whole hierarchy to adapt to Maven.&lt;/p&gt;</description>
			</item>
			<item>
				<title>How JDepend Changed My Java Packaging</title>
				<link>https://31416.org/post/how-jdepend-changed-my-java-packaging/</link>
				<pubDate>Fri, 13 Oct 2006 09:27:00 +0000</pubDate>
				<guid>https://31416.org/post/how-jdepend-changed-my-java-packaging/</guid>
				<description>&lt;p&gt;One important feature of Java language is the package keyword. It helps a lot in modularizing your code. But how exactly one should use it is not that clear.&lt;/p&gt;&#xA;&lt;p&gt;I have been on projects where 100s of classes are in a same package and more often where you have packages for every 2 classes. Often, packages are chosen so as to split functionalities. But often as well, people are packages maniacs and create way too many of them, because they want to sort things out, not necessarily applying a consistent logic. For example, I am sure many of you have seen the &amp;ldquo;blahblah.exceptions&amp;rdquo; packages where you dump exceptions classes.&lt;/p&gt;</description>
			</item>
			<item>
				<title>You Know IOException? Think Again!</title>
				<link>https://31416.org/post/you-know-ioexception-think-again/</link>
				<pubDate>Thu, 14 Sep 2006 10:59:00 +0000</pubDate>
				<guid>https://31416.org/post/you-know-ioexception-think-again/</guid>
				<description>&lt;p&gt;I was amazed today to find out that there was no constructor &lt;code&gt;IOException(String, Throwable)&lt;/code&gt; or &lt;code&gt;IOException(Throwable)&lt;/code&gt; in JDK1.4 and JDK1.5. It is finally in JDK1.6, I can&amp;rsquo;t believe it took Sun that much time to change that.&lt;/p&gt;&#xA;&lt;p&gt;So the workaround is:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;`IOException ioe = new IOException(&amp;quot;message&amp;quot;);`&#xA;`ioe.initCause(e);`&#xA;`throw ioe;`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It can also be written as:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;`throw (IOException) new IOException(&amp;quot;message&amp;quot;).initCause(e);`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;It is not a major problem, but still. We can all thank the guy who &lt;a href=&#34;http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5070673&#34;&gt;reported that as a bug&lt;/a&gt; to Sun in 2004.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Good Software Books - 2006 version</title>
				<link>https://31416.org/post/good-software-books---2006-version/</link>
				<pubDate>Mon, 11 Sep 2006 14:27:00 +0000</pubDate>
				<guid>https://31416.org/post/good-software-books---2006-version/</guid>
				<description>Here is an update of the most interesting software books I found interesting. I already made &lt;a  href=&#34;http://chasethedevil.blogspot.com/2005/11/good-software-books.html&#34;&gt;such a list in 2005&lt;/a&gt;:&lt;br&gt; &lt;br&gt; &lt;ul&gt;   &lt;li&gt;&lt;i&gt;Object Oriented Software Construction, 2nd Ed&lt;/i&gt;, by Bertrand Meyer. This made me understand why OOP is important, what is important in OOP and why it is still relevant. It contains lots of important guidelines you can apply to better design programs. One famous quote is &#34;&lt;b&gt;Real systems have no top&lt;/b&gt;&#34;. &lt;i&gt;Code Complete&lt;/i&gt; (Microsoft Press) covers some of the same ideas as Meyer&#39;s book, and some more pragmatic issues that arise in software projects (&#34;&lt;b&gt;measure twice, cut once&lt;/b&gt;&#34;). I also liked the chapter on &#34;table driven design&#34;.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Concurrent Programming in Java, Second Edition&lt;/i&gt;, by Doug&amp;nbsp;Lea: there is all you need to know about programming in a multithreaded environment in it. The chapter on synchronization should be a must read for every Java developer.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Design Patterns&lt;/i&gt; by the GoF: simply the best presentation of most common design patterns. I have a glance on it once in a while.&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Artificial Intelligence through Prolog&lt;/i&gt;, by Neil C. Rowe (Prentice-Hall): if you don&#39;t remember much about Prolog, it&#39;s a good book. It details how Prolog interpreters work.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;File Systems Forensic Analysis, &lt;/i&gt;by Brian Carrier (Addison Wesley): everything you need to know about disks and file systems, every trick to recover lost data. To go more in depth into file systems theory, you can read the free &lt;i&gt;&lt;a  href=&#34;http://www.nobius.org/%7Edbg/&#34;&gt;Practical File System Design with the Be File System&lt;/a&gt; &lt;/i&gt;from D. Giampaolo, the creator of BeFS.&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Mind Hacks &lt;/i&gt;(O&#39;Reilly): you probably already bought that one. Not about software, but excellent.&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Practical Issues in Database Management&lt;/i&gt; by Fabian Pascal (Addison Wesley): short but concise book on relational database theory. F Pascal is of CJ Date school of thoughts, &#34;null are evil&#34;. You don&#39;t need to read it if you have read any other similar book (by CJ Date for example).&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Inside The Java Virtual Machine,&lt;/i&gt; by Bill Venners (McGraw-Hill): there are other books on the same subject. While this book has some bad reviews, I found it an easy read, and it explain well enough for me all the inner details of Java. I found &#34;Programming for the Java Virtual Machine&#34; not better, and with some bad example of a Prolog language for the JVM (1 full chapter for this to present a way too simple thing to be of any use).&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Programming Jabber&lt;/i&gt;, by O&#39;Reilly: I have read it 2 years ago, I enjoyed how they made you go through building a Jabber server.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Lucene In Action&lt;/i&gt;: the only book about Lucene, some of the info is useful to understand how it is designed.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Hibernate In Action:&lt;/i&gt; if you have to use hibernate, this is the book to read. It presents different ways of using it.&lt;/li&gt;   &lt;li&gt;some Javascript+DHTML(+CSS) book: useful if you have none. They often have good tricks to solve the usual problems. In the AJAX days, it becomes useful again. I find O&#39;Reilly&#39;s &#34;&lt;i&gt;Javascript - The Definitive Guide&lt;/i&gt;&#34; good to have an API reference (as ebook), and &#34;&lt;i&gt;Javascript and DHTML Cookbook&lt;/i&gt;&#34; has the most useful recipes.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Lean Software Development &lt;/i&gt;by Poppendieck (Addison Wesley): easy to read, good presentation of software dev management problems and pragmatic solutions. My favorite on the subject. Another good one but very specific is &#34;&lt;i&gt;Requirements Management&lt;/i&gt;&#34; (MS Press).&lt;/li&gt;   &lt;li&gt;&lt;i&gt;UML Distilled &lt;/i&gt;by M Fowler: always useful to have if you need to draw UML diagrams.&lt;/li&gt; &lt;/ul&gt;</description>
			</item>
			<item>
				<title>I Get Spring</title>
				<link>https://31416.org/post/i-get-spring/</link>
				<pubDate>Wed, 23 Aug 2006 18:04:00 +0000</pubDate>
				<guid>https://31416.org/post/i-get-spring/</guid>
				<description>&lt;p&gt;When you google up Java Spring, one of the best results is a post from crazybob called &amp;ldquo;&lt;a href=&#34;http://crazybob.org/2006/01/i-dont-get-spring.html&#34;&gt;I Don&amp;rsquo;t Get Spring&lt;/a&gt;&amp;rdquo;. For a long time, I shared a similar opinion. But now that I have used it, I get it. I only use it for defining replaceable services, so when I talk about Spring, I mean spring-core and spring-beans.&lt;/p&gt;&#xA;&lt;p&gt;These two packages are not big, and have only very few dependencies. So it is quite easy to use Spring in any project, be it small or not. It is actually easier than using NanoContainer because Spring has less external dependencies.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java Serialization vs .NET Serialization - Java Perverse?</title>
				<link>https://31416.org/post/java-serialization-vs-.net-serialization---java-perverse/</link>
				<pubDate>Tue, 22 Aug 2006 12:55:00 +0000</pubDate>
				<guid>https://31416.org/post/java-serialization-vs-.net-serialization---java-perverse/</guid>
				<description>Did you know what happens in Java when you serialize a subclass of a non serializable class? I was surprised by the answer: it works!&lt;br&gt; &lt;!--+GtkHTML:&lt;DATA class=&#34;ClueFlow&#34; key=&#34;orig&#34; value=&#34;0&#34;&gt;--&gt;&lt;br&gt; Unfortunately it is not a good thing, because it will serialize fields from your subclass and no fields from the parent class. So you&#39;ll end up with a half serialized instance.&lt;br&gt; &lt;br&gt; In .NET, it breaks at runtime, throwing an exception, which is I think, much more logical, because then you don&#39;t end up with half data somewhere.&lt;br&gt; &lt;br&gt; &lt;ul&gt;   &lt;li&gt;Java Code:&lt;/li&gt; &lt;/ul&gt; &lt;div class=&#34;java&#34; align=&#34;left&#34;&gt; &lt;div class=&#34;java&#34; align=&#34;left&#34;&gt; &lt;div class=&#34;java&#34; align=&#34;left&#34;&gt; &lt;table bgcolor=&#34;#ffffff&#34; border=&#34;0&#34; cellpadding=&#34;3&#34; cellspacing=&#34;0&#34;&gt;   &lt;tbody&gt;     &lt;tr&gt; &lt;!-- start source code --&gt; &lt;td align=&#34;left&#34; nowrap=&#34;nowrap&#34;  valign=&#34;top&#34;&gt; &lt;code&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;java.io.ByteArrayInputStream;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;java.io.ByteArrayOutputStream;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;java.io.ObjectInputStream;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;java.io.ObjectOutputStream;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;import &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;java.io.Serializable;&lt;/font&gt;&lt;br&gt;       &lt;br&gt;       &lt;br&gt;       &lt;br&gt;       &lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public class &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;Test&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public static class &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;Toto &lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;String me;    &lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public static class &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;Toto2 &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;extends &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;Toto &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;implements &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;Serializable&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;String you;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;String toString&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;      &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;return &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;me+&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&#34; &#34;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;+you;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public static &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#7f0055&#34;&gt;&lt;b&gt;void &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;main&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;[] &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;args&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;) &lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;throws &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;Exception&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Toto2 t = &lt;/font&gt;&lt;font  color=&#34;#7f0055&#34;&gt;&lt;b&gt;new &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Toto2&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;t.me = &lt;/font&gt;&lt;font  color=&#34;#2a00ff&#34;&gt;&#34;it&#39;s me&#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;t.you = &lt;/font&gt;&lt;font  color=&#34;#2a00ff&#34;&gt;&#34;it&#39;s you&#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.println&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&#34;t=&#34;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;+t&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ByteArrayOutputStream b = &lt;/font&gt;&lt;font  color=&#34;#7f0055&#34;&gt;&lt;b&gt;new &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ByteArrayOutputStream&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ObjectOutputStream oos = &lt;/font&gt;&lt;font  color=&#34;#7f0055&#34;&gt;&lt;b&gt;new &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ObjectOutputStream&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;b&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;oos.writeObject&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;t&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ObjectInputStream ois = &lt;/font&gt;&lt;font  color=&#34;#7f0055&#34;&gt;&lt;b&gt;new &lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ObjectInputStream&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new &lt;/b&gt;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;ByteArrayInputStream&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;b.toByteArray&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()))&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;    &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.println&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&#34;u=&#34;&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;+ois.readObject&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font  color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#ffffff&#34;&gt;  &lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br&gt;       &lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;/code&gt; &lt;/td&gt; &lt;!-- end source code --&gt; &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;br&gt; will output:&lt;br&gt; t=it&#39;s me it&#39;s you&lt;br&gt; u=null it&#39;s you&lt;br&gt; &lt;br&gt; &lt;ul&gt;   &lt;li&gt;.NET Code:&lt;/li&gt; &lt;/ul&gt; &lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System;&lt;/font&gt;&lt;br&gt; &lt;!--+GtkHTML:&lt;DATA class=&#34;ClueFlow&#34; clear=&#34;orig&#34;&gt;--&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System.Collections.Generic;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System.Text;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System.IO;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System.Xml;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System.Xml.Serialization;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; System.Runtime.Serialization.Formatters.Binary;&lt;br&gt; &lt;br&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;namespace&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; ConsoleApplication&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;{&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;    &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#0000ff&#34;&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font  size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; Toto&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; me&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;override&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; ToString() &lt;br&gt;        {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; me;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;       }&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    }&lt;/font&gt;&lt;br&gt;   &lt;font size=&#34;2&#34;&gt;&lt;/font&gt; &lt;br&gt; &lt;font size=&#34;2&#34;&gt;    [Serializable]&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; Toto2 : Toto&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;public&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; you&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; &lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;public override&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#0000ff&#34;&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; ToString() &lt;br&gt;        {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;return&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; you + &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#b03060&#34;&gt;&#34; &#34;&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; + me;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        }&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    }&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; &lt;/font&gt;&lt;br&gt; &lt;br&gt; &lt;font size=&#34;2&#34;&gt;    &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;class&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; Program&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;static&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;void&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; Main(&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;string&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt;[] args) &lt;br&gt;         {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            Toto2 t = &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#0000ff&#34;&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; Toto2();&lt;br&gt;             t.me = &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#b03060&#34;&gt;&#34;it&#39;s me&#34;&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;;&lt;br&gt;             t.you = &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#b03060&#34;&gt;&#34;it&#39;s you&#34;&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;;&lt;br&gt; &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;            &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; (FileStream fs = File.Create(&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#b03060&#34;&gt;@&#34;c:\test.bin&#34;&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt;)) &lt;br&gt;            {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;                BinaryFormatter bFormatter = &lt;/font&gt;&lt;font  size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; BinaryFormatter();&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;                bFormatter.Serialize(fs, t);&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            }&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            Console.WriteLine(&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#b03060&#34;&gt;&#34;t=&#34;&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; + t.ToString());&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            Toto2u = &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#0000ff&#34;&gt;null&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;;&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            &lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;using&lt;/font&gt;&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; (FileStream fs = File.Open(&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#b03060&#34;&gt;@&#34;c:\test.bin&#34;&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;, FileMode.Open)) &lt;br&gt;             {&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;                BinaryFormatter bFormatter = &lt;/font&gt;&lt;font  size=&#34;2&#34;&gt;&lt;font color=&#34;#0000ff&#34;&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt; BinaryFormatter();&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;                u = (Toto2)bFormatter.Deserialize(fs);&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            }&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            Console.WriteLine(&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;&lt;font  color=&#34;#b03060&#34;&gt;&#34;u=&#34;&lt;/font&gt;&lt;/font&gt;&lt;font size=&#34;2&#34;&gt;+u.ToString());&lt;/font&gt;&lt;font  size=&#34;2&#34;&gt; &lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;            Console.ReadKey();&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;        }&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;    }&lt;/font&gt;&lt;br&gt; &lt;font size=&#34;2&#34;&gt;}&lt;/font&gt;&lt;br&gt; &lt;!--+GtkHTML:&lt;DATA class=&#34;ClueFlow&#34; key=&#34;orig&#34; value=&#34;0&#34;&gt;--&gt;&lt;br&gt; will throw an exception.&lt;br&gt; &lt;br&gt;</description>
			</item>
			<item>
				<title>5 Minutes of Google Spreadsheets</title>
				<link>https://31416.org/post/5-minutes-of-google-spreadsheets/</link>
				<pubDate>Thu, 17 Aug 2006 12:10:00 +0000</pubDate>
				<guid>https://31416.org/post/5-minutes-of-google-spreadsheets/</guid>
				<description>&lt;p&gt;Today I noticed a Google Spreadsheets link in my gmail screen. I had read about it but never bothered to try before. In the finance industry, a lot of traders use excel, so I was wondering if Google spreadsheets could be another fit.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately for Google, under Linux at least, I don&amp;rsquo;t find Google Spreadsheets usable for anything else than storing and sharing some information, not often updated. Although I admire the engineers that managed to write the Javascript behind Google Spreasheet, it is way too slow for using it in interesting ways. Editing is slow, copy/paste is slow, sorting is slow.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Procedural Programming in an OO language</title>
				<link>https://31416.org/post/procedural-programming-in-an-oo-language/</link>
				<pubDate>Tue, 08 Aug 2006 12:35:00 +0000</pubDate>
				<guid>https://31416.org/post/procedural-programming-in-an-oo-language/</guid>
				<description>&lt;p&gt;OO is an old buzzword, that is not required anymore to get an employment. Recruiter seems to prefer SOA, Web Services, and in France, &amp;ldquo;mutualisation&amp;rdquo; and &amp;ldquo;urbanisation&amp;rdquo;. Sometimes I really wonder if OO made it.&lt;/p&gt;&#xA;&lt;p&gt;I am sure many of you are confronted with programmers that love procedural programming in many of your projects. They might use an OO language but in the end will organize everything by &amp;ldquo;type&amp;rdquo;, split invariably state and logic. Everything will be so much better stateless. And we will create lookup maps to glue everything back together. In a way I feel they remove the OO of the language.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Back To Real Java, Bye Bye J2EE</title>
				<link>https://31416.org/post/back-to-real-java-bye-bye-j2ee/</link>
				<pubDate>Wed, 26 Jul 2006 16:26:00 +0000</pubDate>
				<guid>https://31416.org/post/back-to-real-java-bye-bye-j2ee/</guid>
				<description>&lt;p&gt;I changed job recently. In this new job, it is refreshing to see Java used like in the old days, without the J2EE layers, and without the extra IBM layers of my previous job. Granted, the fresh Java approach does not apply to many projects, because a lot of apps are just about interfacing a database with a web interface. But Spring success showed that even for many of those projects, fresh Java approach with a small framework is enough.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Moving weekly Javablog stats to a new blog</title>
				<link>https://31416.org/post/moving-weekly-javablog-stats-to-a-new-blog/</link>
				<pubDate>Mon, 26 Jun 2006 17:25:00 +0000</pubDate>
				<guid>https://31416.org/post/moving-weekly-javablog-stats-to-a-new-blog/</guid>
				<description>&lt;p&gt;Javablogs.com top 10 weekly/monthly/yearly entries were starting to pollute my blog too much for my taste. It is more appropriate to dedicate a blog to them. That is what I should have done in the first place as it is very easy to have many blogs with blogger.com.&lt;/p&gt;&#xA;&lt;p&gt;So you&amp;rsquo;ll find at &lt;a href=&#34;http://javabuzz.blogspot.com&#34;&gt;javabuzz.blogspot.com&lt;/a&gt; the weekly top 10 most read entries on Javablogs, and sometimes more.&lt;/p&gt;</description>
			</item>
			<item>
				<title>JSF Was Too Hard for Experienced Developers</title>
				<link>https://31416.org/post/jsf-was-too-hard-for-experienced-developers/</link>
				<pubDate>Fri, 23 Jun 2006 14:59:00 +0000</pubDate>
				<guid>https://31416.org/post/jsf-was-too-hard-for-experienced-developers/</guid>
				<description>&lt;p&gt;While starting to look into &lt;a href=&#34;http://www.jboss.com/products/seam&#34;&gt;Seam&lt;/a&gt;, I noticed that all examples use JSF for the view, and there is no alternative to it. If someone like Gavin (from Hibernate fame) thinks JSF is usable, then I probably overlooked something when I looked into it a few years ago, when JSF was the craze of the moment.&lt;/p&gt;&#xA;&lt;p&gt;At the beginning, JSF looks very similar to ASP.NET. But I have a small experience with ASP.NET, and ASP.NET is quite simple to understand and use. You can throw up inexperienced developers at it, they will manage to create something that works quite quickly. ASP.NET feels quite natural once you understand the postback thingy. JSF is another beast. Maybe part of it is due to the fact that the Java world has no excellent tools integration like Microsoft has (IBM RAD, one of the most advanced concerning integration, is quite far off). But there are also many technological reasons; when I read &lt;a href=&#34;http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html&#34;&gt;that article about JSF shortcomings with JSP&lt;/a&gt;, I was shocked that even to do very simple things, you would screw up, because simple things can be very complicated in JSF.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Top 10 Most Read Last Week On Javablogs.com, Week 24</title>
				<link>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-24/</link>
				<pubDate>Mon, 19 Jun 2006 13:05:00 +0000</pubDate>
				<guid>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-24/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;en&#34; xml:lang=&#34;en&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274667&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Sexiest photo ever&lt;/a&gt;  (235): Heading off to Nerja (on the advice of Joe who will pay dearly if the ratio of fish &#39;n chip shops to tapas bars isn&#39;t on the right side of 95:05) for 2 weeks with 3 lovely girls and a... [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274667&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273954&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;You are not a ‘real’ Java developer until…&lt;/a&gt;  (217): You had to use JDK 1.3 on a real project. In 2006. You had to use JDK 1.3 on a real project because you had to use some ancient version of WebSphere. In 2006. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273954&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274210&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Beautiful JavaScript Windows and Dialogs for your Application&lt;/a&gt;  (200): French expert user-interface programmer Sebastien Gruhier releases latest version of his beautiful Prototype Windows code, based on Prototype and compatible with Scriptaculous effects. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274210&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274110&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring 2.0 Docs Rocks!&lt;/a&gt;  (185): Just perusing the Spring 2.0 docs after seeing some negative blog posts on it (Spring in general). Its been taking a beating on being too complex/heavy but hey it does the job. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274110&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273894&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Software Team Turnover: Why Developers Leave&lt;/a&gt;  (184): Found this very interesting &lt;a class=&#34;inentry&#34; href=&#34;http://www.developerdotstar.com/printable/mag/articles/software_team_turnover.html&#34;&gt;article&lt;/a&gt; about ways on how to learn more about your software development team and thing a company should know on how to retain them. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273894&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273991&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;This is Just Depressing&lt;/a&gt;  (175): This evening I was browsing some of the recent posts on the amsuing thedailywtf. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273991&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274747&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Does Spring encourage bad coding?&lt;/a&gt;  (161): Let&#39;s expand on Martin Fowler&#39;s naive example of the movie lister and movie finder. Without Spring this is how the code would look like // in MovieListerString genre = input.getGenre(); // action, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274747&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274286&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Doing away with getters and setters&lt;/a&gt;  (161): How many times have you written boiler plate get and set methods? Here is an interesting system that might do away with them altogether. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274286&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274848&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;How to be a Junior Developer Forever : part 1&lt;/a&gt;  (157): You know it&#39;s hard out here for a lead developer. It&#39;s about being half manager (babysitter) and half developer. It&#39;s not easy but it pays the bills. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274848&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week-end&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274747&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Does Spring encourage bad coding?&lt;/a&gt;  (161): Let&#39;s expand on Martin Fowler&#39;s naive example of the movie lister and movie finder. Without Spring this is how the code would look like // in MovieListerString genre = input.getGenre(); // action, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274747&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274848&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;How to be a Junior Developer Forever : part 1&lt;/a&gt;  (157): You know it&#39;s hard out here for a lead developer. It&#39;s about being half manager (babysitter) and half developer. It&#39;s not easy but it pays the bills. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274848&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274775&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring IoC: The Java Enterprise drug&lt;/a&gt;  (153): By now I have used Spring in a significant number of projects, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274775&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274792&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Our Grass is Greenest: OGNL and LINQ&lt;/a&gt;  (138): Microsoft&#39;s New LINQ feature looks a lot like Java&#39;s OGNL. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274792&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274805&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;CSS Navigation showcase ... *Impressive* !&lt;/a&gt;  (122): You&#39;ll find it &lt;a class=&#34;inentry&#34; href=&#34;http://www.centralscrutinizer.it/en/design/js-php/tiny-scrolling/#works&#34;&gt;here&lt;/a&gt; That&#39;s pretty amazing ! [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274805&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274793&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Comparing Google&#39;s Picasa Web to Flickr&lt;/a&gt;  (115): I find the Picasa photo organizer to be almost perfect, except for not having a Mac version. I set up a &lt;a class=&#34;inentry&#34; href=&#34;http://picasaweb.google.com/mark.watson&#34;&gt;gallery of my travel pictures on Picasa Web&lt;/a&gt; a few days ago. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274793&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274845&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring IoC: The Java Enterprise drug&lt;/a&gt;  (111): Potential dangers of Spring IoC (Inversion of Control) [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274845&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274820&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;激情女球迷带起我要去看世界杯的欲望！&lt;/a&gt;  (107): 世界杯彩绘流行 哥斯达黎加美女分外妖娆 我爱世界杯！  [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274820&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=274789&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Introduction to Neural Networks in Java&lt;/a&gt;  (102): Ever want to write a program smarter than you are? Have a go at this book (yes book) on how to get started with neural networks and just where you might want to use them. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=274789&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>On EJB Restrictions - Can You Open a Socket?</title>
				<link>https://31416.org/post/on-ejb-restrictions---can-you-open-a-socket/</link>
				<pubDate>Mon, 19 Jun 2006 11:48:00 +0000</pubDate>
				<guid>https://31416.org/post/on-ejb-restrictions---can-you-open-a-socket/</guid>
				<description>&lt;p&gt;During job interviews, one of the frequent questions is&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;What restrictions are imposed on EJBs?&amp;rdquo;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I had a chat recently with someone about it, and we still don&amp;rsquo;t agree on the answer.&lt;/p&gt;&#xA;&lt;p&gt;He believes we can&amp;rsquo;t open sockets, while I believe it is perfectly allowed, if you don&amp;rsquo;t retain the socket connection between method calls. His arguments are based on an analogy with files. After all in Linux, files are sockets. Here are his interpretations on &lt;a href=&#34;http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html&#34;&gt;a document about EJB restrictions on java.sun.com&lt;/a&gt;:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Top 10 Most Read Last Week On Javablogs.com, Week 23</title>
				<link>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-23/</link>
				<pubDate>Mon, 12 Jun 2006 16:37:00 +0000</pubDate>
				<guid>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-23/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;en&#34; xml:lang=&#34;en&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273202&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;The Top 10 Java Killer Apps&lt;/a&gt;  (357): Some VERY cool apps that have created, or are creating, quite a buzz not only in the Java world but in the larger populace. I’ve used most of the apps below, although I have yet to try a few. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273202&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273112&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google hits a home run with Google Spreadsheet&lt;/a&gt;  (290): I just got my invite to play with the latest offering from Google, the Google Spreadsheets and my initial reaction after playing with it for the past hour is incredibly positive. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273112&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273315&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Agile people still don&#39;t get it&lt;/a&gt;  (279): I just attended a presentation by Jeff Langr about Test-Driven Development which represents everything that is wrong about the way Agile advocates are trying to evangelize their practices. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273315&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272960&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Whoa ... Spring doesn&#39;t lazily instantiate beans?&lt;/a&gt;  (207): Just stumbled across a blog about &lt;a class=&#34;inentry&#34; href=&#34;http://www.memestorm.com/blog/lazy-bean-instantiation-in-spring-20/&#34;&gt;Lazy Bean instantiation in Spring 2.0&lt;/a&gt;. This is kind of funny to me ... lazy instantiation is so important, so part of the base line of IoC container functionality, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272960&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273326&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;6 Common Errors in Setting Java Heap Size&lt;/a&gt;  (198): Two JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size. Here are some common mistakes I have seen when using them: Missing m, M, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273326&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273338&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google it? Not anymore...&lt;/a&gt;  (198): I‘m disappointed in Google, to be honest. While I‘m not one of those Google-loving fly boys out there who think they can do no wrong, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273338&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273172&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Would someone please explain Spring to me?&lt;/a&gt;  (195): I&#39;m dense. It&#39;s true. I&#39;m not particularly quick to pick up on new concepts. I suppose if I encountered new concepts more often, I&#39;d get better at assimilating. Instead, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273172&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273509&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Take that .NET!&lt;/a&gt;  (191): As an outspoken advocate of Java distributed computing, I was recently confronted by a group of .NET enthusiasts. They felt compelled go on about how much more &#34;advanced&#34; . [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273509&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273822&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring, what a crappy framework&lt;/a&gt;  (184): I have this crappy theme going. In all seriousness, the Spring framework isn&#39;t crappy. As I&#39;ve mentioned before, I like its promotion of interfaces - code to interfaces, not implementation, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273822&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week-end&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273822&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring, what a crappy framework&lt;/a&gt;  (184): I have this crappy theme going. In all seriousness, the Spring framework isn&#39;t crappy. As I&#39;ve mentioned before, I like its promotion of interfaces - code to interfaces, not implementation, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273822&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273722&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Eclipse3.2 Splash Screen Final Release&lt;/a&gt;  (157): As you know I have been creating splash screens for Eclipse Releases. This the final splash screen for the Eclipse Callisto 3. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273722&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273764&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring MVC or Webwork ?&lt;/a&gt;  (124): Disclaimer::To start with, I&#39;m new to both of these frameworks and am looking at both of them with a fresh pair of eyes. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273764&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273743&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;World&#39;s funniest joke&lt;/a&gt;  (116): A couple of New Jersey hunters are out in the woods when one of them falls to the ground. He doesn&#39;t seem to be breathing, his eyes are rolled back in his head. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273743&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273798&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Agile Developers don&#39;t do Design&lt;/a&gt;  (93): James Carr is back blogging after a year&#39;s absence and writes that we don&#39;t use UML in XP. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273798&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273733&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google And The Puzzle of Dropping Eggs&lt;/a&gt;  (87): Google is also known for its interesting interview questions. Enjoy this one and my solution. Suppose you have two eggs. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273733&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273708&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;FireFox, the Next another Platform&lt;/a&gt;  (86): We see the Web 2.0 is come to reality, and the apps move to web, google as the platform for provider, and firefox as the apps to access the platform, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273708&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273778&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Why Java code is bad for rules and a declarative alternative&lt;/a&gt;  (78): One of the selling features of Drools, and one of the reasons we are often chosen over competitors, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273778&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=273748&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;86 rules while you are at a bar&lt;/a&gt;  (78): It happens that I live just across a dive bar... Also, I have really started appreciating Scotch recently Anyway, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=273748&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Non Blocking with Traditional Java IO - On the Use of InputStream.available() and Thread.sleep()</title>
				<link>https://31416.org/post/non-blocking-with-traditional-java-io---on-the-use-of-inputstream.available-and-thread.sleep/</link>
				<pubDate>Thu, 08 Jun 2006 16:31:00 +0000</pubDate>
				<guid>https://31416.org/post/non-blocking-with-traditional-java-io---on-the-use-of-inputstream.available-and-thread.sleep/</guid>
				<description>Some time ago I did quite a lot of IO in Java and I yet did not see this way of reading a InputStream from a Socket:&lt;br /&gt;&lt;table border=&#34;0&#34; cellpadding=&#34;3&#34; cellspacing=&#34;0&#34; bgcolor=&#34;#ffffff&#34;&gt;&lt;tr&gt;&lt;!-- start source code --&gt;   &lt;td nowrap=&#34;nowrap&#34; valign=&#34;top&#34; align=&#34;left&#34;&gt;    &lt;code&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;InputStream&amp;nbsp;in=channel.getInputStream&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;channel.connect&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;byte&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;[]&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tmp=&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;byte&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;[&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;1024&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;]&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;while&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;true&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;){&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;while&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;in.available&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;gt;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;){&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;int&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;i=in.read&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tmp,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;1024&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;i&amp;lt;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.print&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tmp,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;i&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;channel.isClosed&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()){&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.println&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;exit-status:&amp;nbsp;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;+channel.getExitStatus&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Thread.sleep&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;1000&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Exception&amp;nbsp;ee&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;){}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;channel.disconnect&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;/code&gt;       &lt;/td&gt;  &lt;!-- end source code --&gt;   &lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;This comes from a piece of code &lt;a href=&#34;http://www.jcraft.com/jsch/examples/Exec.java&#34;&gt;from an example of JSch &lt;/a&gt;, a good ssh client in java. A work collegue had the bad idea to remove the Thread.sleep call and was struggling with why it would randomly work.The way I would have done it is the following:&lt;br /&gt;&lt;table border=&#34;0&#34; cellpadding=&#34;3&#34; cellspacing=&#34;0&#34; bgcolor=&#34;#ffffff&#34;&gt;   &lt;tr&gt;  &lt;!-- start source code --&gt;   &lt;td nowrap=&#34;nowrap&#34; valign=&#34;top&#34; align=&#34;left&#34;&gt;    &lt;code&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;InputStream&amp;nbsp;in=channel.getInputStream&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;channel.connect&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;byte&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;[]&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tmp=&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;byte&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;[&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;1024&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;]&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;int&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;bytesRead&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;while&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;((&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;bytesRead&amp;nbsp;=&amp;nbsp;in.read&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tmp,&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;1024&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;gt;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;){&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.print&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tmp,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;0&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;bytesRead&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;channel.isClosed&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()){&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;System.out.println&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;exit-status:&amp;nbsp;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;+channel.getExitStatus&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;channel.disconnect&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;/code&gt;       &lt;/td&gt;  &lt;!-- end source code --&gt;   &lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;This has the advantage of being more readable and having less secret spices in it. In the first code, the call to available() is non blocking, meaning that without the  Thread.sleep(), there will never be the time for the socket buffer to fill up. But is the first code more efficient or the second code?&lt;br /&gt;&lt;br /&gt;I did a search on google to understand the interest of the first code. The only advantages I found in the first code are the possibility to interrupt the thread running the code and a finer grained control on timeouts. &lt;br /&gt;&lt;br /&gt;There is a &lt;a href=&#34;http://g.oswego.edu/dl/cpj/cancel.html&#34;&gt;lengthy explanation&lt;/a&gt; by Doug Lea in his book &#34;Concurrent Programming in Java&#34;. This book usually provides excellent explanations, and is a must read for anybody doing concurrent programming. But this time, about this subject, I did not find him that clear.&lt;br /&gt;&lt;br /&gt;There is a more &lt;a href=&#34;http://www.eli.sdsu.edu/courses/fall98/cs596/notes/thread2/thread2.html&#34;&gt;simple explanation&lt;/a&gt; in a course from San Diego State University (see last example)&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;  A read() on an inputstream or reader blocks. Once a thread calls read() it will not respond to interrupt() (or much else) until the read is completed. This is a problem when a read could take a long time: reading from a socket or the keyboard. If the input is not forth coming, the read() could block forever. &lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;As usual, you should not rely on all what you read on the web, as &lt;a href=&#34;http://http://bobcat.webappcabaret.net/javachina/faq/05.htm&#34;&gt;this page (SCJP Questions &amp; Answers)&lt;/a&gt; testifies:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;&lt;div class=&#34;qabold&#34;&gt;&lt;a name=&#34;thr_m12&#34; id=&#34;thr_m12&#34; shape=&#34;rect&#34;&gt; Q&lt;/a&gt;. When will a Thread I/O blocked?&lt;/div&gt; &lt;div class=&#34;qabold&#34;&gt;A:&lt;/div&gt; &lt;div class=&#34;answer&#34;&gt;When a thread executes a read() call on an InputStream, if no byte is available. The calling Thread blocks, in other words, stops executing until a byte is available or the Thread is interrupted.&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;Still I am wondering if the second code would not just go into IOException (socket timeout), on timeout (adjustable with Socket.setTimeout ) and release the Thread then. Do you have an idea when the first code could be better?&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Top 10 Most Read Last Week On Javablogs.com, Week 22</title>
				<link>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-22/</link>
				<pubDate>Mon, 05 Jun 2006 14:07:00 +0000</pubDate>
				<guid>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-22/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;en&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272296&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Why I&#39;m leaving Sun and... what next?&lt;/a&gt;  (304): Leaving Sun is possibly one of the most difficult decisions I&#39;ve ever made. But I think it&#39;s time for me to start new things and, well, it&#39;s also time for Sun to start new things. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272296&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271929&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;9 new and *noteworthy* features in Eclipse 3.2&lt;/a&gt;  (280): &lt;a class=&#34;inentry&#34; href=&#34;http://www.eclipsefaq.org/chris/&#34;&gt;Chris Laffra&lt;/a&gt; has put a big &lt;a class=&#34;inentry&#34; href=&#34;http://www.eclipse.org/evangelism/resources/laffra-eclipse32-whatsnew/laffra-whats-new-in-3.2.ppt&#34;&gt;presentation&lt;/a&gt; of all the new and noteworthy features that are coming in the Eclipse 3.2 platform.There is lots of screenshots, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271929&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272355&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Don’t you just love it when Microsoft is forced to use Java?&lt;/a&gt;  (253): Don’t you just love it when Microsoft is forced to use Java? [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272355&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272746&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Joshua Bloch Shocking Confession: java.util.Arrays Is Broken&lt;/a&gt;  (218): (This should be all over the net by now. I first saw it here. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272746&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272607&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Signs You&#39;re a Crappy Programmer (and don&#39;t know it)&lt;/a&gt;  (212): This ought to put a smile on your face unless it hits too close to home! [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272607&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272240&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring starts you programming in pure XML!&lt;/a&gt;  (211): I&#39;m now very enthusiastic, some may say obsessed, about using the &lt;a class=&#34;inentry&#34; href=&#34;http://www.springframework.org/&#34;&gt;Spring Framework&lt;/a&gt;. Spring is certainly making me more productive. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272240&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271958&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google&#39;s GWT Example: Interactive FIFA 2006 World Cup Application&lt;/a&gt;  (203): Goto the application without reading the entry.A couple of weeks ago google released the Google Web Toolkit. The toolkit lets Java developers create AJAX application, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271958&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271936&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Testicular Cancer&lt;/a&gt;  (198): I&#39;ve just been diagnosed with testicular cancer. It&#39;s probably seminoma (which is relatively good). However, other things are now on my mind and so this blog will not be updated for a while. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271936&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271842&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Intel iMac - the best Java development box in the world&lt;/a&gt;  (182): &lt;a class=&#34;inentry&#34; href=&#34;http://www.simongbrown.com/blog/2006/02/15/macbook_pro_order_cancelled.html&#34;&gt;Cancelling my MacBook Pro order&lt;/a&gt; worked out really well for me. Firstly, I&#39;m getting a new company laptop (a big grey Dull), and the prospect of carrying two laptops around just scares me. Second, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271842&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week-end&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272746&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Joshua Bloch Shocking Confession: java.util.Arrays Is Broken&lt;/a&gt;  (218): (This should be all over the net by now. I first saw it here. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272746&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272719&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Hibernate3, Annotations &amp;amp; Spring: the morning after&lt;/a&gt;  (116): Ok, after fiddling with a few more jars, I seem to have gotten past my main obsticle. Now I&#39;m back to the &lt;a class=&#34;inentry&#34; href=&#34;http://www.hibernate.org/116.html&#34;&gt;&#34;common problems&#34;&lt;/a&gt; phase of working with Hibernate. Still evaluating, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272719&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272780&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;JBoss Seam: Make Spring inside&lt;/a&gt;  (111): We here try out JBoss Seam, and find JBoss Microkernel, is this a IOC from JBoss? Why dont we use Spring instead? [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272780&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272820&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Why are we still dealing with C++ vs Java&lt;/a&gt;  (97): I had an interesting conversation this week with someone that believed that the Java world was filled with people who couldn’t code. In his opinion, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272820&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272733&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;&#34;Look Ma, no locks!&#34;&lt;/a&gt;  (97): Brian Goetz has written an excellent introductory article on nonblocking algorithms and showcases some simple nonblocking data structures with code examples and pictures. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272733&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272727&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;6 Ways of Setting Java Classpath&lt;/a&gt;  (96): How to set Java classpath? List as many ways as you can. This can be an interesting Java job interview question. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272727&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272742&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring, JBoss and The Elephant&lt;/a&gt;  (96): Interface 21 and BEA recently announced the release of Pitchfork, the EJB3 implementation within the Weblogic container, built using Spring. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272742&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272802&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Ubuntu 6.06&lt;/a&gt;  (94): I upgraded my Ubuntu box the other night. The process was pretty impressive. For one thing, it was significantly faster than an MSWindows or MacOS upgrade. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272802&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=272815&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Integrating spring and GWT&lt;/a&gt;  (84): I just completed my first shot at integrating Spring with GWT. You can check it out here Here’s what you do to expose a simple service. 1) Write the remote service, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=272815&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Is Java Flawed - a big advantage of Python/Ruby/(your favorite interpreted language)</title>
				<link>https://31416.org/post/is-java-flawed---a-big-advantage-of-pythonrubyyour-favorite-interpreted-language/</link>
				<pubDate>Fri, 02 Jun 2006 17:33:00 +0000</pubDate>
				<guid>https://31416.org/post/is-java-flawed---a-big-advantage-of-pythonrubyyour-favorite-interpreted-language/</guid>
				<description>&lt;p&gt;Java is supposed to be much better to build big projects, because of static type checking, and all the rigour around the language. But how many of you have seen  medium sized projects taking more than 30 minutes to build.&lt;/p&gt;&#xA;&lt;p&gt;At work, they have a standard J2EE project, with only about 50 EJBs, hundreds of JDO classes, and   standard classes. Between the JDO generation, EJB generation, EJB dependencies calculations, and packaging, it takes 20 minutes. And the project is not doing that much. One can optimize to avoid dependencies calculations and it would then take about 12 minutes. But still.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Using Linux to Recover Fucked Up Windows Data</title>
				<link>https://31416.org/post/using-linux-to-recover-fucked-up-windows-data/</link>
				<pubDate>Thu, 01 Jun 2006 01:52:00 +0000</pubDate>
				<guid>https://31416.org/post/using-linux-to-recover-fucked-up-windows-data/</guid>
				<description>&lt;p&gt;Recently, one of my relatives computer under Windows XP, refused to boot. There was no way of fixing it with Windows Install CD as partition table seemed corrupt to Windows. I tried everything in an 2003 &lt;a href=&#34;http://www.ultimatebootcd.com/&#34;&gt;Ultimate Boot CD&lt;/a&gt;, but nothing worked out.&lt;/p&gt;&#xA;&lt;p&gt;Someone gave me an install cd of Ubuntu Linux, and it managed to read the data. Well sometimes only. The erratic behaviour was due to a bad ATA cable. This probably was the cause of the corruption in the first place. Anyway with a new cable, Windows was still not able to read its data. But Ubuntu Linux, now working well, was able to, without having anything to configure (except mounting the drive).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java HTML Parsing Example With htmlparser</title>
				<link>https://31416.org/post/java-html-parsing-example-with-htmlparser/</link>
				<pubDate>Tue, 30 May 2006 11:02:00 +0000</pubDate>
				<guid>https://31416.org/post/java-html-parsing-example-with-htmlparser/</guid>
				<description>Every week, I post javablogs top 10 most read blog entries on this blog. The reason for it was that I don&#39;t look at what&#39;s happening on the week-end and this will pickup interesting stories from the weekend, and I also don&#39;t watch javablogs everyday. Overall I find it quite good to be uptodate with interesting stuff happening on javablogs.&lt;br /&gt;&lt;br /&gt;As mentionned in an &lt;a href=&#34;http://chasethedevil.blogspot.com/2005/09/javablogs-weekly-top-10-and-java-html.html&#34;&gt;earlier post&lt;/a&gt; my library of choice to do the parsing is &lt;a href=&#34;http://htmlparser.sourceforge.net/&#34;&gt;htmlparser&lt;/a&gt; (on sourceforge) because it&#39;s free, open source and because I am lazy and did not want to do my own. If you know a better open source library, feel free to add a comment about it, I&#39;ll be glad to hear about it. htmlparser is not the easiest library to use, there are many entry points and it&#39;s not immediately clear which one to choose. So I post here how I used it if it can save a few minutes to people having to do this task.&lt;br /&gt;&lt;br /&gt;&lt;table border=&#34;0&#34; cellpadding=&#34;3&#34; cellspacing=&#34;0&#34;&gt;   &lt;tr&gt;  &lt;!-- start source code --&gt;   &lt;td nowrap=&#34;nowrap&#34; valign=&#34;top&#34; align=&#34;left&#34;&gt;    &lt;code&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;private&amp;nbsp;static&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Entry&amp;nbsp;parseEntry&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&amp;nbsp;content&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;throws&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ParserException&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;final&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Entry&amp;nbsp;entry&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Entry&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;final&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;NodeVisitor&amp;nbsp;linkVisitor&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;NodeVisitor&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#646464&#34;&gt;@Override&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;void&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;visitTag&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Tag&amp;nbsp;tag&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&amp;nbsp;name&amp;nbsp;=&amp;nbsp;tag.getTagName&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;a&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.equalsIgnoreCase&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;name&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&amp;nbsp;hrefValue&amp;nbsp;=&amp;nbsp;tag.getAttribute&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;href&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;hrefValue&amp;nbsp;!=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;null&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;&amp;amp;&amp;amp;&amp;nbsp;!hrefValue.startsWith&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;http://&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;!hrefValue.startsWith&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;/&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;hrefValue&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;/&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;+hrefValue;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;hrefValue&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;http://javablogs.com&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;+hrefValue;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#3f7f5f&#34;&gt;//System.out.println(&amp;#34;test,&amp;nbsp;value=&amp;#34;+hrefValue);&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;hrefValue&amp;nbsp;!=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;hrefValue&amp;nbsp;=&amp;nbsp;hrefValue.replaceAll&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;&amp;amp;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;&amp;amp;amp;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tag.setAttribute&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;href&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;hrefValue&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;NodeVisitor&amp;nbsp;visitor&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;NodeVisitor&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&amp;nbsp;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#646464&#34;&gt;@Override&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;public&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;void&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;visitTag&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Tag&amp;nbsp;tag&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&amp;nbsp;name&amp;nbsp;=&amp;nbsp;tag.getTagName&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;span&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.equalsIgnoreCase&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;name&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;||&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;div&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.equalsIgnoreCase&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;name&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&amp;nbsp;classValue&amp;nbsp;=&amp;nbsp;tag.getAttribute&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;class&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#3f7f5f&#34;&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;LOGGER.debug(&amp;#34;visittag&amp;nbsp;name=&amp;#34;+name+&amp;#34;&amp;nbsp;class=&amp;#34;+classValue+&amp;#34;children=&amp;#34;+tag.getChildren().toHtml());&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;blogentrydetails&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.equals&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;classValue&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Pattern&amp;nbsp;countPattern&amp;nbsp;=&amp;nbsp;Pattern.compile&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;Reads:\\s*([0-9]*)&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Matcher&amp;nbsp;matcher&amp;nbsp;=&amp;nbsp;countPattern.matcher&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tag.getChildren&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.toHtml&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;matcher.find&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;())&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;String&amp;nbsp;countStr&amp;nbsp;=&amp;nbsp;matcher.group&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#990000&#34;&gt;1&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry.count&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Integer&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;countStr&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.intValue&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;else&amp;nbsp;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;blogentrysummary&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.equals&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;classValue&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tag.getChildren&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.visitAllNodesWith&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;linkVisitor&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;catch&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ParserException&amp;nbsp;pe&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;LOGGER.error&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;pe,pe&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry.description&amp;nbsp;=&amp;nbsp;tag.getChildren&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.toHtml&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry.description&amp;nbsp;=&amp;nbsp;entry.description.replaceAll&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;\\s+&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;&amp;nbsp;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;else&amp;nbsp;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;blogentrytitle&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.equals&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;classValue&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;))&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;tag.getChildren&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.visitAllNodesWith&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;linkVisitor&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;catch&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;ParserException&amp;nbsp;pe&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;LOGGER.error&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;pe,pe&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry.title&amp;nbsp;=tag.getChildren&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;.toHtml&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;()&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry.title&amp;nbsp;=&amp;nbsp;entry.title.replaceAll&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;\\s+&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;,&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;&amp;nbsp;&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Parser&amp;nbsp;parser&amp;nbsp;=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Parser&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Lexer&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;new&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;Page&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;content,&lt;/font&gt;&lt;font color=&#34;#2a00ff&#34;&gt;&amp;#34;UTF-8&amp;#34;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)))&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;parser.visitAllNodesWith&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;visitor&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;if&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;(&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry.title&amp;nbsp;!=&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;return&amp;nbsp;&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;entry;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#7f0055&#34;&gt;&lt;b&gt;else&amp;nbsp;return&amp;nbsp;null&lt;/b&gt;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&#34;#ffffff&#34;&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=&#34;#000000&#34;&gt;}&lt;/font&gt;&lt;/code&gt;       &lt;/td&gt;  &lt;!-- end source code --&gt;   &lt;/tr&gt;&lt;/table&gt;</description>
			</item>
			<item>
				<title>Top 10 Most Read Last Week On Javablogs.com, Week 21</title>
				<link>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-21/</link>
				<pubDate>Tue, 30 May 2006 10:12:00 +0000</pubDate>
				<guid>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-21/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;en&#34; lang=&#34;en&#34;&gt;&lt;br/&gt;Most read last week&lt;br/&gt;&lt;ol&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271778&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring vs JBoss, and why I don’t care about Sun standards&lt;/a&gt;  (272): After a long time, it was interesting to see the Spring and JBoss folks engage in a public war of words, in comments on Matt Raible’s blog. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271778&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271543&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Kent Beck: &#34;We thought we were just programming on an airplane&#34;&lt;/a&gt;  (231): JUnit co-creator Kent Beck says a number of things convinced he and Erich Gamma to create a new revision of JUnit after a long hiatus, including TestNG and Java 5. Last week at JavaOne, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271543&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270937&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Where are you, Project Manager with Technical Skills?&lt;/a&gt;  (204): In Spain we are facing again a lack of workers with experience in development of not-so-cutting-edge technologies like J2EE. So, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270937&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271807&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Thanks... and good luck Bruce!&lt;/a&gt;  (203): It is unfortunate that Bruce Tate forgot to enable comments to his final blog entry. It would be a shame to see him off without at least a small well-wishing. (possibly a little roast too ;-) [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271807&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271345&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google Web Toolkit Angst&lt;/a&gt;  (202): I&#39;ve been using Google Web Toolkit for the last week or so. I&#39;m really liking it, it is really productive and once you getting it working everything is sweet. The problem is, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271345&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271788&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Is this simpler than Hibernate?&lt;/a&gt;  (193): In an &lt;a class=&#34;inentry&#34; href=&#34;http://www.jroller.com/page/ie?entry=not_every_project_needs_hibernate&#34;&gt;earlier blog entry&lt;/a&gt; I described an early cut of DynaModel, Slingshot&#39;s persistence engine. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271788&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270790&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Article: Don&#39;t repeat the DAO! : Build a generic typesafe DAO with Hibernate and Spring AOP&lt;/a&gt;  (192): Don&#39;t repeat the DAO! : Build a generic typesafe DAO with Hibernate and Spring AOP is a developerWorks article by Per Mellqvist which presents a generic DAO implementation class based on Hibernate, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270790&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270930&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Why ORM Tools are Not Recommended&lt;/a&gt;  (185): Sandeep Sha has written an a forum posting by Why ORM Tools are Not Recommended that has some interesting points. Although I do not agree with all the points, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270930&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271051&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;The Dojo Toolkit in Practice&lt;/a&gt;  (185): We have posted a new article on using the Dojo Toolkit in a project. The article discusses a piece of a project that uses Ajax to create a responsive itinerary viewer. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271051&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;/ol&gt;&lt;br/&gt;Most read last week-end&lt;br/&gt;&lt;ol&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271778&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Spring vs JBoss, and why I don’t care about Sun standards&lt;/a&gt;  (272): After a long time, it was interesting to see the Spring and JBoss folks engage in a public war of words, in comments on Matt Raible’s blog. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271778&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271807&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Thanks... and good luck Bruce!&lt;/a&gt;  (203): It is unfortunate that Bruce Tate forgot to enable comments to his final blog entry. It would be a shame to see him off without at least a small well-wishing. (possibly a little roast too ;-) [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271807&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271788&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Is this simpler than Hibernate?&lt;/a&gt;  (193): In an &lt;a class=&#34;inentry&#34; href=&#34;http://www.jroller.com/page/ie?entry=not_every_project_needs_hibernate&#34;&gt;earlier blog entry&lt;/a&gt; I described an early cut of DynaModel, Slingshot&#39;s persistence engine. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271788&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271783&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;What’s Up With Huge Resumes?&lt;/a&gt;  (150): What’s up with huge resumes these days? The company I work for has been hiring lately and so I usually end up interviewing one to two people a week. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271783&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271821&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Introducing jvm-languages.com&lt;/a&gt;  (147): Back in September of 2004, I tried to write a book. It would have been called Dynamic Languages and Java. Unfortunately, I never completed it. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271821&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271729&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Comparison Between PMD vs Findbugs vs Hammurapi&lt;/a&gt;  (135): Take a look at this one the differences between these three tools Differences [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271729&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271716&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Then God said let there be Ubuntu... ahem&lt;/a&gt;  (130): Finally I got a version of Linux, which works as good as XP or even better ;) ; using which I can get to do my work seamlessly. Its none other than Ubuntu Dapper. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271716&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271758&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Job Trend, Not Google Trend&lt;/a&gt;  (121): Wanna know the amount of Java jobs versus .Net jobs, or the growth of AJAX jobs? Google Trend may be able to help you a bit, but the result is not scoped for jobs only. Indeed. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271758&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=271798&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;1-Minute Quiz: Why is Hyphen Illegal in Identifier?&lt;/a&gt;  (110): Why is hyphen (-) an illegal char in Java identifier? Why can&#39;t we use variable names like first-name, as we do in xml files? The answer to this question is not hard, but the challenge is, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=271798&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br/&gt;&lt;/ol&gt;&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Top 10 Most Read Last Week On Javablogs.com, Week 20</title>
				<link>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-20/</link>
				<pubDate>Mon, 22 May 2006 16:17:00 +0000</pubDate>
				<guid>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-20/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;en&#34; xml:lang=&#34;en&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270151&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;The Worst Java Job Interview Questions.&lt;/a&gt;  (269): Why are you looking for a job? Strictly speaking, this is not a java question, but it shows up in almost every job interview I&#39;ve been to. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270151&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270065&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Goodbye Ant , Welcome Maven 2&lt;/a&gt;  (219): After years of using &lt;a class=&#34;inentry&#34; href=&#34;http://ant.apache.org/&#34;&gt;Ant&lt;/a&gt; for building my applications, I have moved to something different, &lt;a class=&#34;inentry&#34; href=&#34;http://maven.apache.org/&#34;&gt;Apache Maven 2&lt;/a&gt;. And now it seems there is no looking back. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270065&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269869&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google Web Toolkit: A Brief Review&lt;/a&gt;  (219): Google has released GWT - a java window toolkit which converts your java applications (using the toolkit API) to javascript (incl. AJAX) and HTML. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269869&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269508&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;A *bold* paper against Threads&lt;/a&gt;  (214): Edward A. Lee wrote a paper called &#34;&lt;a class=&#34;inentry&#34; href=&#34;http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.html&#34;&gt;The Problem with Threads&lt;/a&gt;&#34;, you can find his pdf paper &lt;a class=&#34;inentry&#34; href=&#34;http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf&#34;&gt;here&lt;/a&gt;. There is no &lt;a class=&#34;inentry&#34; href=&#34;http://en.wiktionary.org/wiki/Rant&#34;&gt;rant&lt;/a&gt; here but facts, and sound reasoning. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269508&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269294&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Outsourcing your code is so cheap ... but why are so many jobs coming back from their indian trip ?&lt;/a&gt;  (202): There are websites where you can get very cheap developpers, here are the one I know: &lt;a class=&#34;inentry&#34; href=&#34;http://www.getacoder.com/&#34;&gt;http://www.getacoder.com/&lt;/a&gt; &lt;a class=&#34;inentry&#34; href=&#34;http://www.rentacoder.com/&#34;&gt;http://www.rentacoder.com/&lt;/a&gt; &lt;a class=&#34;inentry&#34; href=&#34;http://www.getafreelancer.com/&#34;&gt;http://www.getafreelancer.com/&lt;/a&gt; &lt;a class=&#34;inentry&#34; href=&#34;http://www.odesk.com/&#34;&gt;http://www.&lt;/a&gt; [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269294&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269360&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Signs You&#39;re a Crappy Programmer (and don&#39;t know it)&lt;/a&gt;  (190): Please read this great &lt;a class=&#34;inentry&#34; href=&#34;http://damienkatz.net/2006/05/signs_youre_a_c.html&#34;&gt;post&lt;/a&gt; from &lt;a class=&#34;inentry&#34; href=&#34;http://damienkatz.net/&#34;&gt;Damien Katz&lt;/a&gt;, and watch the signs Java is all you&#39;ll ever need. &#34;Enterprisey&#34; isn&#39;t a punchline to you. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269360&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270132&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google Web Toolkit: Web Applications Just Got Harder&lt;/a&gt;  (182): Oh the buzz. Oh the excitement. Oh the AJaX Gods has released their secret sauce with an Apache license. Google Web Toolkit allows one to develop AJaX web applications entirely in Java, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270132&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270593&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;PDFs available for JavaOne 2006 Sessions&lt;/a&gt;  (177): Check out the JavaOne 2006 Conference Session Catalog: “Presentation files available for download are indicated with a paperclip icon. After clicking on a paperclip, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270593&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269805&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google Web Toolkit for building AJAX apps in Java&lt;/a&gt;  (173): Google has introduced a &lt;a class=&#34;inentry&#34; href=&#34;http://code.google.com/webtoolkit/&#34;&gt;toolkit&lt;/a&gt; for building AJAX applications in Java, though its in beta. It has also supplied some sample applications with the kit. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269805&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week-end&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270593&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;PDFs available for JavaOne 2006 Sessions&lt;/a&gt;  (177): Check out the JavaOne 2006 Conference Session Catalog: “Presentation files available for download are indicated with a paperclip icon. After clicking on a paperclip, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270593&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270620&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Cringely: Why IBM Is in Trouble&lt;/a&gt;  (159): Robert X. Cringley doesnt have a high opinion of IBM. Last week, he wrote, ...what is IBM? IBM is a disaster-in-the-making. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270620&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270512&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;JavaOne Gossip: NetBeans Pulls a Prank on Eclipse&lt;/a&gt;  (147): Humor makes life fun. Life just got a lot funnier. For some I guess. netBeans - Eclipse 1-0. Post your suggestions on how Eclipse should get even. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270512&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270485&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Day 5: McNealy, Gosling, Gage: &#34;Forget the box&#34;&lt;/a&gt;  (139): With a mixture of sadness, relief, and hope for the future, former Sun CEO Scott McNealy took the stage this morning at the final keynote address of JavaOne 2006. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270485&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270603&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Project Harmony gets AWT/Swing Contrib from Intel&lt;/a&gt;  (127): This may be a bit late but at JavaONE this year JEdit was shown running on the AWT/Swing contribution that Intel gave to Project Harmony. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270603&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270658&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Java 7.0 (Dolphin): Evolving in the Ecosystem&lt;/a&gt;  (121): Sun developer Danny Coward says &#34;Compatibility is king&#34;, but Sun is not staying still in the Java space. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270658&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270511&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;This is genuine Microsoft&lt;/a&gt;  (120): I started playing with Google Web Toolkit beta- actually I didn’t really start. Because I had to uninstall IE7 (which I don’t use at all), but hey I’d been curious. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270511&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270520&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Become a Java Champion, stay in useless Country, Learning Java for what?&lt;/a&gt;  (120): I just thinking, what should we learn Java? Why dont use dotNet, I read Matt blog about his income US$ 200k more, or Mike Conan in OZ, that become the good best company. Today I just dont know, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270520&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=270518&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;jBixbe: a java tool I consider ... buying !&lt;/a&gt;  (90): I found this tool on &lt;a class=&#34;inentry&#34; href=&#34;http://erik.thauvin.net/&#34;&gt;Erik&lt;/a&gt;&#39;s &lt;a class=&#34;inentry&#34; href=&#34;http://erik.thauvin.net/linkblog/&#34;&gt;linkblog&lt;/a&gt;, thanks to him ! [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=270518&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Top 10 Most Read Last Week On Javablogs.com, Week 19</title>
				<link>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-19/</link>
				<pubDate>Tue, 16 May 2006 10:29:00 +0000</pubDate>
				<guid>https://31416.org/post/top-10-most-read-last-week-on-javablogs.com-week-19/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; lang=&#34;en&#34; xml:lang=&#34;en&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268326&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Axis2: Why bother?&lt;/a&gt;  (257): The Axis team is kicking up a big fuss about their recent release of Axis 2 (1.0!) Surprisingly, this library is so so abysmally bad, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268326&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268757&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google trends proves: Java is doomed&lt;/a&gt;  (251): Google trends is a nice idea, and I had to apply it adhoc to Java, Ruby, Python and C#. Interesting results, I can see a decline in Java! [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268757&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268596&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Rich Open Source Webmail that doesn&#39;t suck&lt;/a&gt;  (219): Guys...lets face it. Squirrel Mail... So check out our killer &lt;a class=&#34;inentry&#34; href=&#34;http://jboss.org/jbossBlog/blog/acoliver/?permalink=Collaboration_Based_Application_Services_with_JBoss_Collaboration_Server_1_0M5_pre1.txt&#34;&gt;rich webmail&lt;/a&gt;. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268596&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268396&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Your Next Programming Language&lt;/a&gt;  (216): Many people talk about how, as software developers, we should learn new programming languages frequently. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268396&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268530&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;How to recognize a &#34;Sacred Code&#34;&lt;/a&gt;  (210): You know you are dealing with a &lt;a class=&#34;inentry&#34; href=&#34;http://jroller.com/page/idealog?entry=sacred_code&#34;&gt;&#34;sacred code&#34;&lt;/a&gt; when you ask a previous developer (or the designer of the code) a question about the code and his immediate reply is .... [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268530&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268733&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;All you ever wanted to know about Workflow and how it relates to Java, Transactions and Concurrency&lt;/a&gt;  (204): Read this blog carefully and you&#39;re in for a PAYRAISE. Workflow and business process technology will be essential in developing next generation applications. The knowledge about it is scarce. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268733&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269125&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Omg - I love this (Mac users may not)&lt;/a&gt;  (203): This guy doesn&#39;t like Macs Damnation this is funny.... [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269125&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268639&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;7 Reasons Why Web Apps Fail&lt;/a&gt;  (179): Web applications are popping up faster and faster every day, and quite a few are using the power that Ajax offers to their advantage. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268639&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=268362&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Scaling out 37 Signal-style applications is convenient&lt;/a&gt;  (179): I had someone telling me that: Ruby can scale. Basecamp prooves that. Now, you all know that I do not think that Ruby has ANY problems with scaling. However, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=268362&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week-end&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269125&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Omg - I love this (Mac users may not)&lt;/a&gt;  (203): This guy doesn&#39;t like Macs Damnation this is funny.... [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269125&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269216&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;How to Design a Good API&lt;/a&gt;  (176): I was reading this presentation on the Design of API&#39;s by Joshua Bloch it talk&#39;s about how to design a good api but more importantly the reasons why doing certain things results in a good design. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269216&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269149&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;JRuby on Rails Is Born&lt;/a&gt;  (172): JavaOne attendees are in for a treat. Not only will they be receiving a DDJ issue which calls Rails a tipping-point to a new era in enterprise computing (or something like that)... [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269149&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269167&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;JavaOne day -1 : Bird Strike&lt;/a&gt;  (147): The plan was to fly out from Sydney to San Francisco today. The plane was fueled, the travelers boarded. The aircraft taxied out to the runway, takeoff speed was reached, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269167&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269215&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;10 things i love about my Mac&lt;/a&gt;  (125): A switcher Top 10 of nice things on Mac OS X: 1. The way programs live in the system (no registry shit) 2. The shell 3. Firewire boot capabilities 4. Apps like iChat, iSync and Addressbook 5. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269215&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269132&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;YouTube bandwith usage/costs ... AMAZING !&lt;/a&gt;  (121): While looking for successfull video hosting I found this &lt;a class=&#34;inentry&#34; href=&#34;http://www.techcrunch.com/&#34;&gt;techcrunch&lt;/a&gt; article about &lt;a class=&#34;inentry&#34; href=&#34;http://www.youtube.com&#34;&gt;youtube&lt;/a&gt; called &lt;a class=&#34;inentry&#34; href=&#34;http://www.techcrunch.com/2006/04/30/did-youtube-just-raise-another-25-million/&#34;&gt;Did YouTube Just Raise another $25 million?&lt;/a&gt; [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269132&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269214&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;10 things i hate about my Mac&lt;/a&gt;  (113): A switcher Top 10 of ugly issues with Apple Mac OS X: 1. No @ key in boot camp windows installation available 2. All banking programs on mac really suck 3. adv. [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269214&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269218&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Commons Collections 3.2 Released &lt;/a&gt;  (113): Commons Collections 3.2 has been released. Commons Collections is a library that builds upon the Java Collection Framework. It provides additional Map, [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269218&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=269146&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;GoogleTrends : Java vs C# vs PHP&lt;/a&gt;  (112): La comparaison est un poison. Ceci dit, comparer &#34;l&#39;intérêt&#34; pour java, C# et PHP avec GoogleTrends, le nouveau service de Google, était très tentant... [&lt;a class=&#34;smallgrey&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=269146&#34; title=&#34;Read the post without leaving Javablogs&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>First Steps With EhCache</title>
				<link>https://31416.org/post/first-steps-with-ehcache/</link>
				<pubDate>Thu, 04 May 2006 18:10:00 +0000</pubDate>
				<guid>https://31416.org/post/first-steps-with-ehcache/</guid>
				<description>&lt;div&gt;If you need to cache objects in your system, &lt;a href=&#34;http://ehcache.sourceforge.net&#34;&gt;Ehcache&lt;/a&gt; is a simple cache written in Java, widely used and well tested. I will present here a short tutorial on how to use EhCache for people who don&#39;t want to look around the documentation at first, but just want to test if it works in their project and to see how easy it is to setup. &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style=&#34;font-size:130%;&#34;&gt;Installation&lt;/span&gt;&lt;/div&gt; &lt;div&gt;Download Ehcache from the Download link on &lt;a href=&#34;http://ehcache.sourceforge.net&#34;&gt;http://ehcache.sourceforge.net&lt;/a&gt;. Current release is 1.2. &lt;/div&gt; &lt;div&gt;Unpack Ehcache with an unpacker that knows the tgz format. For unix users, it is trivial, for windows users, &lt;a href=&#34;http://www.7-zip.org/&#34;&gt;7zip&lt;/a&gt; is a free (and open-source) unpacker. It is probably the most popular, but there are other ones like  &lt;a href=&#34;http://www.tugzip.com&#34;&gt;tugzip&lt;/a&gt; or &lt;a href=&#34;http://www.izarc.org&#34;&gt;izarc&lt;/a&gt; or &lt;a href=&#34;http://www.win-rar.com/download.html&#34;&gt;winrar&lt;/a&gt;.&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;In your java project you need to have ehcache-1.2.jar, commons-collections-2.1.1.jar and commons-logging-1.0.4.jar (versions numbers may vary) in your classpath, those libraries are shipped with ehcache.&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style=&#34;font-size:130%;&#34;&gt;Cache Configuration&lt;/span&gt;&lt;/div&gt; &lt;div&gt;Write an ehcache.xml file where you describe what cache you want to use. There can be several files per project, several cache descriptions per file. I use here a persistent cache. Configuration file is well described at  &lt;a href=&#34;http://ehcache.sourceforge.net/documentation/configuration.html&#34;&gt;http://ehcache.sourceforge.net/documentation/configuration.html&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&lt;/span&gt; &lt;/div&gt; &lt;div&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&amp;lt;ehcache&amp;gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&lt;/span&gt; &lt;/div&gt; &lt;div&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&amp;lt;cache name=&#34;firstcache&#34; maxElementsInMemory=&#34;10000&#34; eternal=&#34;false&#34; overflowToDisk=&#34;true&#34; timeToIdleSeconds=&#34;0&#34; timeToLiveSeconds=&#34;0&#34; diskPersistent=&#34;true&#34; diskExpiryThreadIntervalSeconds=&#34;120&#34;/&amp;gt; &lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;p&gt;&amp;lt;/ehcache&amp;gt;&lt;/p&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Null vs. Errors</title>
				<link>https://31416.org/post/null-vs.-errors/</link>
				<pubDate>Wed, 26 Apr 2006 16:16:00 +0000</pubDate>
				<guid>https://31416.org/post/null-vs.-errors/</guid>
				<description>&lt;div&gt;I am not particularly a fan of&amp;nbsp; JCS (Jakarta Cache System) as I find ehcache code very clean and simple. But I have to say the author has some good comments on the &lt;a href=&#34;http://jakarta.apache.org/jcs/JCSandJCACHE.html&#34;&gt; site&lt;/a&gt;:&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt; &lt;blockquote class=&#34;gmail_quote&#34; style=&#34;PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid&#34;&gt; &lt;div&gt;Nulls vs. Errors&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;I started to support &lt;code&gt;ObjectNotFoundExceptions&lt;/code&gt; for failed gets but the overhead and cumbersome coding needed to surround a simple get method is ridiculous. Instead the JCS return null. &lt;/div&gt;&lt;/blockquote&gt; &lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;For having seen too many times the ObjectNotFoundException &amp;quot;pattern&amp;quot;, I can only agree!&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Algorithms in Java (Third Edition) Book Review</title>
				<link>https://31416.org/post/algorithms-in-java-third-edition-book-review/</link>
				<pubDate>Wed, 26 Apr 2006 12:26:00 +0000</pubDate>
				<guid>https://31416.org/post/algorithms-in-java-third-edition-book-review/</guid>
				<description>The book &lt;a href=&#34;http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;tag=michelin-20&amp;amp;amp;camp=1789&amp;creative=9325&amp;amp;path=http%3A%2F%2Fwww.amazon.com%2Fgp%2Fproduct%2F0471738840%2Fsr%3D8-1%2Fqid%3D1146046762%2Fref%3Dsr_1_1%3F%255Fencoding%3DUTF8&#34;&gt;Algorithms in Java&lt;/a&gt;&lt;img style=&#34;BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: 0px; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none&#34; height=&#34;1&#34; alt=&#34;&#34; src=&#34;http://www.assoc-amazon.com/e/ir?t=michelin-20&amp;l=ur2&amp;amp;o=1&#34; width=&#34;1&#34; border=&#34;0&#34; /&gt; is huge, but unlike the usual huge books, the content is very interesting. It can be used as reference material, or as toilet book (to learn things while you&#39;re wasting time in the toilets).&lt;br /&gt;&lt;br /&gt;You will learn simple things, like what is the &#34;raison d&#39;être&#34; of linked lists. The author gives very good examples to illustrate his propositions. He explains through the sieve of erathostene and through Josephus problem the advantages of arrays or linked list.&lt;br /&gt;&lt;br /&gt;You will learn step by step everything that is to be known in algorithms. Recursion, divide and conquer, Tree knowledge will be useful for the later sorting and searching chapters.&lt;br /&gt;&lt;br /&gt;The chapter on Hashing will make you understand very clearly why the source of String.hashCode() is&lt;br /&gt;&lt;pre&gt;&lt;span style=&#34;color:#006699;&#34;&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/span&gt; &lt;span style=&#34;color:#0099ff;&#34;&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;/span&gt; &lt;span style=&#34;color:#9966ff;&#34;&gt;hashCode&lt;/span&gt;() &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;  &lt;span style=&#34;color:#0099ff;&#34;&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;/span&gt; h &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; hash;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&#34;color:#006699;&#34;&gt;&lt;strong&gt;  if&lt;/strong&gt;&lt;/span&gt; (h &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt;&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; &lt;span style=&#34;color:#ff0000;&#34;&gt;0&lt;/span&gt;) &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&#34;color:#000000;&#34;&gt; &lt;/span&gt;    &lt;span style=&#34;color:#0099ff;&#34;&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;/span&gt; off &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; offset;&lt;/pre&gt;&lt;pre&gt;     &lt;span style=&#34;color:#0099ff;&#34;&gt;&lt;strong&gt;char&lt;/strong&gt;&lt;/span&gt; val[] &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; value;&lt;/pre&gt;&lt;pre&gt;     &lt;span style=&#34;color:#0099ff;&#34;&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;/span&gt; len &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; count;&lt;/pre&gt;&lt;pre&gt;     &lt;span style=&#34;color:#006699;&#34;&gt;&lt;strong&gt;for&lt;/strong&gt;&lt;/span&gt; (&lt;span style=&#34;color:#0099ff;&#34;&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;/span&gt; i &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; &lt;span style=&#34;color:#ff0000;&#34;&gt;0&lt;/span&gt;; i &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;&amp;lt; &lt;/strong&gt;&lt;/span&gt; len; i&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;+&lt;/strong&gt;&lt;/span&gt;&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;+&lt;/strong&gt;&lt;/span&gt;) h &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; &lt;span style=&#34;color:#ff0000;&#34;&gt;31&lt;/span&gt;&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;*&lt;/strong&gt;&lt;/span&gt;h &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;+&lt;/strong&gt;&lt;/span&gt; val[off&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt; +&lt;/strong&gt;&lt;/span&gt;&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;+&lt;/strong&gt;&lt;/span&gt;];&lt;/pre&gt;&lt;pre&gt;     hash &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;=&lt;/strong&gt;&lt;/span&gt; h;&lt;/pre&gt;&lt;pre&gt;  &lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;  &lt;span style=&#34;color:#006699;&#34;&gt;&lt;strong&gt;return&lt;/strong&gt;&lt;/span&gt; h;&lt;/pre&gt;&lt;pre&gt;&lt;span style=&#34;color:#000000;&#34;&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt; &lt;/pre&gt;&lt;br /&gt;There might be too much info on different types of sorting algorithms and the book becomes there more a reference book than anything else. But overall, you will learn plenty with this book. It is very well written, complete, and will refresh one&#39;s memory. I find it useful to read back things I learnt after a few years as I then have a very different view of the subject, and I pay closer attention to some details I completely missed the first time (sometimes). &lt;br /&gt;&lt;span class=&#34;technoratitag&#34;&gt;Tags: &lt;a href=&#34;http://www.technorati.com/tags/java&#34; rel=&#34;tag&#34;&gt;java&lt;/a&gt; &lt;a href=&#34;http://www.technorati.com/tags/book&#34; rel=&#34;tag&#34;&gt;book&lt;/a&gt; &lt;a href=&#34;http://www.technorati.com/tags/review&#34; rel=&#34;tag&#34;&gt;review&lt;/a&gt;&lt;/span&gt;</description>
			</item>
			<item>
				<title>Caching HTTP Responses in Java</title>
				<link>https://31416.org/post/caching-http-responses-in-java/</link>
				<pubDate>Wed, 19 Apr 2006 18:14:00 +0000</pubDate>
				<guid>https://31416.org/post/caching-http-responses-in-java/</guid>
				<description>&lt;p&gt;Caching HTTP response can dramatically improve performance of your app if what you generate is in reality not very dynamic. There are many free caching frameworks in Java. Most popular seem to be &lt;a href=&#34;http://ehcache.sourceforge.net/&#34;&gt;ehcache&lt;/a&gt;, &lt;a href=&#34;http://www.opensymphony.com/oscache/&#34;&gt;oscache&lt;/a&gt;, jcs and JBoss Cache.&lt;/p&gt;&#xA;&lt;p&gt;ehcache is quite simple to use and its code is clean. They have a CachingFilter that you can put in your webapp server to cache transparently HTTP responses. However as the framework only allows you to store Objects (which makes sense for most uses), I was wondering how they cached the HttpResponse which is a stream. I was a bit disappointed by the answer, they just create a copy ByteArrayOutputStream and call toBytes() to store it in the cache. While this is optimal for a memory cache store (the whole response will anyway be in the cache, although I am not sure if they check for particularly big responses to avoid caching those or try to cache those) I don&amp;rsquo;t think it is that good for a disk cache store.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Javablogs.com 2005 Top 20</title>
				<link>https://31416.org/post/javablogs.com-2005-top-20/</link>
				<pubDate>Tue, 18 Apr 2006 16:42:00 +0000</pubDate>
				<guid>https://31416.org/post/javablogs.com-2005-top-20/</guid>
				<description>&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read in 2005&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=198498&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;New in Hibernate 3: Criteria API enhancements&lt;/a&gt;  (816): Projection, aggregation, subselects, detatched criterias - its all there in the Hibernate 3 Criteria API. Let me show you some examples, starting with the new projection API.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=198498&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=209718&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Hello, IDEA!&lt;/a&gt;  (555): From the recent Java IDE discussions, it seems like there&#39;s a good portion of Java programmers who don&#39;t know &lt;a class=&#39;inentry&#39; href=&#34;http://www.jetbrains.com/idea&#34;&gt;IntelliJ IDEA&lt;/a&gt;, or simply haven&#39;t tried it yet. In this short screencast,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=209718&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=247056&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Hey Gosling: This is why we don’t use Java 5.0 yet!&lt;/a&gt;  (461): Whenever there is a major JDK update everyone on the Sun Microsystems side seems to love to beat the drum of upgrading.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=247056&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=230569&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;MSN7.5??&lt;/a&gt;  (450): ?????Google Talk????????????????????????????????????Google Talk???????? Google Talk???????????????????????????????????? &amp;nbsp; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=230569&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=234371&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;The worst code I&#39;ve ever seen. Yes, that&#39;s true.&lt;/a&gt;  (422): I&#39;ve been in this business for 25 years and have been programming since the mid seventies. Even when I was a young pup, full of bright ideas and hubris and those around me were at least as bad,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=234371&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=231040&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;JSP is officially dead&lt;/a&gt;  (407): Well, it looks like with the Final Draft of Java EE 5, the final nail has been placed in JSP&#39;s coffin.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=231040&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=209182&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;My wife is hot and she can code, too&lt;/a&gt;  (400): My wife Keri loves puzzle games--tetris, scrabble, crosswords, text twist--any game where you have to figure something out, she&#39;s on it. She has a degree in &lt;a class=&#39;inentry&#39; href=&#34;http://cs.ua.edu&#34;&gt;CS&lt;/a&gt;, and is employed as a UI specialist,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=209182&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=195889&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;IBM announced SOMA - Service-Oriented Modelling and Architecture&lt;/a&gt;  (396): [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=195889&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=228119&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;G-mail runs on Tomcat???!!!!!&lt;/a&gt;  (390): Well, hello guys and gals...haven&#39;t been in the Java blog scene recently, but am glad to know Java is going strong as ever (not that I ever doubted it,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=228119&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=195923&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Web Services articles&lt;/a&gt;  (374): [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=195923&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=214638&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Bill Gates tries Firefox&lt;/a&gt;  (362): Tim Weber of the BBC reporter rustles up Bill Gates quote of 2005: Bill Gates is one of the people with Firefox on his computer, so I asked him for his opinion. I played around with it a bit,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=214638&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=208070&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Language Oriented Programming: Everything is a Language&lt;/a&gt;  (361): Some people don&#39;t &#39;get&#39; &lt;a class=&#39;inentry&#39; href=&#34;http://www.onboard.jetbrains.com/is1/articles/04/10/lop/&#34;&gt;Language Oriented Programming&lt;/a&gt;. It&#39;s a different perspective. Once you make the mental shift, everything starts to fall into place. Over the past few months,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=208070&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=240898&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;The killer app for Web 2.0 has arrived&lt;/a&gt;  (356): Time to throw in the towel, 37 Signals. The future has arrived: iClock (via flocksucks) [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=240898&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=227734&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;New Search Engine Blows Google Away&lt;/a&gt;  (356): After months of incredibly secret development, PreviewSeek Limited has launched the PreviewSeek search engine. My initial impression? It blows google away with its far more powerful searches. [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=227734&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=211632&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Death to Apache&lt;/a&gt;  (356): So our Apache heros have now decided that it isn&#39;t quite enough to prove to the world that they are abysmal failures at producing a J2EE container,&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=211632&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=195922&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;WebSphere 6.0 System Management Enhancements&lt;/a&gt;  (356): [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=195922&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=195710&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;It&#39;s Official, Struts is History!&lt;/a&gt;  (352): [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=195710&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=215445&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;What Steve isn&#39;t telling us&lt;/a&gt;  (348): So the rumors were true, Apple is really switching to Intel.&amp;#160; There are a lot of interesting things in Steve Jobs&#39; keynote, as usual, but the most interesting part is,... [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=215445&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=210191&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;RE: Why I Ditched Hibernate&lt;/a&gt;  (346): I saw &lt;a class=&#39;inentry&#39; href=&#34;http://www.thepostmodern.net/blog/BlogEntry.jsp?id=115&#34;&gt;this post&lt;/a&gt; and couldn&#39;t help but respond. The post&#39;s author, Bruce, is ditching Hibernate and Spring b/c he wants to use a connection pool (configured in Tomcat) instead.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=210191&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;</description>
			</item>
			<item>
				<title>How To Use Java With Blogger: A Tutorial</title>
				<link>https://31416.org/post/how-to-use-java-with-blogger-a-tutorial/</link>
				<pubDate>Tue, 18 Apr 2006 16:36:00 +0000</pubDate>
				<guid>https://31416.org/post/how-to-use-java-with-blogger-a-tutorial/</guid>
				<description>Blogger has a &lt;a href=&#34;http://code.blogger.com/archives/atom-docs.html&#34;&gt;REST API&lt;/a&gt;. I use it to retrieve particular posts or to post transformed data. There is no Java API that I know of, but you will see here it is not very difficult to interface with Blogger API in Java using plain old XML. &lt;br&gt;&lt;br&gt;Using libraries &lt;a href=&#34;http://jakarta.apache.org/commons/httpclient/&#34;&gt;commons-httpclient&lt;/a&gt; and &lt;a href=&#34;http://www.dom4j.org/&#34;&gt;DOM4J&lt;/a&gt; it would be quite easy to implement your own Java Blogger API as the following code will suggest. &lt;br&gt;&lt;br&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Authenticate&lt;/span&gt;&lt;br&gt;All requests need to be authenticated and are done in HTTPS. I use common-httpclient to perform requests. Here is how to setup the client:&lt;br&gt;&lt;PRE&gt;&lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;private&lt;/STRONG&gt;&lt;/FONT&gt;  HttpClient &lt;FONT COLOR=&#34;#9966ff&#34;&gt;initHttpClient&lt;/FONT&gt;()&lt;br /&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  HttpClient client  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;HttpClient&lt;/FONT&gt;();&lt;br /&gt;  List authPrefs &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;ArrayList&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff0000&#34;&gt;2&lt;/FONT&gt;);&lt;br /&gt;  authPrefs.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;add&lt;/FONT&gt;(AuthPolicy.DIGEST );&lt;br /&gt;  authPrefs.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;add&lt;/FONT&gt;(AuthPolicy.BASIC);&lt;br /&gt;  client.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getParams&lt;/FONT&gt;().setParameter (AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);&lt;br /&gt;  client.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getParams&lt;/FONT&gt;().&lt;FONT COLOR=&#34;#9966ff&#34;&gt;setAuthenticationPreemptive&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#cc00cc&#34;&gt;true&lt;/FONT&gt;);&lt;br /&gt;  Credentials defaultcreds &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;UsernamePasswordCredentials&lt;/FONT&gt;(user, password); &lt;br /&gt;  client.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getState&lt;/FONT&gt;().&lt;FONT COLOR=&#34;#9966ff&#34;&gt;setCredentials&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;AuthScope&lt;/FONT&gt;( &lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;www.blogger.com&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;, &lt;FONT COLOR=&#34;#ff0000&#34;&gt;443&lt;/FONT&gt;, AuthScope.ANY_REALM), defaultcreds);&lt;br /&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/FONT&gt; client;          &lt;br /&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Get Your Posts&lt;/span&gt; &lt;br&gt;To retrieve the posts, you just have to query the right url, and parse the XML response. I prefer to use DOM4J, because of its handy asXML() method to print a node as XML. For simplicity I use a Map to store an XML entry. &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;public&lt;/STRONG&gt;&lt;/FONT&gt; Collection &lt;FONT COLOR=&#34;#9966ff&#34;&gt;getPosts&lt;/FONT&gt;() &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;throws&lt;/STRONG&gt;&lt;/FONT&gt;  HttpException, IOException, ParserConfigurationException, SAXException, DocumentException &lt;br /&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  GetMethod get &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#9966ff&#34;&gt;GetMethod&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;https://www.blogger.com/atom&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;/&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;blogId);&lt;br /&gt;  &lt;FONT COLOR=&#34;#0099ff&#34;&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/FONT&gt;  statusCode &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; client.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;executeMethod&lt;/FONT&gt;(get);&lt;br /&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/FONT&gt;   (statusCode &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;  HttpStatus.SC_OK)&lt;br /&gt;  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;throw&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;RuntimeException&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;Could&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;not&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;make&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;HTTP&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;request&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;properly:&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;get.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getStatusLine&lt;/FONT&gt;());&lt;br /&gt;  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  InputStream response  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; get.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getResponseBodyAsStream&lt;/FONT&gt;();&lt;br /&gt;  SAXReader reader &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#9966ff&#34;&gt;SAXReader&lt;/FONT&gt;();&lt;br /&gt;  Document doc &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; reader.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;read&lt;/FONT&gt;(response);&lt;br /&gt;  Collection posts &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;ArrayList&lt;/FONT&gt;();&lt;br /&gt;  List entries  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; doc.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getRootElement&lt;/FONT&gt;().&lt;FONT COLOR=&#34;#9966ff&#34;&gt;elements&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;entry&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/FONT&gt; (LOG.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;isDebugEnabled&lt;/FONT&gt;()) &lt;br /&gt;  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    LOG.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;debug&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;found&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;entries.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;size&lt;/FONT&gt;()&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;entries&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;/FONT&gt; (&lt;FONT COLOR=&#34;#0099ff&#34;&gt;&lt;STRONG&gt;int&lt;/STRONG&gt;&lt;/FONT&gt;  i &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#ff0000&#34;&gt;0&lt;/FONT&gt;; i &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt;&lt;/FONT&gt;entries.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;size&lt;/FONT&gt;();i &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;)&lt;br /&gt;  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    Element entry  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; (Element) entries.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;get&lt;/FONT&gt;(i); &lt;br /&gt;    Map m &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#9966ff&#34;&gt;HashMap&lt;/FONT&gt;();&lt;br /&gt;    &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;/FONT&gt; (Iterator it &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; entry.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;elementIterator&lt;/FONT&gt;();it. &lt;FONT COLOR=&#34;#9966ff&#34;&gt;hasNext&lt;/FONT&gt;();)&lt;br /&gt;    &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;      Element detail &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;  (Element) it.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;next&lt;/FONT&gt;();&lt;br /&gt;      String name &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; detail.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getName&lt;/FONT&gt;();&lt;br /&gt;      &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/FONT&gt; (name.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;equals&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;link&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;))&lt;br /&gt;      &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;        m.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;put&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;link&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;,detail.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;attribute&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;href&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;).&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getValue&lt;/FONT&gt;());&lt;br /&gt;      &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;      &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/FONT&gt; (name. &lt;FONT COLOR=&#34;#9966ff&#34;&gt;equals&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;content&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;))&lt;br /&gt;      &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;        m.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;put&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;content&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;,detail.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;asXML&lt;/FONT&gt;());&lt;br /&gt;      &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;      &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;      &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt; &lt;br /&gt;        m.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;put&lt;/FONT&gt;(name,detail.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;getTextTrim&lt;/FONT&gt;());&lt;br /&gt;      &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt; &lt;br /&gt;    &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;    posts.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;add&lt;/FONT&gt;(m);                   &lt;br /&gt;    &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/FONT&gt;  (LOG.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;isDebugEnabled&lt;/FONT&gt;())&lt;br /&gt;    &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;      LOG.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;debug&lt;/FONT&gt;( &lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;found=&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;m.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;get&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;title&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;)&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;,&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;url=&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;+&lt;/STRONG&gt;&lt;/FONT&gt;m.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;get&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;link&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;)); &lt;br /&gt;    &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/FONT&gt;  posts;&lt;br /&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/pre&gt; &lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;br&gt;&lt;/span&gt;Create XML for a new Post&lt;br&gt;&lt;/span&gt;Nothing particular here, just XML production. &lt;br&gt;&lt;pre&gt;&lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;private&lt;/STRONG&gt;&lt;/FONT&gt; String &lt;FONT COLOR=&#34;#9966ff&#34;&gt;createXmlForCreatePost&lt;/FONT&gt;(String postTitle, String postContent) &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;throws&lt;/STRONG&gt;&lt;/FONT&gt;   IOException, DocumentException&lt;br /&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/FONT&gt;&lt;br /&gt;  SAXReader xmlReader &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#9966ff&#34;&gt;SAXReader&lt;/FONT&gt;();&lt;br /&gt;  xmlReader.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;setValidation&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#cc00cc&#34;&gt;false&lt;/FONT&gt; );&lt;br /&gt;  Document doc &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; DocumentHelper.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;createDocument&lt;/FONT&gt;();&lt;br /&gt;  QName rootName  &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; DocumentHelper.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;createQName&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;entry&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;, &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#9966ff&#34;&gt;Namespace&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;, &lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;http://purl.org/atom/ns#&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;));&lt;br /&gt;  Element root &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; doc.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addElement&lt;/FONT&gt;(rootName);&lt;br /&gt;  Element title &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; root.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addElement&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;title&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;); &lt;br /&gt;  title.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addAttribute&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;mode&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;,&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;escaped&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  title.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addAttribute&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;type&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;,&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;text/plain&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  title.setText (postTitle);&lt;br /&gt;  Element generator &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; root.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addElement&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;generator&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  generator.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addAttribute&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;url&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt; , &lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;http://31416.org&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  generator. &lt;FONT COLOR=&#34;#9966ff&#34;&gt;setText&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;31416&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;Java&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;Generator&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  Element content &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; root.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addElement&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;content&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  content.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;addAttribute&lt;/FONT&gt;(&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;type&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt; , &lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;application/xhtml+xml&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff00cc&#34;&gt;&amp;quot;&lt;/FONT&gt;);&lt;br /&gt;  &lt;FONT COLOR=&#34;#ff8400&#34;&gt;//&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;Element&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;div&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;=&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;content.addElement(DocumentHelper.createQName(&amp;quot;div&amp;quot;,new&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;Namespace(&amp;quot;&amp;quot;,&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;)));&lt;/FONT&gt;&lt;br /&gt;  &lt;FONT COLOR=&#34;#ff8400&#34;&gt;//&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;div.add(...);&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;//YOUR&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;XHTML&lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt; &lt;/FONT&gt;&lt;FONT COLOR=&#34;#ff8400&#34;&gt;HERE&lt;/FONT&gt;&lt;br /&gt;  StringWriter result &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt;  &lt;FONT COLOR=&#34;#9966ff&#34;&gt;StringWriter&lt;/FONT&gt;();&lt;br /&gt;  XMLWriter writer &lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;new&lt;/STRONG&gt;&lt;/FONT&gt; XMLWriter (result);&lt;br /&gt;  writer.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;write&lt;/FONT&gt;(doc);&lt;br /&gt;  writer.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;close&lt;/FONT&gt;();&lt;br /&gt;  &lt;FONT COLOR=&#34;#006699&#34;&gt;&lt;STRONG&gt;return&lt;/STRONG&gt;&lt;/FONT&gt; result.&lt;FONT COLOR=&#34;#9966ff&#34;&gt;toString&lt;/FONT&gt;();&lt;br /&gt;&lt;FONT COLOR=&#34;#000000&#34;&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/pre&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt; &lt;br&gt;&lt;/span&gt;That&#39;s it&lt;/span&gt;&lt;br&gt;&lt;br&gt;</description>
			</item>
			<item>
				<title>Last week Javablogs.com top 10</title>
				<link>https://31416.org/post/last-week-javablogs.com-top-10/</link>
				<pubDate>Tue, 18 Apr 2006 11:02:00 +0000</pubDate>
				<guid>https://31416.org/post/last-week-javablogs.com-top-10/</guid>
				<description>&lt;div xmlns=&#34;http://www.w3.org/1999/xhtml&#34; xml:lang=&#34;en&#34; lang=&#34;en&#34;&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264596&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Stupid Command Prompt Tricks&lt;/a&gt;  (289): These Stupid (Windows) Command Prompt Tricks actually look rather useful. [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264596&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264331&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;The truth about Tudu Lists!!&lt;/a&gt;  (260): I&#39;ve now been working on &lt;a class=&#39;inentry&#39; href=&#34;http://tudu.sf.net&#34;&gt;Tudu Lists&lt;/a&gt; for more than one year, and I&#39;m releasing today version 1.1. With this latest release, it is now time for me to tell the truth about Tudu Lists.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264331&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264413&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Toplink vs hibernate&lt;/a&gt;  (258): I still remember the excitement I felt when I started working on Toplink. It was early 2000. Before that, I was working mainly in visual c++.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264413&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264450&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Why RedHat bought JBoss&lt;/a&gt;  (249): RedHat has a market cap of roughly 20x revenues, which quite frankly is unheard of; most companies would kill to have a P/E ratio that high, let alone a price-to-sales ratio!&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264450&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264269&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Red Hat Acquires JBoss&lt;/a&gt;  (214): &lt;a class=&#39;inentry&#39; href=&#34;http://www.redhat.com/about/news/prarchive/2006/jboss.html&#34;&gt;It is official&lt;/a&gt;. Now the corp office is in my back yard!&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264269&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264717&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google Calendar is now live&lt;/a&gt;  (212): The subject says it all... Go ahead: log in, play around and post your suggestions and impressions as long as it&#39;s not &#34;It doesn&#39;t work on Safari&#34; (usually the... [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264717&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264659&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Why is Tomcat called Tomcat&lt;/a&gt;  (208): Every now and again the topic of why Tomcat is called Tomcat pops up and I don&#39;t know anyone who actually knew Anyway I thought I would look it up so if anyone else asked me I could tell them the&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264659&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=264747&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;RANT: Eclipse Sucks&lt;/a&gt;  (186): Eclipse has an AI engine that realizes when I haven&#39;t used it often enough for it to have burned me recently to kick in and do something really painful to me.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=264747&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265140&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Top ten use case mistakes&lt;/a&gt;  (170): Top ten use case mistakes -Tyner Blain: We’re reiterating the top five use case mistakes from Top five use case blunders and adding five more. For details on the first five, go back to that post.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265140&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Most read last week-end&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265140&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Top ten use case mistakes&lt;/a&gt;  (170): Top ten use case mistakes -Tyner Blain: We’re reiterating the top five use case mistakes from Top five use case blunders and adding five more. For details on the first five, go back to that post.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265140&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265194&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Netbeans versus Eclipse&lt;/a&gt;  (155): Eclipse has been the leader of the pack for the last five years but with Netbeans becoming free, is Eclipse&#39;s title of most popular IDE coming to an end.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265194&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265152&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;MacBook vs. Athlon XP Java benchmark&lt;/a&gt;  (150): So i finally made a first mini benchmark regarding my new hardware. Of course i was curious how the macBook performs against my old (somewhat outdated) PC platform.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265152&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265035&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Eclipse 3.2 RC1 Released&lt;/a&gt;  (143): Eclipse 3.2 RC1 is out and is available for download. Other Callisto release projects are releasing over the next two weeks. 39 words.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265035&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265052&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;7 Hour Daily Commute&lt;/a&gt;  (139): This person does an astonishing 7 hour commute to get to work. Everyday. And he&#39;s been doing it since 1989. I&#39;m too astonished to criticize. Also, it&#39;s just too easy..... [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265052&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265159&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Google Calendar - Oh so close!&lt;/a&gt;  (135): It took me a few years to switch from Yahoo!&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265159&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265040&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;MacBook Pro Update&lt;/a&gt;  (121): I&amp;#8217;m loving my new MacBook Pro, but&amp;#8230; it&amp;#8217;s definitely far from perfect.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265040&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265044&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Next Generation Frameworks are only superficially competitors&lt;/a&gt;  (117): There&#39;s an interesting thread over on the Grails mailing list.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265044&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;li&gt; &lt;a href=&#34;http://javablogs.com/Jump.action?id=265047&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;Is Memory Management in Java Garbage?&lt;/a&gt;  (117): A friend of mine who was learning C# commented he felt C# was a more powerful because you had to memory manage yourself and it took more effort to create and destroy objects.&amp;hellip; [&lt;a title=&#34;Read the post without leaving Javablogs&#34; href=&#34;http://javablogs.com/ViewEntry.action?id=265047&#34; class=&#34;smallgrey&#34;&gt;read&lt;/a&gt;] &lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Web Services No Better Than CORBA?</title>
				<link>https://31416.org/post/web-services-no-better-than-corba/</link>
				<pubDate>Mon, 10 Apr 2006 15:23:00 +0000</pubDate>
				<guid>https://31416.org/post/web-services-no-better-than-corba/</guid>
				<description>&lt;div&gt;Richard Monson-Haefel (RMH), author of the famous Enterprise Java Beans (O&#39;Reilly) and of a Web Services book is making an alarming claim about JAX-WS, the new Java web services standard: &lt;/div&gt; &lt;div&gt; &lt;blockquote class=&#34;gmail_quote&#34; style=&#34;PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid&#34;&gt;&lt;strong&gt;JAX-WS still sucks!&lt;/strong&gt;&lt;/blockquote&gt;&lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;In an effort to write a client to real world web services (for Google, Amazon, Ebay), &lt;a href=&#34;http://rmh.blogs.com/weblog/2006/04/redeemed_jaxws_.html&#34;&gt;he mostly&amp;nbsp;failed&lt;/a&gt;. Errors seem to be largely related to WSDL to Java conversion. Jason Green, a JBoss developer, managed to get quickly a web service working for Ebay, but analysis by RMH suggest that hundreds of classes were generated for this simple one method web service. &lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Recently I had to try to do CORBA client classes by hand in Java since the rmic tool was not working that well to generate classes that could be run on a client JVM of different version than the server JVM. It proved to be a no-go in the end, because of the complexity involved not only in coding, but more on maintaining those modified generated classes. This would have required coding a tool dedicated for that purpose. We chose to pass simpler objects, differently,&amp;nbsp;which looks just like a hack&amp;nbsp;to avoid having CORBA issues. I am amazed that after that many years of CORBA, there are still simple cases where it does not work properly automatically.  &lt;/div&gt; &lt;div&gt;&amp;nbsp;&lt;/div&gt; &lt;div&gt;Seeing that there is the same kind of problem with Web Services (IDL to Java translation) makes me wonder about Web Services &amp;quot;improvement&amp;quot; over CORBA. And WSDL is definitely less readable than CORBA IDL.&lt;/div&gt;  &lt;div&gt;&amp;nbsp;&lt;/div&gt;</description>
			</item>
			<item>
				<title>Is your UML Composition French or American?</title>
				<link>https://31416.org/post/is-your-uml-composition-french-or-american/</link>
				<pubDate>Fri, 07 Apr 2006 11:40:00 +0000</pubDate>
				<guid>https://31416.org/post/is-your-uml-composition-french-or-american/</guid>
				<description>&lt;span style=&#34;font-size:130%;&#34;&gt;The French Way&lt;/span&gt;&lt;br /&gt;In many French books/lessons (&lt;a href=&#34;http://uml.free.fr/cours/p15.html&#34;&gt;a lesson here&lt;/a&gt;, &lt;a href=&#34;http://www.iutc3.unicaen.fr/%7Emoranb/cours/acsi/static2/stat13.htm&#34;&gt;another from caen university &lt;/a&gt;, &lt;a href=&#34;http://trempet.uqam.ca/Enseignement/Cours/MGL7260/Hiver2006/NotesdeCours/PP-TypeAgregatCompisitionUML.ppt&#34;&gt;one from UQAM&lt;/a&gt;), UML composition does not seem to mean the same as their English counterparts. They write:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;Si l&#39;agrégat est détruit (ou copié), ses composants le sont      aussi.&lt;/blockquote&gt;&lt;div&gt;or&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; les composants (en tant qu&#39;ils sont composants) ont une durée de vie incluse dans celle de leur composé.&lt;/blockquote&gt;&lt;br /&gt;translated to English:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; If the aggregate is destroyed (or copied), its components are destroyed (or copied) as well.&lt;br /&gt;&lt;/blockquote&gt;or&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; components (while they are components) lifetime is included in the one of their aggregate&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/div&gt;But then what does it mean to have a cardinality of 0 on the aggregate side?&lt;br /&gt;Few French lessons give an answer (UQAM does, maybe because it&#39;s half French only). The component can be created before the aggregate but must be destroyed when the aggregate is.  &lt;span style=&#34;font-size:130%;&#34;&gt;&lt;br /&gt;&lt;br /&gt;The American Way&lt;/span&gt;&lt;br /&gt;Most English books/lessons describe composition more accurately. &lt;a href=&#34;http://ootips.org/uml-hasa.html&#34;&gt;Ootips&lt;/a&gt; definition is simple and clear:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; Composition [...] is exactly like Aggregation except that the lifetime of the &#39;part&#39; is controlled by the &#39;whole&#39;.  This control may be direct or transitive.  That is, the &#39;whole&#39; may take direct responsibility for creating or destroying the &#39;part&#39;, or it may accept an already created part, and later pass it on to some other whole that assumes responsibility for it.&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;However Martin Fowler in &lt;span style=&#34;font-style: italic;&#34;&gt;UML distilled&lt;/span&gt;  explicitly writes:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; The &#34;no sharing&#34; rule is the key to composition . Another assumption is that if you delete the polygon, it should automatically ensure that any owned Points also are deleted .&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;By using the word &#34;assumption&#34; he is avoiding a clear meaning. So I looked up in the  &lt;a href=&#34;http://www.omg.org/cgi-bin/doc?formal/05-07-04&#34;&gt;UML specifications from uml.org&lt;/a&gt;. The specs are actually very near ootips definition and even more explicit:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; An association may represent a composite aggregation (i.e., a whole/part relationship). Only binary associations can be aggregations. Composite aggregation is a strong form of aggregation that requires a part instance be included in at most one composite at a time. If a composite is deleted, all of its parts are normally deleted with it.  &lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;span style=&#34;background-color: rgb(255, 255, 153);&#34;&gt;Note that a part can (where allowed) be removed from a composite before the composite is deleted, and thus not be deleted as part of the composite. &lt;/span&gt; &lt;/span&gt;Compositions define transitive asymmetric relationships—their links form a directed, acyclic graph.&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;So it turns out that some French definitions were not wrong, but imprecise. Their true meaning becomes only clear after reading the English UML specs.&lt;br /&gt;&lt;br /&gt;&lt;div&gt; &lt;a href=&#34;http://ootips.org/uml-hasa.html&#34;&gt;Ootips&lt;/a&gt; has also a good example of difference between aggregation and association. If you have an aggregation relation between two Node entities, it means you represent a tree of Nodes, not a graph of Nodes. See the link for more details. &lt;/div&gt;</description>
			</item>
			<item>
				<title>Are UML Aggregation and Composition Good Concepts?</title>
				<link>https://31416.org/post/are-uml-aggregation-and-composition-good-concepts/</link>
				<pubDate>Tue, 04 Apr 2006 11:12:00 +0000</pubDate>
				<guid>https://31416.org/post/are-uml-aggregation-and-composition-good-concepts/</guid>
				<description>Yesterday a work collegue made the remark that the notions of aggregation and composition were not very clear. I was a bit surprised at first. But I actually almost always use just associations relations, sometimes composition, I was not sure anymore about the difference between aggregation and association and the one between composition and aggregation. I had to look up in a book to remember what it was all about.&lt;br /&gt;&lt;br /&gt;The French book we looked at was really bad. In the end we did not understand fully the differences except a notion of &#34;stronger coupling&#34;, some kind of &#34;asymetry&#34;!?!  The difference between aggregation and composition was more explicit since in a composition, the &#34;child&#34; can only have one parent.&lt;br /&gt;&lt;br /&gt;The &lt;span style=&#34;font-style: italic;&#34;&gt;UML Distilled&lt;/span&gt; book is much more explicit and I recommend that book to anybody doing UML:&lt;br /&gt;&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt; &lt;ul&gt;&lt;li&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Aggregation is strictly meaningless&lt;/span&gt; ; as a result, I recommend that you ignore it in your own diagrams .If you see it in other people&#39;s diagrams, you&#39;ll need to dig deeper to find out what they mean by it . Different authors and teams use it for very different purposes. &lt;/li&gt;&lt;li&gt;Composition is a good way of showing properties that own by value, properties to value objects (page 73), or properties that have a strong and somewhat exclusive ownership of particular other components.&lt;/li&gt;&lt;/ul&gt; &lt;/blockquote&gt;&lt;br /&gt;Bertrand Meyer prefers to describe relationships using only two concepts, client and heir, basically UML association and specialization and therefore avoids the distinction between aggregation and composition and association: &lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;&lt;ul&gt;&lt;li&gt;B is a client of A if every object of type B may contain information about one or more objects of type A. &lt;/li&gt;&lt;li&gt;B is an heir of A if B denotes a specialized version of A.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;div&gt;He then uses &#34;class invariants&#34; to specify the nature of the client relationship.&lt;br /&gt;&lt;/div&gt;</description>
			</item>
			<item>
				<title>SOA and B. Meyer</title>
				<link>https://31416.org/post/soa-and-b.-meyer/</link>
				<pubDate>Fri, 31 Mar 2006 15:08:00 +0000</pubDate>
				<guid>https://31416.org/post/soa-and-b.-meyer/</guid>
				<description>&lt;p&gt;While rereading parts of &lt;em&gt;Object Oriented Software Construction&lt;/em&gt; from B. Meyer, I still find valuable information I overlooked. In the part about functional decomposition where he argues pro and cons of top-down / bottom-up approaches, he has the intuition of the current SOA hype. By showing that&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Real systems have no top.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;He suggests that the only way to build complex software is through a service oriented architecture. Of course SOA is a very old concept. Meyer example of Operating Systems is a fine one.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Tired Of &#39;My 10 Best XXX&#39; Blog Posts</title>
				<link>https://31416.org/post/tired-of-my-10-best-xxx-blog-posts/</link>
				<pubDate>Thu, 30 Mar 2006 10:32:00 +0000</pubDate>
				<guid>https://31416.org/post/tired-of-my-10-best-xxx-blog-posts/</guid>
				<description>It&#39;s incredible how many posts on popular aggregators are just about a list of stuff, and how except one word they sound the same.&lt;br&gt;Only today on Javaworld, I can read:&lt;br&gt;&amp;quot;&lt;span class=&#34;blogentrytitle&#34;&gt;&lt;a href=&#34;http://javablogs.com/Jump.action?id=262700&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt; Ten Things Every Java Developer Should Know About Unix&lt;/a&gt;&amp;quot;&lt;br&gt;&lt;/span&gt;&lt;span class=&#34;blogentrytitle&#34;&gt;&lt;a href=&#34;http://javablogs.com/Jump.action?id=262710&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;&amp;quot;My 10 Favorite Scripting Languages &lt;/a&gt;&amp;quot; &lt;br&gt;&amp;quot;&lt;/span&gt;&lt;span class=&#34;blogentrytitle&#34;&gt;&lt;a href=&#34;http://javablogs.com/Jump.action?id=262519&#34; title=&#34;Read full entry on author&#39;s blog&#34;&gt;7 Must-Have Programs for Windows&amp;quot;&lt;/a&gt;&lt;br&gt;&lt;br&gt;They all seem to have read the &lt;br&gt;&amp;quot;10 best ways to have your post popular on delicious&amp;quot;&lt;br&gt;&lt;br&gt;It&#39;s a bit boring.&lt;br&gt; &lt;/span&gt;</description>
			</item>
			<item>
				<title>Bilinear Gaussian Lanczos? Downsampling!</title>
				<link>https://31416.org/post/bilinear-gaussian-lanczos-downsampling/</link>
				<pubDate>Fri, 17 Mar 2006 17:32:00 +0000</pubDate>
				<guid>https://31416.org/post/bilinear-gaussian-lanczos-downsampling/</guid>
				<description>Not easy to choose a downsampling algorithm. Some links:&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&#34;http://www.mplayerhq.hu/DOCS/tech/swscaler_methods.txt&#34; target=&#34;_blank&#34; onclick=&#34;return top.js.OpenExtLink(window,event,this)&#34;&gt;mplayer&lt;/a&gt;: advises bilinear for quality and describes artifacts for each algo &lt;/li&gt;&lt;li&gt;&lt;a href=&#34;http://www.lassekolb.info/gim35_downsampling.htm&#34; target=&#34;_blank&#34; onclick=&#34;return top.js.OpenExtLink(window,event,this)&#34;&gt; a blogger&lt;/a&gt;: advises lanczos. This links shows pictures produced by each algo.&lt;br&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&#34;http://www.cambridgeincolour.com/tutorials/image-interpolation.htm&#34;&gt;digital image interpolation&lt;/a&gt;: seems to have a preference for bicubic, what photoshop uses. &lt;/li&gt;&lt;li&gt;&lt;a href=&#34;http://forum.videohelp.com/viewtopic.php?t=295115&#34;&gt;videohelp&lt;/a&gt;: tested various algorithms and think &lt;span class=&#34;postbody&#34;&gt;Bicubic spline is the best.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;People don&#39;t seem to agree. If you want to check the theory: &lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Bilinear_interpolation&#34;&gt;wikipedia lanczos&lt;br&gt;   &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Bilinear_interpolation&#34;&gt;wikipedia bilinear&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br&gt;&lt;br&gt;</description>
			</item>
			<item>
				<title>Getting Started With DOM, XOM, DOM4J by Parsing an RSS Feed - An Experience Review</title>
				<link>https://31416.org/post/getting-started-with-dom-xom-dom4j-by-parsing-an-rss-feed---an-experience-review/</link>
				<pubDate>Fri, 17 Mar 2006 10:53:00 +0000</pubDate>
				<guid>https://31416.org/post/getting-started-with-dom-xom-dom4j-by-parsing-an-rss-feed---an-experience-review/</guid>
				<description>Recently, I looked for a way to get info from some particular blog entries of mine on &lt;a href=&#34;http://blogger.com&#34;&gt;blogger.com&lt;/a&gt;. Blogger used to offer an  &lt;a href=&#34;http://www.blogger.com/developers/api/1_docs/&#34;&gt;XML-RPC API &lt;/a&gt;. They even designed a &lt;a href=&#34;http://www.blogger.com/developers/api/documentation20.html&#34;&gt;version 2&lt;/a&gt;  of the XML-RPC API that does not seem to have ever been put in production. Or maybe I did not manage to make it work. I had no problem to make v1 work, however. I used apache XMLRPC v2, it was very simple to use. Unfortunately information accessible through XML-RPC Blogger API was incomplete for me. Furthermore, it is very likely that this API will disappear soon as it is deprecated since 2002.&lt;br /&gt;&lt;br /&gt;Blogger wants you to use their &lt;a href=&#34;http://code.blogger.com/archives/atom-docs.html&#34;&gt;Atom API&lt;/a&gt;. It is not XML RPC anymore, you have to do the parsing by hand.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;The DOM Experience &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I thought &#34;no big deal, I will use DOM for it&#34;. I don&#39;t need performance and wanted a quick way to solve my problem, plus DOM does not require X number of libraries. It was easy to use regular DOM until I was frustrated by not being able to get the  &lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;&amp;lt;content&amp;gt;&lt;/span&gt; element full text easily as it is sometimes XML. I did not want to hand code a method to do that as I thought it should be done by the XML library.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;The XOM Experience&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I heard previously of a simple XML parser, efficient, with an API that had been well designed, XOM. I looked at the API, there was a toXML&lt;span style=&#34;font-family:courier new,monospace;&#34;&gt; ()&lt;/span&gt; method to return the node content as XML (children included), sounded good. I saw there was even XPath support, and thought, great, it will simplify my code a bit. I will get the blog entries by just querying for &#34; &lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;/feed/entry&lt;/span&gt;&#34;. No luck, it did not work, it returned 0 results. So I looked for mistakes in my code, did not find obvious ones. I tried other queries like &#34; &lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;//feed/entry&lt;/span&gt;&#34; or &#34;&lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;//entry&lt;/span&gt;&#34;, same thing, not the right results. There must have been something wrong in my code, or maybe the XPath engine in XOM has particular settings to deal with RSS feeds (they contain various xmlns declarations). The point is that I got frustrated, it was supposed to be very simple, and in reality, not so!&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;The DOM4J Experience&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I had experience with Dom4j before, just once, to build XML, not to parse it. I had relatively good memories of my Dom4j experience for that so I decided to try it out on my problem. At first I found Dom4j API a bit confusing as there are so many methods on most used classes. This is because Dom4j is DOM compatible. But I quickly understand the logic of it and found some very useful methods, namely  &lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;Element.elements(name)&lt;/span&gt; to get all children elements by name. Of course, they have an asXML&lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;()&lt;/span&gt; method like XOM. There is also XPath support.&lt;br /&gt;I tried the XPath on Blogger RSS without success again. There really must be a trick to get it to recognize RSS. But with the &lt;span style=&#34;font-family:courier new,monospace;&#34;&gt;elements(&#34;entry&#34;)&lt;/span&gt; method, I very quickly got the same with not much more code, and it worked.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;so DOM vs. XOM vs. DOM4J = 0 - 0 - 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Example Code:&lt;pre&gt;&lt;br /&gt;&lt;font color=&#34;#4682b4&#34;&gt;SAXReader&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;reader&lt;/font&gt; = &lt;font color=&#34;#ff0000&#34;&gt;new&lt;/font&gt; &lt;font color=&#34;#4682b4&#34;&gt;SAXReader&lt;/font&gt;();&lt;br /&gt;&lt;font color=&#34;#4682b4&#34;&gt;Document&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;doc&lt;/font&gt; = reader.read(response);&lt;br /&gt;&lt;font color=&#34;#4682b4&#34;&gt;Collection&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;posts&lt;/font&gt; = &lt;font color=&#34;#ff0000&#34;&gt;new&lt;/font&gt; &lt;font color=&#34;#4682b4&#34;&gt;ArrayList&lt;/font&gt;();&lt;br /&gt;&lt;font color=&#34;#4682b4&#34;&gt;List&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;entries&lt;/font&gt; = doc.getRootElement().elements(&#34;&lt;font color=&#34;#008b00&#34;&gt;entry&lt;/font&gt;&#34;);&lt;br /&gt;&lt;font color=&#34;#ff0000&#34;&gt;if&lt;/font&gt; (LOG.isDebugEnabled()) &lt;br /&gt;{&lt;br /&gt;        LOG.debug(&#34;&lt;font color=&#34;#008b00&#34;&gt;found &lt;/font&gt;&#34;+entries.size()+&#34;&lt;font color=&#34;#008b00&#34;&gt; entries&lt;/font&gt;&#34;);&lt;br /&gt;}&lt;br /&gt;&lt;font color=&#34;#ff0000&#34;&gt;for&lt;/font&gt; (&lt;font color=&#34;#4682b4&#34;&gt;int&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;i&lt;/font&gt; = 0; i &amp;lt;entries.size();i++)&lt;br /&gt;{&lt;br /&gt;        &lt;font color=&#34;#4682b4&#34;&gt;Element&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;entry&lt;/font&gt; = (&lt;font color=&#34;#4682b4&#34;&gt;Element&lt;/font&gt;) entries.get(i); &lt;br /&gt;        &lt;font color=&#34;#4682b4&#34;&gt;Map&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;m&lt;/font&gt; = &lt;font color=&#34;#ff0000&#34;&gt;new&lt;/font&gt; &lt;font color=&#34;#4682b4&#34;&gt;HashMap&lt;/font&gt;();&lt;br /&gt;        &lt;font color=&#34;#ff0000&#34;&gt;for&lt;/font&gt; (&lt;font color=&#34;#4682b4&#34;&gt;Iterator&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;it&lt;/font&gt; = entry.elementIterator();it.hasNext();)&lt;br /&gt;        {&lt;br /&gt;                &lt;font color=&#34;#4682b4&#34;&gt;Element&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;detail&lt;/font&gt; = (&lt;font color=&#34;#4682b4&#34;&gt;Element&lt;/font&gt;) it.next();&lt;br /&gt;                &lt;font color=&#34;#4682b4&#34;&gt;String&lt;/font&gt; &lt;font color=&#34;#8b008b&#34;&gt;name&lt;/font&gt; = detail.getName();&lt;br /&gt;                &lt;font color=&#34;#ff0000&#34;&gt;if&lt;/font&gt; (name.equals(&#34;&lt;font color=&#34;#008b00&#34;&gt;link&lt;/font&gt;&#34;))&lt;br /&gt;                {&lt;br /&gt;                        m.put(&#34;&lt;font color=&#34;#008b00&#34;&gt;link&lt;/font&gt;&#34;,detail.attribute(&#34;&lt;font color=&#34;#008b00&#34;&gt;href&lt;/font&gt;&#34;).getValue());&lt;br /&gt;                }&lt;br /&gt;                &lt;font color=&#34;#ff0000&#34;&gt;else&lt;/font&gt; &lt;font color=&#34;#ff0000&#34;&gt;if&lt;/font&gt; (name.equals(&#34;&lt;font color=&#34;#008b00&#34;&gt;content&lt;/font&gt;&#34;))&lt;br /&gt;                {&lt;br /&gt;                        m.put(&#34;&lt;font color=&#34;#008b00&#34;&gt;content&lt;/font&gt;&#34;,detail.asXML());&lt;br /&gt;                }&lt;br /&gt;                &lt;font color=&#34;#ff0000&#34;&gt;else&lt;/font&gt;&lt;br /&gt;                {&lt;br /&gt;                        m.put(name,detail.getTextTrim());&lt;br /&gt;                }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        posts.add(m);                   &lt;br /&gt;        &lt;font color=&#34;#ff0000&#34;&gt;if&lt;/font&gt; (LOG.isDebugEnabled())&lt;br /&gt;        {&lt;br /&gt;                LOG.debug(&#34;&lt;font color=&#34;#008b00&#34;&gt;found=&lt;/font&gt;&#34;+m.get(&#34;&lt;font color=&#34;#008b00&#34;&gt;title&lt;/font&gt;&#34;)+&#34;&lt;font color=&#34;#008b00&#34;&gt;, url=&lt;/font&gt;&#34;+m.get(&#34;&lt;font color=&#34;#008b00&#34;&gt;link&lt;/font&gt;&#34;));&lt;br /&gt;        }&lt;br /&gt;}&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Bad JDK Design Example</title>
				<link>https://31416.org/post/bad-jdk-design-example/</link>
				<pubDate>Thu, 16 Mar 2006 15:02:00 +0000</pubDate>
				<guid>https://31416.org/post/bad-jdk-design-example/</guid>
				<description>&lt;p&gt;Have you ever used the Authenticator class? It is standard since JDK 1.2. This allows you to establish authenticated HTTP requests. OnJava has an in-depth &lt;a href=&#34;http://www.onjava.com/pub/a/onjava/excerpt/jvntwkprg_3e/?page=4&#34;&gt;article presenting it&lt;/a&gt;. Now here is my story about it.&lt;/p&gt;&#xA;&lt;p&gt;The other day I just wanted to do that a simple authenticated HTTP request. You would expect it to be very simple to do in the modern internet world.&lt;/p&gt;&#xA;&lt;p&gt;It is actually not very difficult to do, by hand, a &lt;a href=&#34;http://www.javaworld.com/javaworld/javatips/jw-javatip47.html&#34;&gt;JavaWorld article&lt;/a&gt;  presents this way. Unfortunately it uses internal JDK sun classes for Digest and I am uncomfortable to use that since it is not guaranteed to work on any JVM. So I have to download jakarta commons-codec to just do a simple authenticated HTTP request. I really wonder why some of those codecs are not in the JDK (not as sun.* classes but as java.* classes).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Current Popular Subjects In Java Blogs</title>
				<link>https://31416.org/post/current-popular-subjects-in-java-blogs/</link>
				<pubDate>Wed, 15 Mar 2006 20:00:00 +0000</pubDate>
				<guid>https://31416.org/post/current-popular-subjects-in-java-blogs/</guid>
				<description>&lt;p&gt;Based on my blogs entries and success of other blog entries, I present the current trendy subjects and the not trendy ones:&lt;/p&gt;&#xA;&lt;p&gt;In:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Design Patterns&lt;/li&gt;&#xA;&lt;li&gt;Ruby on Rails&lt;/li&gt;&#xA;&lt;li&gt;EJB (bashing)&lt;/li&gt;&#xA;&lt;li&gt;RSS&lt;/li&gt;&#xA;&lt;li&gt;Spring&lt;/li&gt;&#xA;&lt;li&gt;Hibernate&lt;/li&gt;&#xA;&lt;li&gt;Javascript and AJAX&lt;/li&gt;&#xA;&lt;li&gt;Java Virtual Machine&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Out:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;RMI&lt;/li&gt;&#xA;&lt;li&gt;Portal&lt;/li&gt;&#xA;&lt;li&gt;Jini&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Neutral&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;JDK 5 features&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As you can see most of the popular stuff is fairly common, not that new. I will do a finer, less common, analysis later if I have time.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Non Fiction Books (Mostly Software Programming) Before 2003</title>
				<link>https://31416.org/post/non-fiction-books-mostly-software-programming-before-2003/</link>
				<pubDate>Wed, 15 Mar 2006 15:03:00 +0000</pubDate>
				<guid>https://31416.org/post/non-fiction-books-mostly-software-programming-before-2003/</guid>
				<description>A page with useful reference for me as I don&#39;t own each one of these books. It can provides you a very short review non-commercial biased.&lt;br /&gt;&lt;p class=&#34;dateheader&#34;&gt;&lt;span style=&#34;color: rgb(0, 153, 0);&#34;&gt;2003&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&#34;font-style: italic;&#34;&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Programming Jakarta Struts&lt;/span&gt; &lt;/span&gt;(O&#39;Reilly - Chuck Cavaness) much better than Manning book. Explains struts very clearly with a more interesting example. Not enough  on how to design your application for use with the evil ActionForm. Almost nothing on Struts 1.1 features. Nothing on common problems encountered while building web applications, or even about on how to design them using struts.&lt;/li&gt; &lt;li&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;Struts In Action&lt;/span&gt; (Manning) not much more about struts than what&#39;s available on struts website. Their example throughout the book is the same login example. Struts 1.1 features, esp DynaForm are mentioned but not really presented. On the positive side, there is a very useful Validator reference at the end and a too short mention of different strategies for the ActionForm.&lt;/li&gt;&lt;li&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;Contributing to Eclipse&lt;/span&gt; (Kent Beck - Erich Gamma) funny little drawings inside to make some good points.&lt;/li&gt;&lt;li&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;The Design Patterns Java Companion&lt;/span&gt;(Adison Wesley - James W. Cooper) A must read for clean swing development. Essencial design patterns inside. Nice tip about doing deep cloning in java.&lt;/li&gt;&lt;li&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;Java Threads&lt;/span&gt; (O&#39;Reilly - Scott Oaks and Henry Wong) very clear presentation of multithreading programming in Java. Explain how to write your own thread scheduler.&lt;/li&gt;&lt;li&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;J2EE expert one on one &lt;/span&gt;(Wrox) pragmatic view of J2EE. Many interesting comments like why avoiding stateful session bean if you are a little bit concerned with performance. Some strange benchmarks at the end of the book showing velocity templates being 10x faster than JSPs.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;Java Distributed Computing&lt;/span&gt;(O&#39;Reilly - Jim Farley) very good to learn more about RMI because it starts with a custom distributed object system.&lt;/li&gt; &lt;li&gt;&lt;a name=&#34;Java Enterprise in a Nutshell&#34;&gt;&lt;/a&gt; &lt;div class=&#34;booktitle&#34;&gt;&lt;span style=&#34;font-weight: bold; font-style: italic;&#34;&gt;Java Enterprise in a Nutshell &lt;/span&gt;(O&#39; Reilly - David Flanagan, Jim Farley, William Crawford, and Kris Magnusson) good complementary book, provides a good basis. I liked how RMI use in EJBs was detailed, Servlet chapter is also excellent (but don&#39;t look for design tips/help in it - it is a book on the BASICS).&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class=&#34;booktitle&#34;&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;Enterprise Javabeans, second edition&lt;/span&gt; (O&#39;Reilly - Richard Monson-Haefel) second lecture made me better appreciate that book, contains a lot of fundamental concepts to know. Very detailed on transaction management. However there is nothing I remember in it about EJB restrictions. In short incomplete but not bad.&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div class=&#34;booktitle&#34;&gt;&lt;span style=&#34;font-style: italic; font-weight: bold;&#34;&gt;Structure And Interpretation Of Computer Programs&lt;/span&gt; (MIT Press)&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&#34;dateheader&#34;&gt;&lt;span style=&#34;color: rgb(0, 153, 0);&#34;&gt;2002&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>How Mac Os X Made Me Discover a Bug in my Java Prog</title>
				<link>https://31416.org/post/how-mac-os-x-made-me-discover-a-bug-in-my-java-prog/</link>
				<pubDate>Tue, 14 Mar 2006 20:15:00 +0000</pubDate>
				<guid>https://31416.org/post/how-mac-os-x-made-me-discover-a-bug-in-my-java-prog/</guid>
				<description>&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://photos1.blogger.com/blogger/6384/1303/1600/Image%201.jpg&#34;&gt;&lt;img style=&#34;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&#34; src=&#34;http://photos1.blogger.com/blogger/6384/1303/400/Image%201.jpg&#34; border=&#34;0&#34; alt=&#34;benham disc screenshot&#34; /&gt;&lt;/a&gt;&lt;br /&gt;Yesterday I had some free time to finally find out why MacOs X would not display my little applet properly. I checked various JDKs for MacOs, no difference. I checked if it was due to antialiasing use, no luck. I actually found out there was an error in the way I displayed images. I did not call repaint() between each image change. Strangely, it worked fine on Windows with many JDKs. Anyway now my  &lt;a href=&#34;http://31416.org/info/benham.html&#34; target=&#34;_blank&#34; onclick=&#34;return top.js.OpenExtLink(window,event,this)&#34;&gt;Benham Disc Applet&lt;/a&gt; is working on Apple computers as well.&lt;br&gt;&lt;br&gt;</description>
			</item>
			<item>
				<title>Del.icio.us Firefox Toolbar Update</title>
				<link>https://31416.org/post/del.icio.us-firefox-toolbar-update/</link>
				<pubDate>Mon, 13 Mar 2006 19:45:00 +0000</pubDate>
				<guid>https://31416.org/post/del.icio.us-firefox-toolbar-update/</guid>
				<description>I updated my little &lt;a href=&#34;http://31416.org/deltoolbar.html&#34;&gt;delicious toolbar&lt;/a&gt; that provides autosave feature for me. I did not bother reworking the new &lt;a href=&#34;http://del.icio.us&#34;&gt;delicious&lt;/a&gt; extension as I don&#39;t use its new functionalities. However people are free to do so if they want with the code from this toolbar.&lt;br /&gt;&lt;br /&gt;&lt;img alt=&#34;deltoolbar screenshot&#34; src=&#34;http://photos1.blogger.com/blogger/6384/1303/320/deltoolbar_.jpg&#34; height=&#34;403&#34; width=&#34;486&#34; /&gt;&lt;br /&gt;&lt;br /&gt;With Firefox 1.5, display of saved documents was not working properly anymore due to a change in Firefox handling of security permissions to view local files. It is fixed now.&lt;br /&gt;&lt;span class=&#34;technoratitag&#34;&gt;Tags: &lt;a href=&#34;http://del.icio.us/tag/delicious&#34; rel=&#34;tag&#34;&gt;delicious&lt;/a&gt;, &lt;a href=&#34;http://del.icio.us/tag/toolbar&#34; rel=&#34;tag&#34;&gt;toolbar&lt;/a&gt;, &lt;a href=&#34;http://del.icio.us/tag/extension&#34; rel=&#34;tag&#34;&gt;extension&lt;/a&gt;, &lt;a href=&#34;http://del.icio.us/tag/firefox&#34; rel=&#34;tag&#34;&gt;firefox&lt;/a&gt;&lt;/span&gt;</description>
			</item>
			<item>
				<title>Why did Netscape choose Javascript?!?</title>
				<link>https://31416.org/post/why-did-netscape-choose-javascript/</link>
				<pubDate>Thu, 09 Mar 2006 17:10:00 +0000</pubDate>
				<guid>https://31416.org/post/why-did-netscape-choose-javascript/</guid>
				<description>&lt;p&gt;Last year, I have helped building an AJAX web application, where the web client was composed of only one web page and tons of javascript. The 1 web page for a site approach is similar to Gmail and many full AJAX sites. This approach looks quite elegant. Using JSON (and JSON templates) we were able to separated fully presentation logic and business logic and componentization seemed to occur naturally.&lt;/p&gt;&#xA;&lt;p&gt;But I remember how often I complained on how bad Javascript was to code. I find it does not encourage good practices at all. The object orientation of Javascript is really a pain to use. If I had not a small experience with  &lt;a href=&#34;http://python.org&#34;&gt;Python&lt;/a&gt; before, I would have thought scripting languages were really bad at building applications, even not so big ones. I find that even for good programmers, Javascript is a challenge, as it seems to always be a struggle to organize properly your code with it.&lt;/p&gt;</description>
			</item>
			<item>
				<title>New Mac Mini</title>
				<link>https://31416.org/post/new-mac-mini/</link>
				<pubDate>Tue, 07 Mar 2006 20:51:00 +0000</pubDate>
				<guid>https://31416.org/post/new-mac-mini/</guid>
				<description>&lt;div style=&#34;text-align: left;&#34;&gt;&lt;div style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://photos1.blogger.com/blogger/6384/1303/1024/IMG_20060307_0004.jpg&#34;&gt;&lt;img style=&#34;display: block; text-align: center;&#34; alt=&#34;&#34; src=&#34;http://photos1.blogger.com/blogger/6384/1303/400/IMG_20060307_0004.jpg&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;Here is my new Mac Mini Core Solo. I am quite happy with it since it is very quiet. It makes a good jukebox/movie/server machine. Apple was very quick in shipping it (2 days)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;However I was a bit disappointed by iPhoto 6, it is not as nice as Picasa to sort out pictures (no IPTC support). I did not try Java on it yet. I just found out my little Benham circle applet was not working properly on it. &lt;a href=&#34;http://picasa.google.com/blogger/&#34; target=&#34;ext&#34;&gt;&lt;img src=&#34;http://photos1.blogger.com/pbp.gif&#34; alt=&#34;Posted by Picasa&#34; style=&#34;border: 0px none ; padding: 0px; background: transparent none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;&#34; align=&#34;middle&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;</description>
			</item>
			<item>
				<title>Features That Ruby Lacks and Java Has</title>
				<link>https://31416.org/post/features-that-ruby-lacks-and-java-has/</link>
				<pubDate>Fri, 10 Feb 2006 15:57:00 +0000</pubDate>
				<guid>https://31416.org/post/features-that-ruby-lacks-and-java-has/</guid>
				<description>Bertrand Meyer describes in his book &lt;a href=&#34;http://www.amazon.com/exec/obidos/redirect?link_code=as2&amp;amp;path=ASIN/0136291554&amp;amp;tag=michelin-20&amp;amp;camp=1789&amp;amp;creative=9325%22&#34;&gt;&amp;quot;&lt;span style=&#34;font-style: italic;&#34;&gt; Object Oriented Software Construction (2nd Ed)&lt;/span&gt;&amp;quot;&lt;/a&gt; qualities that a good object oriented language should have. Java has almost all the features. Ruby is much farther off, which does not mean it is not a good language, I think it&#39;s very good to write some types of programs quickly (should I call them scripts?), syntax is quite nice, but it does lack the following useful features: &lt;br&gt;&lt;ul&gt;&lt;li&gt;Assertions:&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;The language should make it possible to equip a class and its features with assertions (preconditions, postconditions and invariants), relying on tools to produce documentation out of these assertions and, optionally, monitor them at run time.&amp;nbsp; &lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Information Hiding (Java is not good either on that one, the protected keyword is of dubious value):&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;  It should be possible for the author of a class to specify that a feature is available to all clients, to no client, or to specified clients&lt;br&gt;&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Static Typing:&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;  A well-defined type system should, by enforcing a number of type declaration and compatibility rules, guarantee the run-time type safety of the systems it accepts.&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Genericity:&lt;blockquote style=&#34;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&#34; class=&#34;gmail_quote&#34;&gt;  It should be possible to write classes with formal generic parameters representing arbitrary types.&amp;nbsp;&lt;/blockquote&gt;&lt;/li&gt;&lt;/ul&gt;More pragmatically, library choice and performance difference between Java and Ruby might be the most decisive. &lt;br&gt;&lt;br /&gt;&lt;span class=&#34;technoratitag&#34;&gt;Tags: &lt;a target=_top href=&#34;http://del.icio.us/tag/book&#34; rel=&#34;tag&#34;&gt;book&lt;/a&gt; &lt;a target=_top href=&#34;http://del.icio.us/tag/review&#34; rel=&#34;tag&#34;&gt;review&lt;/a&gt;</description>
			</item>
			<item>
				<title>What Is &#39;Modern&#39; Java Compilation?</title>
				<link>https://31416.org/post/what-is-modern-java-compilation/</link>
				<pubDate>Tue, 07 Feb 2006 11:12:00 +0000</pubDate>
				<guid>https://31416.org/post/what-is-modern-java-compilation/</guid>
				<description>&lt;span class=&#34;gmail_quote&#34;&gt;&lt;/span&gt;Occasionally in &lt;a href=&#34;http://ant.apache.org&#34; target=&#34;_blank&#34; onclick=&#34;return top.js.OpenExtLink(window,event,this)&#34;&gt;Ant&lt;/a&gt; you can see messages like this:&lt;br&gt;&lt;span style=&#34;background-color: rgb(255, 204, 0);&#34;&gt; &amp;quot;&lt;/span&gt;&lt;font size=&#34;-1&#34;&gt;&lt;span style=&#34;background-color: rgb(255, 204, 0);&#34;&gt;[javac] &lt;/span&gt;&lt;b style=&#34;background-color: rgb(255, 204, 0);&#34;&gt;Using modern compiler&lt;/b&gt;&lt;span style=&#34;background-color: rgb(255, 204, 0);&#34;&gt;&amp;quot; &lt;/span&gt;&lt;br&gt;&lt;br&gt;What does this mean? &lt;br&gt;&lt;br&gt;&lt;/font&gt;&lt;div style=&#34;text-align: left;&#34;&gt;&lt;font size=&#34;-1&#34;&gt;In Ant you have the property &amp;quot; &lt;span style=&#34;font-weight: bold;&#34;&gt;build.compiler&lt;/span&gt;&amp;quot; to specify if you want to use a classic or modern compiler. Now what do they mean by modern or classic. Well, they call classic compiler the compilers of JDK 1.1   and 1.2 and they call modern compiler the ones of JDK 1.3+. They made that distinction because a classic compiler does not support the same options as modern compilers: the semantics of javac tool changed in JDK 1.3.&lt;/font&gt; &lt;br&gt;&lt;/div&gt;&lt;font size=&#34;-1&#34;&gt; &lt;br&gt;This terminology can easily be confused with java class file compatibility. Java class file compatibility is changed using the &amp;quot;&lt;span style=&#34;font-weight: bold;&#34;&gt;-target&lt;/span&gt;&amp;quot; option of javac tool. One can specify in ant to compile with modern compilers and a target  1.4, the result is likely to not run on JVM 1.3. One can specify modern and a target 1.1, the resulting classes will run on JVM 1.1, but ant build.xml file will not be usable with JDK 1.1 without changing modern to classic. &lt;br&gt;&lt;br&gt;I find Ant choice of word a bit confusing as using a &amp;quot;modern&amp;quot; compiler has little to do with the resulting class files.&lt;br&gt;&lt;/font&gt;</description>
			</item>
			<item>
				<title>RMI Nightmares - Non Interoperability</title>
				<link>https://31416.org/post/rmi-nightmares---non-interoperability/</link>
				<pubDate>Tue, 31 Jan 2006 18:39:00 +0000</pubDate>
				<guid>https://31416.org/post/rmi-nightmares---non-interoperability/</guid>
				<description>These days we tried to make Websphere and &lt;a href=&#34;http://jonas.objectweb.org&#34;&gt;Jonas&lt;/a&gt; interoperate. Some EJBs are deployed in Jonas and we just try to call them from Websphere. The most natural way is to use RMI (with JRMP) for that. Jonas uses  JDK1.4.2 (conforms to J2EE 1.4) and Websphere IBM JVM 1.3.1 (conforms to J2EE 1.3). Because of RMI serialization, an EJB from Jonas will not work on Websphere, because this EJB has references to J2EE 1.4 classes which are different from J2EE  1.3. The exact root cause is not exactly clear to me, it probably has to do with the Naming Factory and the EJB Stub, but we tried every possible thing here without success.&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Update: &lt;/span&gt;JRMP worked between JBoss 3.X on JDK 1.4 and Websphere 5.X (IBM JDK 1.3) using JBoss NamingFactory. So RMI interoperation seems quite unpredictable. One thing is that you have to pay attention to the naming factory you use. If it is a special library like in JBoss case, make sure it is compatible with your JDK.&lt;br /&gt;&lt;br /&gt;One solution is to use RMI-IIOP, as it does not rely on serialization. It almost works. In our case we use Websphere Portal that needs to have security enabled. You might ask what security has to do with all that. Well, enabling security on websphere means that CORBA exchange will also be secured (using CSIv2). Tuning Jonas to understand what websphere asks is something we did not manage to do (and we don&#39;t know if it is possible at all).&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Update: &lt;/span&gt;We did manage to make it work by disabling Jonas CSIv2 support.&lt;br /&gt;&lt;br /&gt;So there we are using Axis to do the communication!&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Update: &lt;/span&gt;Axis is not needed anymore  as RMI-IIOP works as advertised.&lt;br /&gt;&lt;br /&gt;There is an interesting &lt;a href=&#34;http://www.lifl.fr/%7Emerle/benchmarking.pdf&#34;&gt;benchmark of Axis vs JRMP vs RMI-IIOP (pdf)&lt;/a&gt;. Axis is more than 10x slower than pure JRMP. Application servers use of JRMP seems to matter a lot, JBoss looks bad.</description>
			</item>
			<item>
				<title>What Is Clustering About – An answer to Spring is not designed for scalability</title>
				<link>https://31416.org/post/what-is-clustering-about--an-answer-to-spring-is-not-designed-for-scalability/</link>
				<pubDate>Mon, 16 Jan 2006 16:57:00 +0000</pubDate>
				<guid>https://31416.org/post/what-is-clustering-about--an-answer-to-spring-is-not-designed-for-scalability/</guid>
				<description>&lt;p&gt;I wanted to reply to &lt;a href=&#34;http://www.diegoparrilla.com/2006/01/spring-is-not-designed-for-scalability.html&#34;&gt;Diego Parilla post about scalability&lt;/a&gt;, but my reply ended up being too long not to post it over here. I don&amp;rsquo;t know if I am the only one here but I don&amp;rsquo;t fully understand his post and arguments.&lt;/p&gt;&#xA;&lt;p&gt;Clustering the web server and clustering the model are just two parts of clustering, not exclusive.&lt;/p&gt;&#xA;&lt;p&gt;In a LAMP application, clustering the model is traditionally done by clustering the DB (MySQL) which is a no brainer. Clustering the web server does not always implies sharing the &amp;ldquo;HTTP session&amp;rdquo;. For example you can limit yourself to use cookies. For many web apps this works well.&lt;/p&gt;</description>
			</item>
			<item>
				<title>My Dream Job</title>
				<link>https://31416.org/post/my-dream-job/</link>
				<pubDate>Thu, 12 Jan 2006 11:42:00 +0000</pubDate>
				<guid>https://31416.org/post/my-dream-job/</guid>
				<description>&lt;img src=&#34;file:///C:/Documents%20and%20Settings/flh/Mes%20documents/MSwanson%20-%20Leaf%2002.png&#34; alt=&#34;&#34;&gt;&lt;br&gt; In my dream job, I would have &lt;span style=&#34;font-weight: bold;&#34;&gt;freedom &lt;/span&gt;to play with and build software based on new ideas I have.&lt;br&gt;  In my dream job, I would work with &lt;span style=&#34;font-weight: bold;&#34;&gt;creative &lt;/span&gt;people, luminaries.&lt;br&gt;  In my dream job, I would have a good enough salary.&lt;br&gt;  In my dream job, I would not have to worry about the company &lt;span style=&#34;font-weight: bold;&#34;&gt;stability&lt;/span&gt;.&lt;br&gt;  In my dream job, I would have freedom in my work schedule.&lt;br&gt;  &lt;br&gt;  Get &lt;span style=&#34;font-weight: bold;&#34;&gt;paid &lt;/span&gt;for doing what you really want (i.e. your ideas) is possible. But without worrying about the next 6 months, I have not seen that.</description>
			</item>
			<item>
				<title>Ogg better than MPC and MP3 - AAC crap</title>
				<link>https://31416.org/post/ogg-better-than-mpc-and-mp3---aac-crap/</link>
				<pubDate>Wed, 04 Jan 2006 11:47:00 +0000</pubDate>
				<guid>https://31416.org/post/ogg-better-than-mpc-and-mp3---aac-crap/</guid>
				<description>&lt;p&gt;The &lt;a href=&#34;http://www.hydrogenaudio.org/forums/index.php?showtopic=36465&#34;&gt;latest well done (e.g. blind) listening test&lt;/a&gt; comparing Ogg, MPC, MP3, AAC at about 180kbps shows that Ogg is superior to all other compressing formats. It&amp;rsquo;s not that easy to find relevant tests. Many people claim to be able to notice huge differences between CD and MP3 and yet, but confronted to a blind listening test, they are very surprised how difficult it actually is. Hydrogenaudio has a good community of audiophiles.&lt;/p&gt;</description>
			</item>
			<item>
				<title>What&#39;s Your Favorite Design Pattern</title>
				<link>https://31416.org/post/whats-your-favorite-design-pattern/</link>
				<pubDate>Tue, 27 Dec 2005 12:18:00 +0000</pubDate>
				<guid>https://31416.org/post/whats-your-favorite-design-pattern/</guid>
				<description>&lt;p&gt;Once in a job interview, someone asked me&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;What&amp;rsquo;s your favorite design pattern?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I was first surprised at the question. Usually a design pattern is about solving a problem not about a personal preference. I wondered if it was a trick question of some sorts. I was hesitating with my answer and asked more about the meaning of the question. I just had to really give the pattern I liked the most! I really should not have but I ended up pleasing my interviewer and said &amp;ldquo;the decorator pattern&amp;rdquo;. At least its name is somehow related to arts.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Professional Portal Development Book Review</title>
				<link>https://31416.org/post/professional-portal-development-book-review/</link>
				<pubDate>Tue, 27 Dec 2005 12:08:00 +0000</pubDate>
				<guid>https://31416.org/post/professional-portal-development-book-review/</guid>
				<description>&lt;p&gt;I just finished reading &lt;em&gt;Professional Portal Development With Open Source Tools&lt;/em&gt; (Wiley).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The Good:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I enjoyed Chapter 1, it gives a good presentation of Portlets for someone who does not know much about it. It is a chapter one can use as a reference to verify some specific details of how Portlets are working. It is a bit similar to JSR 168 specifications, but I found it more detailed and well written.&lt;/p&gt;</description>
			</item>
			<item>
				<title>IBM Websphere Portal Strategy</title>
				<link>https://31416.org/post/ibm-websphere-portal-strategy/</link>
				<pubDate>Wed, 07 Dec 2005 17:48:00 +0000</pubDate>
				<guid>https://31416.org/post/ibm-websphere-portal-strategy/</guid>
				<description>&lt;p&gt;I digged a bit deeper in a current project where they use IBM Websphere Portal Server (WPS) with IBM Web Content Management (WCM). I found out that both products collide and disintegrate.&lt;/p&gt;&#xA;&lt;p&gt;WCM is like a regular content management system, quite flexible and performant on its own. It has a nice way to separate layout concern from content concern. It has a flexible cache. It has a user repository to set different permissions. Its architecture is even so well done (very modular) that you can tailor it to your needs to do things a content management system is not supposed to do. It could do most of what you would do with a Portal system. And that&amp;rsquo;s the problem.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Portlets in an AJAX World</title>
				<link>https://31416.org/post/portlets-in-an-ajax-world/</link>
				<pubDate>Tue, 29 Nov 2005 16:29:00 +0000</pubDate>
				<guid>https://31416.org/post/portlets-in-an-ajax-world/</guid>
				<description>Recently, I have had my first encounter with &lt;a href=&#34;http://developers.sun.com/prodtech/portalserver/reference/techart/jsr168/&#34;&gt;Portlets&lt;/a&gt; although Portlets are not very new. IBM had their own Portlet API before the JSR 168 was final in 2003. Unfortunately both approaches are quite different and IBM does not recommend the use of their own API.&lt;br&gt; &lt;br&gt; Portlets were a needed concept for a long time. I worked in 2000 on a java portal system and it would have been handy at that time. Portals are everywhere since the internet bubble. &lt;br&gt; &lt;br&gt; But Portlets do not do that much either. Sites designed with strict and intelligent rules can bypass the portlets need for example by using a combination of custom tags and java beans.&lt;br&gt; &lt;br&gt; What shocks me a bit more is that while not doing much, it looks a bit old fashioned already. With AJAX you could build very flexible and user-friendly Portlets replacement. This AJAX-let is actually probably what Microsoft has already done on their &lt;a href=&#34;http://www.start.com/&#34;&gt;start.com&lt;/a&gt; web site. Now with AJAX, I just wish Javascript would evolve (a lot) or die to be more OO friendly.</description>
			</item>
			<item>
				<title>Good Software Books</title>
				<link>https://31416.org/post/good-software-books/</link>
				<pubDate>Thu, 17 Nov 2005 21:24:00 +0000</pubDate>
				<guid>https://31416.org/post/good-software-books/</guid>
				<description>A friend asked me for a list, here is it. I found those books the most interesting ones among those I have read about software in the past year or two:&lt;br&gt; &lt;ul&gt;   &lt;li&gt;&lt;i&gt;Artificial Intelligence through Prolog&lt;/i&gt;, by Neil C. Rowe (Prentice-Hall): if you don&#39;t remember much about Prolog, it&#39;s a good book. It details how Prolog interpreters work.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;File Systems Forensic Analysis, &lt;/i&gt;by Brian Carrier (Addison Wesley): everything you need to know about disks and file systems, every trick to recover lost data. To go more in depth into file systems theory, you can read the free &lt;i&gt;&lt;a  href=&#34;http://www.nobius.org/%7Edbg/&#34;&gt;Practical File System Design with the Be File System&lt;/a&gt; &lt;/i&gt;from D. Giampaolo, the creator of BeFS.&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Mind Hacks &lt;/i&gt;(O&#39;Reilly): you probably already bought that one. Not about software, but excellent.&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Practical Issues in Database Management&lt;/i&gt; by Fabian Pascal (Addison Wesley): short but concise book on relational database theory. F Pascal is of CJ Date school of thoughts, &#34;null are evil&#34;. You don&#39;t need to read it if you have read any other similar book (by CJ Date for example).&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;&lt;i&gt;Inside The Java Virtual Machine,&lt;/i&gt; by Bill Venners (McGraw-Hill): there are other books on the same subject. While this book has some bad reviews, I found it an easy read, and it explain well enough for me all the inner details of Java. I found &#34;Programming for the Java Virtual Machine&#34; not better, and with some bad example of a Prolog language for the JVM (1 full chapter for this to present a way too simple thing to be of any use).&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Programming Jabber&lt;/i&gt;, by O&#39;Reilly: I have read it 2 years ago, I enjoyed how they made you go through building a Jabber server.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Lucene In Action&lt;/i&gt;: the only book about Lucene, some of the info is useful to understand how it is designed.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Hibernate In Action:&lt;/i&gt; if you have to use hibernate, this is the book to read. It presents different ways of using it.&lt;/li&gt;   &lt;li&gt;some Javascript+DHTML(+CSS) book: useful if you have none. They often have good tricks to solve the usual problems. In the AJAX days, it becomes useful again. I find O&#39;Reilly&#39;s &#34;&lt;i&gt;Javascript - The Definitive Guide&lt;/i&gt;&#34; good to have an API reference (as ebook), and &#34;&lt;i&gt;Javascript and DHTML Cookbook&lt;/i&gt;&#34; has the most useful recipes.&lt;/li&gt;   &lt;li&gt;&lt;i&gt;Lean Software Development &lt;/i&gt;by Poppendieck (Addison Wesley): easy to read, good presentation of software dev management problems and pragmatic solutions. My favorite on the subject. Another good one but very specific is &#34;&lt;i&gt;Requirements Management&lt;/i&gt;&#34; (MS Press).&lt;/li&gt;   &lt;li&gt;&lt;i&gt;UML Distilled &lt;/i&gt;by M Fowler: always useful to have if you need to draw UML diagrams.&lt;/li&gt; &lt;/ul&gt; &lt;br&gt; Good luck!</description>
			</item>
			<item>
				<title>Apple Rumors and X86 first move</title>
				<link>https://31416.org/post/apple-rumors-and-x86-first-move/</link>
				<pubDate>Wed, 16 Nov 2005 17:59:00 +0000</pubDate>
				<guid>https://31416.org/post/apple-rumors-and-x86-first-move/</guid>
				<description>&lt;p&gt;I find the mac mini a particularly compelling computer. It is small, noise friendly, relatively cheap. If you want to have a cheap home server (based on Linux or MacOS X), this is quite a good choice as you probably don&amp;rsquo;t want to hear all the fans of bigger computers the whole day. It&amp;rsquo;s also a very good candidate for a media box: you can connect a huge hard drive for mp3s, and watch your DVDs, photos on a nice LCD (and MacOS helps here).&lt;/p&gt;</description>
			</item>
			<item>
				<title>7 Years Later: Still EJBs</title>
				<link>https://31416.org/post/7-years-later-still-ejbs/</link>
				<pubDate>Mon, 07 Nov 2005 16:29:00 +0000</pubDate>
				<guid>https://31416.org/post/7-years-later-still-ejbs/</guid>
				<description>In 1998, a student of my school had a project with Sun about EJBs. This was the beginning of EJBs, they were not public, and there was no J2EE. At that time he found it utterly complicated, and had difficulties to understand why they made it so complicated.&lt;br /&gt;&lt;br /&gt;In 2000, I worked for a company who had built in-house most components of a today J2EE application server. For example, they had their own unified messaging system, on the JSP side, they were already using custom tags, etc.. Their problem is that they took lots of time to develop in-house, all what later became standard, and almost freely available.&lt;br /&gt;&lt;br /&gt;Today, 7 years later, the big talk, new Java products, be it Spring, or JBoss Seam, are still all about the same ideas as in the first J2EE. Spring has the freedom to include whatever technology, but in the end, their scope closely matches J2EE scope. Service Oriented Architecture (SOA), the current buzzword, will come out relatively naturally with J2EE, session EJBs being natural candidate to expose functionalities to the outer world. JBoss (or Geronimo) architecture is fully SOA: a small kernel managing services, that are exposed for other to use.&lt;br /&gt;&lt;br /&gt;To learn about EJBs, I still find &lt;a href=&#34;http://www.amazon.com/exec/obidos/redirect?path=ASIN/059600530X&amp;link_code=as2&amp;amp;amp;camp=1789&amp;tag=michelin-20&amp;amp;creative=9325&#34;&gt;Enterprise JavaBeans&lt;/a&gt; by Richard Monson-Haefel, the best book. The chapter (in the 2nd Edition of the book, not in the 4th unfortunately) where he rolls his own distributed objects system is for me a testimony on how well he wants you to understand what&#39;s behind EJBs. And if you want to better understand what&#39;s behind RMI, &lt;a href=&#34;http://www.amazon.com/exec/obidos/redirect?path=ASIN/1565922069&amp;link_code=as2&amp;amp;amp;camp=1789&amp;tag=michelin-20&amp;amp;creative=9325&#34;&gt;Java Distributed Computing (O&#39;Reilly)&lt;/a&gt;&lt;img src=&#34;http://www.assoc-amazon.com/e/ir?t=michelin-20&amp;amp;l=as2&amp;amp;o=1&amp;amp;a=1565922069&#34; width=&#34;1&#34; height=&#34;1&#34; border=&#34;0&#34; alt=&#34;&#34; style=&#34;border:none !important; margin:0px !important;&#34; /&gt; has a chapter where the author rolls his own RMI.&lt;br /&gt;&lt;br /&gt;To conclude, Sun was really clever in defining J2EE scope and branding several Java technologies as J2EE (despite the awful version naming). While the ideas were very good, the developer&#39;s life was forgotten. It was too much a pain in the a** and not flexible enough (especially the ORM side). JBoss gets it right, what people need is a way to use pieces of J2EE, without imposing too much unnecessary hurdle on development.</description>
			</item>
			<item>
				<title>Job Hunting: Interview Madness</title>
				<link>https://31416.org/post/job-hunting-interview-madness/</link>
				<pubDate>Fri, 04 Nov 2005 10:40:00 +0000</pubDate>
				<guid>https://31416.org/post/job-hunting-interview-madness/</guid>
				<description>&lt;p&gt;I have been doing interviews those past weeks. Today I had to present my resume for the N time where N is big. It is very boring. In France, it is common to have 5 interviews for a small company (that says a bit about how people trust each other and makes me envy Germany where the practice is to select very strictly on the resume and be more relax about interviews). But all those interviews give a valuable insight on the current market, and on some companies.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Does Eclipse Rot The Brain?</title>
				<link>https://31416.org/post/does-eclipse-rot-the-brain/</link>
				<pubDate>Thu, 27 Oct 2005 17:42:00 +0000</pubDate>
				<guid>https://31416.org/post/does-eclipse-rot-the-brain/</guid>
				<description>&lt;p&gt;Slashdot presented a really insightful article on Visual Studio by Charles Petzold called &lt;a href=&#34;http://charlespetzold.com/etc/DoesVisualStudioRotTheMind.html&#34;&gt;Does Visual Studio Rot the Mind&lt;/a&gt;. Interestingly it seems that Eclipse does things better than the future Visual Studio.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Autocomplete in Eclipse is really good and does not suffer of the bottom-up problem M. Petzold mentioned, nor from the forced CTRL-Z.&lt;/li&gt;&#xA;&lt;li&gt;There is no Form designer, and in Java it has been the practice to lay out forms programmatically. The Java Layouts have always been scalable, and Java programs very rarely rely on pixels.&lt;/li&gt;&#xA;&lt;li&gt;There is no unnecessary import statements.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;His positive feedback on XAML is interesting, especially since he thinks this allows for a better automatic UI.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Orkut Statistics and Blog Evolution</title>
				<link>https://31416.org/post/orkut-statistics-and-blog-evolution/</link>
				<pubDate>Tue, 18 Oct 2005 13:03:00 +0000</pubDate>
				<guid>https://31416.org/post/orkut-statistics-and-blog-evolution/</guid>
				<description>&lt;p&gt;I was just having a look at orkut again. As in my last look in the past year, there is not much new or interesting. The technical forums are mostly uninteresting and it almost looks like nothing is going on. Take a look at the orkut java forums, in 1 year, very few messages are good.&lt;/p&gt;&#xA;&lt;p&gt;Compare that to &lt;a href=&#34;http://javablogs.com&#34;&gt;javablogs.com&lt;/a&gt; blogs aggregation, every week there are many interesting posts. The blog model is good because it is targeted at people who want to write. When you blog, you build a history. Forums don&amp;rsquo;t let you do that. You could have a social model on top of blogs, and I am sure this will be one of their next evolution.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Spring Books Roundup Updated</title>
				<link>https://31416.org/post/spring-books-roundup-updated/</link>
				<pubDate>Mon, 10 Oct 2005 16:27:00 +0000</pubDate>
				<guid>https://31416.org/post/spring-books-roundup-updated/</guid>
				<description>&lt;p&gt;I am completing my &lt;a href=&#34;https://31416.org/post/spring-books-roundup&#34;&gt;Spring Books Roundup&lt;/a&gt; with 2 new books:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Pro Spring&lt;/em&gt;, by Apress: a lengthy book, with some unnecessary information, but good overall. I did not like the Part 1, there is not much content in it. Fortunately, Part 2 is much better, dependency injection is very well described, almost on par, with the Fowler article of reference. Other Spring areas are well covered, in a similar manner as in Wrox book, except Java Server Faces, absent from the book, and nothing on Swing as well&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Spring Reference Documentation&lt;/em&gt;, from the &lt;a href=&#34;http://www.springframework.org/documentation&#34;&gt;springframework.org&lt;/a&gt; website: I should have started with this one, it is of very good quality, and more up-to-date. There is notably a very good chapter on &amp;ldquo;Source Level Metadata Support&amp;rdquo; even if I don&amp;rsquo;t find particularly compelling that they chose yet another abstraction behind Java 5 annotations, partly to support older JDKs. Another plus is a chapter on JMX support, this was lacking in other books.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Interestingly most other books are very similar to the reference documentation, in their presentation and content. The reference documentation is extremely well written. Each time the author carefully explains what are the advantages of the Spring solution, or what does a particular feature solve. Only dependency injection and swing are not treated properly.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Spring Books Roundup</title>
				<link>https://31416.org/post/spring-books-roundup/</link>
				<pubDate>Mon, 10 Oct 2005 11:15:00 +0000</pubDate>
				<guid>https://31416.org/post/spring-books-roundup/</guid>
				<description>&lt;p&gt;Spring is hip these days, so I decided to learn a bit more about it. I had used Avalon a while ago, I was attracted by its design by component and the way it seemed to lay out a proper infrastructure to build a server application. In the end, I was a bit disappointed, it required a bit too much glue code for my taste and did not provide that much in exchange. I don&amp;rsquo;t remember if, at that time, it was advertised as IoC (Inversion Of Control) container. This experience is one of the reasons why I did not jump on the Spring ship.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Interesting Plug-In Framework - DPML Transit</title>
				<link>https://31416.org/post/interesting-plug-in-framework---dpml-transit/</link>
				<pubDate>Thu, 29 Sep 2005 15:20:00 +0000</pubDate>
				<guid>https://31416.org/post/interesting-plug-in-framework---dpml-transit/</guid>
				<description>&lt;p&gt;Today, I just found out about  &lt;a href=&#34;http://dpml.net/transit/latest/overview.html&#34;&gt;DPML Transit&lt;/a&gt;, it is a small framework that helps you build plug-ins based software. It seems to work a bit with &lt;a href=&#34;http://dpml.net/magic/latest/index.html&#34;&gt;DPML Magic&lt;/a&gt;, their build system based upon Ant. Both are quite interesting, since in big projects, you often end up with a packaging per component (which DPML Magic seems to make very simple) and a versioning of those components. DPML Transit allows then for an efficient way to look up a particular version of one component.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java Puzzlers - Can you figure this out?</title>
				<link>https://31416.org/post/java-puzzlers---can-you-figure-this-out/</link>
				<pubDate>Wed, 28 Sep 2005 16:04:00 +0000</pubDate>
				<guid>https://31416.org/post/java-puzzlers---can-you-figure-this-out/</guid>
				<description>&lt;iframe src=&#34;http://rcm.amazon.com/e/cm?t=michelin-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=032133678X&amp;fc1=000000&amp;=1&amp;lc1=0000ff&amp;bc1=000000&amp;lt1=_blank&amp;IS2=1&amp;bg1=ffffff&amp;f=ifr&#34; style=&#34;width:120px;height:240px;margin:5px&#34; scrolling=&#34;no&#34; marginwidth=&#34;0&#34; marginheight=&#34;0&#34; frameborder=&#34;0&#34; align=&#34;left&#34;&gt;&lt;/iframe&gt;The book Java Puzzlers is quite good. I don&#39;t think anyone can get every puzzle right. This shows again how you can very easily make someone fail interviews if you ask too silly questions. I suppose that if people were asking those questions they would not expect the right answers, but study the candidate reactions.&lt;br /&gt;&lt;br /&gt;Here is a sample:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;public class DosEquis {&lt;br /&gt;&amp;nbsp;&amp;nbsp;public static void main(String[] args) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;char x = &#39;X&#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int i = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.print(true ? x : 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.print(false ? i : x);&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;} &lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;This will output &#34;X88&#34;. Obviously this is not good code, which is precisely one of the book objectives: to show how bad some practices can be. But at the same time you learn a bit more about the Java language and its possibilities. In the latter chapters they have more interesting puzzles.</description>
			</item>
			<item>
				<title>Is Prolog Better Suited Than SQL?</title>
				<link>https://31416.org/post/is-prolog-better-suited-than-sql/</link>
				<pubDate>Mon, 26 Sep 2005 15:36:00 +0000</pubDate>
				<guid>https://31416.org/post/is-prolog-better-suited-than-sql/</guid>
				<description>&lt;p&gt;I am currently reading a Prolog book &lt;em&gt;Artificial Intelligence Through Prolog&lt;/em&gt;, I have been doing a bit of Prolog when I was very young and wanted to refresh my memory a bit. It is a very interesting read, especially when I take the viewpoint of our current application where no ACID compliance is required.&lt;/p&gt;&#xA;&lt;p&gt;It seems to me that all the logic we coded to parametrize SQL queries and construct them dynamically could have been avoided if we had chosen Prolog as Prolog expressions would have been very natural to use in our project. With Prolog, there is no need to think about joins, type of joins, SQL syntax. It is at the level just higher. I wonder very much why Prolog did not become more mainstream as it seems to solve some problems in a much nicer, natural way.&lt;/p&gt;</description>
			</item>
			<item>
				<title>When California Was An Island</title>
				<link>https://31416.org/post/when-california-was-an-island/</link>
				<pubDate>Wed, 21 Sep 2005 19:01:00 +0000</pubDate>
				<guid>https://31416.org/post/when-california-was-an-island/</guid>
				<description>&lt;a href=&#39;http://photos1.blogger.com/img/257/6856/1024/IMG_20050918_0012.jpg&#39;&gt;&lt;img border=&#39;0&#39; style=&#39;border:1px solid #AAAAAA; margin:2px&#39; src=&#39;http://photos1.blogger.com/img/257/6856/400/IMG_20050918_0012.jpg&#39;&gt;&lt;/a&gt;&lt;br /&gt;This is from an old (1680s) big (2 tons) Coronelli globe, currently displayed in Grand Palais, Paris. Can you spot San Francisco there?</description>
			</item>
			<item>
				<title>Currying - A Very Interesting Use Of Generics</title>
				<link>https://31416.org/post/currying---a-very-interesting-use-of-generics/</link>
				<pubDate>Fri, 16 Sep 2005 14:41:00 +0000</pubDate>
				<guid>https://31416.org/post/currying---a-very-interesting-use-of-generics/</guid>
				<description>In &lt;a href=&#34;http://bamboo-dht.org/&#34;&gt;bamboo-dht&lt;/a&gt;, a distributed java hashtable project, the main developer, Sean C. Rhea, advocates the use of Curries and Thunks (of LISP and ML). He wrote an interesting and valuable document, &lt;a href=&#34;http://bamboo-dht.org/async-tutorial/async-tutorial.pdf&#34;&gt;Async Tutorial&lt;/a&gt;, presenting a use of it. I will present the concept here shortly:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;public interface Thunk1&amp;lt;T&amp;gt; { void run (T t ) ; }&lt;br /&gt;&lt;br /&gt;Thunk1&amp;lt;Integer&amp;gt; intThunk = new Thunk1&amp;lt;Integer&amp;gt;() {&lt;br /&gt;void run (Integer i ) { System.out.println( i ) ; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static &amp;lt;T&amp;gt; Runnable curry(final Thunk1&amp;lt;T&amp;gt; f ,final T t ) {&lt;br /&gt;return new Runnable () { public void run ( ) { f.run ( t ) ; } } ;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Runnable print42  = curry( intThunk , new Integer ( 42 ) ) ;&lt;br /&gt;print42.run ( ) ;  //prints 42 to standard output&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;So it is a very clever way to have a callback in java. Very clever because you can declare your code to take only a run(), and pass any parameter in it by using a curry. It is very simple to use, even if the small framework around it can scare some people.&lt;br /&gt;&lt;br /&gt;However neat the idea is, I am not sure it is practically useful. Sean C. Rhea used that because he did not want to use &#34;unnecessary&#34; instance variables. Ok, but the curry is still creating another instance (actually 2 but one could be static), is the overhead of a class instance without variables that much more than one with variables? And there is another way, without the Curry framework:&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;Runnable print42 = new Runnable({ public void run() {intThunk.run(new Integer(42));}});&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;print42.run();&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;This is actually exactly what the Curry framework would do behind the scenes. The Curry framework makes it a bit more elegant, but I am not sure if that&#39;s really more readable for most programmers. I would personally advise the traditional way, use instance variables.</description>
			</item>
			<item>
				<title>On J2EE Portability Accross Application Servers</title>
				<link>https://31416.org/post/on-j2ee-portability-accross-application-servers/</link>
				<pubDate>Tue, 13 Sep 2005 16:50:00 +0000</pubDate>
				<guid>https://31416.org/post/on-j2ee-portability-accross-application-servers/</guid>
				<description>&lt;p&gt;Brian Alexander Lee &lt;a href=&#34;http://www.prepend.com/2005/09/porting-j2ee-apps-to-websphere.html&#34;&gt;wrote&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;dismal interview where I asked about the candidate&amp;rsquo;s experience with porting a J2EE application from WebLogic to WebSphere (which was listed on his resume). The candidate said that it was very easy and he just deployed his application with no problems or changes necessary, he had no changes made for the application to run properly. This was one of many bad signs for the candidate.&amp;rdquo;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I disagree. I would even use his example to show that the portability game is more about configuration and packaging rather than about anything else so that many developers would in-deed not see a big deal into porting an application to a new application server.&lt;/p&gt;</description>
			</item>
			<item>
				<title>JavaBlogs Weekly Top 10 and Java HTML parsing</title>
				<link>https://31416.org/post/javablogs-weekly-top-10-and-java-html-parsing/</link>
				<pubDate>Mon, 12 Sep 2005 16:00:00 +0000</pubDate>
				<guid>https://31416.org/post/javablogs-weekly-top-10-and-java-html-parsing/</guid>
				<description>&lt;p&gt;I took some time to continue my little JavaBlogs analysis, I now have a page summarizing the &lt;a href=&#34;http://gopix.net:8081/javabuzz/buzzweek.html&#34;&gt;top 10&lt;/a&gt; most read blog entries in the last week. The page is generated every 24h (this is why there is no &amp;lsquo;best progression&amp;rsquo; as of today).&lt;/p&gt;&#xA;&lt;p&gt;I also fixed some bugs related to HTML in RSS2. I understand a bit better why a RSS 1.0 co-author decided to remove the possibility of HTML descriptions for &lt;a href=&#34;http://www.aaronsw.com/2002/rss30&#34;&gt;RSS 3.0&lt;/a&gt;. It often does not make sense to keep all that information about styles, fonts, etc. from different sources. What I do is rewrite the HTML, allowing only b,i,a,p,br tags, with the style information stripped. I found the open-source &lt;a href=&#34;http://htmlparser.sourceforge.net&#34;&gt;htmlparser&lt;/a&gt; java library quite helpful to achieve that.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Spam In Blog Comments</title>
				<link>https://31416.org/post/spam-in-blog-comments/</link>
				<pubDate>Sat, 10 Sep 2005 01:34:00 +0000</pubDate>
				<guid>https://31416.org/post/spam-in-blog-comments/</guid>
				<description>&lt;p&gt;I was a victim like many other of spams in comments. It&amp;rsquo;s stupid for people to do that on Blogger.com since the links on comments can not be referenced by search engines (they have some special &amp;lsquo;relative&amp;rsquo;attribute for that) and improve pagerank.&lt;/p&gt;&#xA;&lt;p&gt;Fortunately Blogger.com provides a word verification step if you want to avoid random spam. However I am a bit disappointed that they force Blogger.com users to do that word verification as well. This time I find it stupid from Blogger.com. They have control on their users, so they could ban spamming users, and for everybody else on Blogger.com, this would be just one less step. I am always a bit annoyed at measures that solve a problem caused by a hand of people by making it more annoying for the majority.&lt;/p&gt;</description>
			</item>
			<item>
				<title>JavaBlogs Daily Analysis</title>
				<link>https://31416.org/post/javablogs-daily-analysis/</link>
				<pubDate>Fri, 09 Sep 2005 17:10:00 +0000</pubDate>
				<guid>https://31416.org/post/javablogs-daily-analysis/</guid>
				<description>&lt;p&gt;I was wondering what blog entries were the most interesting on &lt;a href=&#34;http://www.javablogs.com&#34;&gt;Javablogs&lt;/a&gt;. I decided to write a small application to do that. It was not much more complex to put it online for others to look at as well. It is currently running on &lt;a href=&#34;http://gopix.net:8081/javabuzz&#34;&gt;http://gopix.net:8081/javabuzz&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It also presents Javablogs a bit differently (I like it better that way).&lt;/p&gt;&#xA;&lt;p&gt;Please note that it is just the result of a 1 (full) day of work currently. I hopefully will have a bit of time to improve it. For example I&amp;rsquo;d like to add some graphs about popularity, some weekly stats, and comments in blog entries.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Commons-Beanutils Is Slow</title>
				<link>https://31416.org/post/commons-beanutils-is-slow/</link>
				<pubDate>Wed, 07 Sep 2005 17:28:00 +0000</pubDate>
				<guid>https://31416.org/post/commons-beanutils-is-slow/</guid>
				<description>&lt;p&gt;The &lt;a href=&#34;http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.7.0/docs/api/&#34;&gt;BeanUtil.popupate(bean,map)&lt;/a&gt; can be very handy, but if you care about performance, it is quite slow. I ran a micro benchmark on my machine (centrino 1.8ghz, JDK1.5) and found out that BeanUtils is up to 40x slower than a hand coded solution (where I assign each bean field manually). I was a bit surprised to find such a difference. I suppose there is a big penalty for using reflection and another big one for the BeanUtils abstraction (automatic casting, etc.). I did another test without BeanUtils, using if/else statements vs HashMap.get and found out that the if/else string.equals(&amp;hellip;) statements can degrade performance by about 10x. The HashMap appears to be very performant, even with just a few elements in.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Generate your RSS feed in Java</title>
				<link>https://31416.org/post/generate-your-rss-feed-in-java/</link>
				<pubDate>Mon, 05 Sep 2005 14:03:00 +0000</pubDate>
				<guid>https://31416.org/post/generate-your-rss-feed-in-java/</guid>
				<description>There are some open source projects that can help you in generating or reading RSS feeds in Java. I found only two libraries a bit mature, other code is often embedded in other open source products (jroller for example):&lt;br /&gt;&lt;ul&gt;    &lt;li&gt;&lt;a href=&#34;http://informa.sourceforge.net/&#34;&gt;Informa&lt;/a&gt;: Does various RSS formats and Atom 0.3. Documentation is better than its alternative, but less focused (has some hibernate helper thingy, some lucene helper, etc.).&lt;br /&gt;&lt;/li&gt;   &lt;li&gt;&lt;a href=&#34;http://sourceforge.net/projects/sandler/&#34;&gt;Sandler&lt;/a&gt;: There is no working homepage while I am writing this. But the code is of decent quality, supports Atom 0.3 and RSS 1.0. It is easy to use it. However in reality it is not much more than a wrapper around some XML parser specialized in generating an RSS structure or an Atom structure.&lt;/li&gt;&lt;li&gt;Ooops, I forgot another important one, &lt;a href=&#34;https://rome.dev.java.net/&#34;&gt;Rome&lt;/a&gt;. This RSS/Atom framework with a catchy name is very similar to Informa, has good documentation and good looking code. Under the hood it makes use of jdom.&lt;/li&gt; &lt;/ul&gt; I personally use &lt;a href=&#34;http://dom4j.org/&#34;&gt;dom4j&lt;/a&gt; since I only need to generate RSS, and RSS, or Atom are just XML. I don&#39;t find it particularly verbose to use dom4j for that, and it is very flexible.&lt;br /&gt;&lt;br /&gt;If you need to parse feeds, then those libraries might make sense and save you a bit of time. For generating, I think their main interest is to abstract you from the differences in formats. So if you need to handle different formats, a framework will allow you to do it through only one API, which can be a big time-saver.</description>
			</item>
			<item>
				<title>The Evil Port 80</title>
				<link>https://31416.org/post/the-evil-port-80/</link>
				<pubDate>Thu, 01 Sep 2005 13:46:00 +0000</pubDate>
				<guid>https://31416.org/post/the-evil-port-80/</guid>
				<description>I was writing an Atom feed generator for my current project. I chosed to support &lt;a href=&#34;http://www.atomenabled.org/developers/syndication/&#34;&gt;Atom 1.0&lt;/a&gt; since it looks like it has the capabilities to establish as the next standard. Unfortunately I quickly saw that it was quite hard to test it in the real world (out of the good feedvalidator), as almost nobody seems to accept Atom 1.0 feeds yet, even if it is rapidely changing (there is support for it in Firefox CVS version).&lt;br /&gt;&lt;br /&gt;So I decided to support RSS as well, the big question was: which RSS version? After grabbing lots of info on the subject, I opted for 1.0 again (more flexible, more different than Atom). It was actually quick to support RSS, but then when in real world, neither &lt;a href=&#34;http://desktop.google.com/en/&#34;&gt;Google Desktop&lt;/a&gt; nor &lt;a href=&#34;http://my.yahoo.com/&#34;&gt;My Yahoo&lt;/a&gt; was willing to accept my feed. I looked at every bit of my xml, fiddled with Tomcat configuration in any possible way when I saw that no request was coming to my server from Yahoo or Google. And finally I thought, hmm maybe it&#39;s the port. I restarted my server on port 80, and yup, it worked!&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://photos1.blogger.com/blogger/6384/1303/1600/mubot_local.jpg&#34;&gt;&lt;img style=&#34;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&#34; src=&#34;http://photos1.blogger.com/blogger/6384/1303/320/mubot_local.jpg&#34; alt=&#34;&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I wonder why Google Desktop and My Yahoo don&#39;t support another port than port 80 for RSS feeds.</description>
			</item>
			<item>
				<title>I Need Another DB Framework!</title>
				<link>https://31416.org/post/i-need-another-db-framework/</link>
				<pubDate>Tue, 23 Aug 2005 19:37:00 +0000</pubDate>
				<guid>https://31416.org/post/i-need-another-db-framework/</guid>
				<description>&lt;p&gt;I am currently facing a problem that neither &lt;a href=&#34;http://www.hibernate.org&#34;&gt;Hibernate&lt;/a&gt; nor &lt;a href=&#34;http://ibatis.apache.org/&#34;&gt;iBatis&lt;/a&gt; solves nicely. I also looked at other ORM or just DB framework, without success.&lt;/p&gt;&#xA;&lt;p&gt;What I would need is a framework that generates PreparedStatements with a query by Criteria like API. I have many queries that are similar but varying according to different input parameters. iBatis can handle this, but for complex queries and scenarios, the XML becomes completely unreadable, and you therefore loose any advantage that iBatis was bringing with the externalization of SQL statements in XML. The other issue I have with using iBatis is that for another part of my project, the automatic generation of SQL statements a-la Hibernate is useful.&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt; Hibernate has a very nice &lt;a href=&#34;http://www.hibernate.org/hib_docs/v3/reference/en/html/querycriteria.html&#34;&gt;Query by Criteria&lt;/a&gt; API, but it lacks just a tiny bit of flexibility in customizing queries. For example, I could not find a way to specify a &amp;ldquo;USE INDEX(index_name)&amp;rdquo; in the generated SQL, after the SELECT FROM xxx and before the rest of the query. I did not find either a way to specify the use of a &amp;ldquo;STRAIGHT_JOIN&amp;rdquo; instead of an INNER JOIN. These are all MySQL specific issues, but those little things are extremely useful at improving some of my queries performances. Writing N sql queries hard coded is not a good option, since this N can be quite big, which is why I am using Query by Criteria in the first place.&lt;/p&gt;</description>
			</item>
			<item>
				<title>del.icio.us toolbar customized</title>
				<link>https://31416.org/post/del.icio.us-toolbar-customized/</link>
				<pubDate>Sun, 21 Aug 2005 05:20:00 +0000</pubDate>
				<guid>https://31416.org/post/del.icio.us-toolbar-customized/</guid>
				<description>When I bookmark articles with &lt;a href=&#34;http://del.icio.us&#34;&gt;delicious&lt;/a&gt;, I like to keep the content on my hard drive, because pages sometimes change, or are removed, or I want to do local searches. I believe this is one reason some people like furl (furl keeps a copy on their server that only yourself can read, but does not allow search).&lt;br&gt;&lt;br&gt;A combination of slogger and delicious could solve partially the problem. But it is not integrated, I can&#39;t get my local version from delicious, so I loose the tagging, listing and all other plus from delicious.&lt;br&gt;&lt;br&gt;I added my own feature to the delicious toolbar, which I like very much. This new toolbar saves automatically the file you bookmark (on the + button), and will add a link in your delicious home to the local version (if it exists).&lt;br&gt;&lt;br&gt;I have it publicly accessible at &lt;a href=&#34;http://perso.wanadoo.fr/logos01/deltoolbar.html&#34;&gt;http://perso.wanadoo.fr/logos0&lt;/a&gt;&lt;a href=&#34;http://perso.wanadoo.fr/logos01/deltoolbar.html&#34;&gt;1/deltoolbar.html&lt;/a&gt; &lt;br&gt;&lt;br&gt;It is not meant to be used by everybody as it is not official. But the page will give you an idea of what it does. If you think it is useful, I will improve it, otherwise it will stay the way it is because it fits my use.&lt;br&gt;&lt;br /&gt;&lt;span class=&#34;technoratitag&#34;&gt;Categories: &lt;a href=&#34;http://del.icio.us/tag/delicious&#34; rel=&#34;tag&#34;&gt;delicious&lt;/a&gt;, &lt;a href=&#34;http://del.icio.us/tag/firefox&#34; rel=&#34;tag&#34;&gt;firefox&lt;/a&gt;, &lt;a href=&#34;http://del.icio.us/tag/toolbar&#34; rel=&#34;tag&#34;&gt;toolbar&lt;/a&gt;&lt;/span&gt;</description>
			</item>
			<item>
				<title>Inside the Java Virtual Machine</title>
				<link>https://31416.org/post/inside-the-java-virtual-machine/</link>
				<pubDate>Thu, 18 Aug 2005 11:03:00 +0000</pubDate>
				<guid>https://31416.org/post/inside-the-java-virtual-machine/</guid>
				<description>I am reading an old book, &lt;a href=&#34;http://www.amazon.com/exec/obidos/redirect?link_code=ur2&amp;amp;camp=1789&amp;amp;tag=michelin-20&amp;amp;creative=9325&amp;amp;path=tg/detail/-/0079132480&#34;&gt;Inside the Java Virtual Machine&lt;/a&gt;&lt;img src=&#34;http://www.assoc-amazon.com/e/ir?t=michelin-20&amp;amp;l=ur2&amp;amp;o=1&#34; width=&#34;1&#34; height=&#34;1&#34; border=&#34;0&#34; alt=&#34;&#34; style=&#34;border:none !important; margin:0px !important;&#34; /&gt;. Some old books don&#39;t age, and this is one of them. The chapter on the Java Virtual Machine is just excellent and should be read by every Java developer. It explains each step a JVM does when you run a Java program, very clearly.&lt;br /&gt;&lt;br /&gt;You could get plenty of stupid interview questions from it like: How is the Java stack used? Between method area, heap, pc register, stack which one are shared among threads?&lt;br /&gt;&lt;br /&gt;Also they saw the full potential of Java quite early on (1997). They explain how the JVM specs allow for very different implementations, ones that can run in different environments, for example, simplifying a bit: low memory, embedded world, or lots of memory, mainframe world. It is not an accident if Microsoft chosed a very similar design for the CLI of .NET, they have been looking for getting into the embedded area for quite some time, and apparently, they are making good progress.</description>
			</item>
			<item>
				<title>Firefox Shortcut URL as Command Line for the Web</title>
				<link>https://31416.org/post/firefox-shortcut-url-as-command-line-for-the-web/</link>
				<pubDate>Tue, 16 Aug 2005 13:42:00 +0000</pubDate>
				<guid>https://31416.org/post/firefox-shortcut-url-as-command-line-for-the-web/</guid>
				<description>I have been doing some work on Firefox extensions. Mozilla/Firefox is a really interesting world, it is extremely flexible, you can make it transform the web the way you want.&lt;br&gt; &lt;br&gt; Recently, someone started &lt;a href=&#34;http://www.yubnub.org&#34;&gt;YubNub&lt;/a&gt;, the &#34;command line for the web&#34;, a very simple idea, but useful. This is a bit similar to the Firefox Search Bar, except more powerful, and quicker to use. Mozilla developers actually had that idea a long time ago (around 2000), it is called shortcut url. Basically to any bookmark, you can add a shortcut, you then just have to type that shortcut (let say g for google.com) in the address bar to go to the address pointed by the shortcut. This shortcut accepts 1 parameter (represented by &lt;tt&gt;%s&lt;/tt&gt; in the URL), so you can do &#34;&lt;tt&gt;g chasethedevil&lt;/tt&gt;&#34; to search google for &#34;&lt;tt&gt;chasethedevil&lt;/tt&gt;&#34; if you set up your shortcut properly. Firefox can build this dynamic URL automatically for you if in an input box, you right click and choose &#34;Add a keyword for this search&#34;.&lt;br&gt; &lt;br&gt; Now we have seen the Firefox address bar can be used to quickly perform a search on a selected website. But this can be much more powerful. As &lt;a  href=&#34;http://www.mvps.org/dmcritchie/firefox/kws.htm&#34;&gt;this&lt;/a&gt; page suggests, you can associate a bookmarklet with a shortcut, you can execute whatever javascript you wish. One very simple example is: &lt;br /&gt;&lt;tt&gt;javascript:void(location.href=&lt;br /&gt;&#39;http://web.archive.org/web/*dc_/&#39;+location.href)&lt;/tt&gt;. This shows how you can use the address bar in a very flexible manner. It would be easy to support a multiple parameters search using a bookmarklet. There is &lt;a  href=&#34;http://www.wormus.com/leakytap/Internet/CustomKeywords/&#34;&gt;a whole list&lt;/a&gt; of commands very similar to yubnub ones in addition to those on the previously mentioned link.&lt;br&gt; &lt;br&gt; I first thought about writing a simple extension to have my command line in Firefox (for example by extending the getShortcutOnURI function), but after some information gathering, I discovered it was already possible. Firefox is truly amazing. It is a bit of a shame that this functionality is not a bit better exposed to the user.&lt;br&gt; &lt;br&gt; tags: &lt;a rel=&#34;tag&#34; href=&#34;http://technorati.com/tag/firefox&#34;&gt;Firefox&lt;/a&gt; &lt;a rel=&#34;tag&#34; href=&#34;http://technorati.com/tag/firefox&#34;&gt;shortcut&lt;/a&gt; &lt;a  rel=&#34;tag&#34; href=&#34;http://technorati.com/tag/firefox&#34;&gt;extension&lt;/a&gt; &lt;a  rel=&#34;tag&#34; href=&#34;http://technorati.com/tag/firefox&#34;&gt;bookmarklet&lt;/a&gt;&lt;br&gt;</description>
			</item>
			<item>
				<title>Hibernate Criteria API vs HQL Overhead</title>
				<link>https://31416.org/post/hibernate-criteria-api-vs-hql-overhead/</link>
				<pubDate>Wed, 10 Aug 2005 14:16:00 +0000</pubDate>
				<guid>https://31416.org/post/hibernate-criteria-api-vs-hql-overhead/</guid>
				<description>&lt;p&gt;I was wondering what was the framework weight in the performance of my application, and I wanted to check at several frameworks performance. I used &lt;a href=&#34;http://jakarta.apache.org/jmeter/&#34;&gt;JMeter&lt;/a&gt; to benchmark a stripped application (database access through tomcat) under various loads.&lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt; My very modest test shows no significant difference between Hibernate Criteria API and HQL access for queries. Criteria might be a few milliseconds slower, but my query time will take 10x more time, even for a relatively simple query (my query is has 3 inner joins, is grouped, with a count and takes only 4ms when performed once in mysql under no load). &lt;!-- raw HTML omitted --&gt; &lt;!-- raw HTML omitted --&gt; It seems much more important for the Framework of choice to provide good scalability, easy development and maintenance, rather than saving a few cycles, unless the Framework becomes a bottleneck.&lt;/p&gt;</description>
			</item>
			<item>
				<title>How to become a JavaRSS member on blogger.com</title>
				<link>https://31416.org/post/how-to-become-a-javarss-member-on-blogger.com/</link>
				<pubDate>Fri, 05 Aug 2005 13:32:00 +0000</pubDate>
				<guid>https://31416.org/post/how-to-become-a-javarss-member-on-blogger.com/</guid>
				<description>&lt;p&gt;The trick is to create a post with the javarss image and to use the link generated by blogger.com to display the image. Then you can follow the rules from &lt;a href=&#34;http://www.javarss.com/pages/?page=suggest&#34;&gt;http://www.javarss.com/pages/?page=suggest&lt;/a&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>Java is more productive than Ruby/Rails</title>
				<link>https://31416.org/post/java-is-more-productive-than-rubyrails/</link>
				<pubDate>Tue, 26 Jul 2005 13:26:00 +0000</pubDate>
				<guid>https://31416.org/post/java-is-more-productive-than-rubyrails/</guid>
				<description>&lt;p&gt;I have been doing some Ruby On Rails, for 2 small projects. While I think it is good, I think it is overhyped as well. It is well designed, has good ideas (easy configuration), and focus on the right problem, architecture. But my conclusion is that I am not more productive with it than with Java.&lt;/p&gt;&#xA;&lt;p&gt;I think most of the development time is not spent coding, but thinking. It is a very obvious statement, and yet too often ignored.&lt;/p&gt;</description>
			</item>
			<item>
				<title>féminisme et statistiques</title>
				<link>https://31416.org/post/f%C3%A9minisme-et-statistiques/</link>
				<pubDate>Thu, 21 Jul 2005 12:16:00 +0000</pubDate>
				<guid>https://31416.org/post/f%C3%A9minisme-et-statistiques/</guid>
				<description>&lt;a href=&#34;http://www.peripheries.net/e-feminisme.html&#34;&gt;Sur ce lien, un article&lt;/a&gt; un peu trop long, mais avec pas mal de points int&amp;eacute;ressants:&lt;br&gt; &lt;ul&gt;   &lt;li&gt;6 femmes par mois d&amp;eacute;c&amp;egrave;dent, en France, par violence conjugale, soit plus que le nombre de victimes du metro anglais sur un an. Pour toutes les statistiques sur les chances de mourir suivant les causes, aux Etats-Unis, &lt;a href=&#34;http://www.nsc.org/lrs/statinfo/odds.htm&#34;&gt;cliquer ici&lt;/a&gt; (on voit notamment que le plus grand risque est l&#39;accident de voiture, ou la chute, ou le suicide par arme &amp;agrave; feu, devant les attaques par arme &amp;agrave; feu).&lt;br&gt;   &lt;/li&gt;   &lt;li&gt;Un petit rappel sur l&#39;antif&amp;eacute;minisme chr&amp;eacute;tien, les femmes y &amp;eacute;tant qualifi&amp;eacute;es: de&lt;i&gt; &lt;/i&gt;&lt;span style=&#34;color: black;&#34;&gt;&lt;i&gt;&amp;laquo;d&amp;eacute;fectuosit&amp;eacute; naturelle&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;rat&amp;eacute; de la cr&amp;eacute;ation&amp;raquo;&lt;/i&gt;, d&amp;#8217;&lt;/span&gt;&lt;i&gt;&lt;span  style=&#34;color: black;&#34;&gt;&amp;laquo;&lt;/span&gt;&lt;/i&gt;&lt;span style=&#34;color: black;&#34;&gt;&lt;i&gt;animal inquiet&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;mouche &amp;eacute;ph&amp;eacute;m&amp;egrave;re&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;m&amp;eacute;chante b&amp;ecirc;te&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;porte du Diable&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;sac de fiente&amp;raquo;&lt;/i&gt;, de&lt;i&gt; &amp;laquo;diable domestique&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;racine du Mal&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;rejeton de tous les vices&amp;raquo;&lt;/i&gt;, de &lt;i&gt;&amp;laquo;pi&amp;egrave;ge tendu par l&amp;#8217;ennemi&amp;raquo;&lt;/i&gt;, de&lt;i&gt; &amp;laquo;terre puante&amp;raquo;&lt;/i&gt;, d&amp;#8217;&lt;/span&gt;&lt;i&gt;&lt;span style=&#34;color: black;&#34;&gt;&amp;laquo;&lt;/span&gt;&lt;/i&gt;&lt;span  style=&#34;color: black;&#34;&gt;&lt;i&gt;appendice de la race humaine&amp;raquo;&lt;/i&gt;. Ce qui lui permet d&#39;ajouter: &lt;/span&gt;&lt;i&gt;&lt;span style=&#34;color: black;&#34;&gt;&amp;laquo;&lt;/span&gt;&lt;span  style=&#34;color: black;&#34;&gt;Au lieu d&amp;#8217;expliquer la misogynie des hommes par celle des religions, ne faudrait-il pas plut&amp;ocirc;t expliquer la misogynie des religions par celle des hommes?&lt;/span&gt;&lt;/i&gt;&lt;span style=&#34;color: black;&#34;&gt;&lt;i&gt;&amp;raquo;&lt;/i&gt;.&lt;/span&gt;&lt;/li&gt;   &lt;li&gt;&lt;span style=&#34;color: black;&#34;&gt;Une citation int&amp;eacute;ressante sur le voile en France: &lt;/span&gt;&lt;span style=&#34;color: black;&#34;&gt;&lt;i&gt;&amp;laquo;ces filles qui affichent leur voile dans une soci&amp;eacute;t&amp;eacute; la&amp;iuml;que sont le pendant exact de celles qui le refusent dans une soci&amp;eacute;t&amp;eacute; musulmane&amp;raquo;&lt;/i&gt; laisse &amp;agrave; r&amp;eacute;fl&amp;eacute;chir; et aussi un d&amp;eacute;veloppement sur Theo Van Gogh d&amp;eacute;peint ici en tant que raciste, misogyne et opportuniste, un avis que je ne partage pas.&lt;/span&gt;&lt;/li&gt; &lt;/ul&gt; C&#39;est un peu extr&amp;ecirc;me par moments, mais souvent juste. Sur le m&amp;ecirc;me sujet, Le Monde avait un petit &lt;a  href=&#34;http://www.lemonde.fr/web/article/0,1-0@2-3216,36-661399,0.html&#34;&gt;article sur les wagons r&amp;eacute;serv&amp;eacute;s aux femmes &amp;agrave; Tokyo&lt;/a&gt;. Bon, j&#39;ai peut-&amp;ecirc;tre un peu p&amp;eacute;t&amp;eacute; les plombs avec toute cette lecture.&lt;br&gt; &lt;br&gt; &lt;br&gt; Tags: &lt;a href=&#34;http://technorati.com/tag/feminism&#34; rel=&#34;tag&#34;&gt;feminism&lt;/a&gt; &lt;a href=&#34;http://technorati.com/tag/francais&#34; rel=&#34;tag&#34;&gt;francais&lt;/a&gt; &lt;a href=&#34;http://technorati.com/tag/Actualit%C3%A9s&#34; rel=&#34;tag&#34;&gt;actualités&lt;/a&gt;.</description>
			</item>
			<item>
				<title>Ruby, Python, JavaScript, Lua, Java, C&#43;&#43; benchmark</title>
				<link>https://31416.org/post/ruby-python-javascript-lua-java-c-benchmark/</link>
				<pubDate>Wed, 20 Jul 2005 11:49:00 +0000</pubDate>
				<guid>https://31416.org/post/ruby-python-javascript-lua-java-c-benchmark/</guid>
				<description>&lt;p&gt;Simple benchmark but with interesting comments &lt;a href=&#34;http://acker3.ath.cx/wordpress/archives/7&#34;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;p&gt;Some of the conclusions are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Java interpreter is very good&lt;/li&gt;&#xA;&lt;li&gt;Java JIT is as fast as C++&lt;/li&gt;&#xA;&lt;li&gt;Ruby, JavaScript, Python are of similar order of magnitude speed, Ruby the slowest.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It would have been interesting to benchmark interpreted languages for the JVM.&lt;/p&gt;&#xA;&lt;p&gt;Now for most projects, architecture, not language is key in achieving good performance.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Fowler On Your Future: editing the abstract representation of a program</title>
				<link>https://31416.org/post/fowler-on-your-future-editing-the-abstract-representation-of-a-program/</link>
				<pubDate>Tue, 19 Jul 2005 12:40:00 +0000</pubDate>
				<guid>https://31416.org/post/fowler-on-your-future-editing-the-abstract-representation-of-a-program/</guid>
				<description>This &lt;a href=&#34;http://martinfowler.com/articles/languageWorkbench.html&#34;&gt;Fowler article&lt;/a&gt; on &#34;language workbench&#34; reminds me of &lt;a  href=&#34;http://www.artima.com/intv/jackpot.html&#34;&gt;Gosling Jackpot&lt;/a&gt; ideas: it is about a different interaction with your program where the source code does not matter so much, but its structure. It must be fascinating to work on this kind of project.&lt;br&gt; &lt;br&gt; Maybe MDA sounds similar to you, after all, actual language workbench systems are generating source code. But the fundamental difference is that a workbench generated program is much richer and can capture everything you want to do (MDA is too based on UML to be that powerful), also, the source could disappear and be replaced by byte codes only.&lt;br&gt; &lt;br&gt; Now this all seems very nice, but unfortunately, there are always problems, and Fowler does not miss them: vendor lock-in (not that big of a deal if source is generated), integration with dev tools (especially version control), maturity. It looks like an open source language workbench would help here.&lt;br&gt; &lt;br&gt; It is interesting to see that Intellij (yes, the company behind IDEA) is already well on its way. You can check it out in &lt;a  href=&#34;http://martinfowler.com/articles/mpsAgree.html&#34;&gt;Fowler examples&lt;/a&gt;. His examples are a bit too simple and not very far off rules in rules engines, but the language definition tool does look very neat.&lt;br&gt; &lt;br&gt; As &lt;a href=&#34;http://lispm.dyndns.org/news?ID=NEWS-2005-07-08-1&#34;&gt;Rainer Joswig&lt;/a&gt; shows in his video, LISP seems like a particularly good language to do this. This is hardly surprising since LISP is very near the abstract tree structure and therefore already very used in the AI circles.&lt;br&gt; &lt;br&gt; Tags: &lt;a href=&#34;http://technorati.com/tag/java&#34; rel=&#34;tag&#34;&gt;java&lt;/a&gt; &lt;a href=&#34;http://technorati.com/tag/programming&#34; rel=&#34;tag&#34;&gt;programming&lt;/a&gt;</description>
			</item>
			<item>
				<title>Jython instead of Ant: sample code</title>
				<link>https://31416.org/post/jython-instead-of-ant-sample-code/</link>
				<pubDate>Sat, 16 Jul 2005 01:50:00 +0000</pubDate>
				<guid>https://31416.org/post/jython-instead-of-ant-sample-code/</guid>
				<description>Here is an example of how to use jython to deploy a web application under tomcat. The application is supposed here to be WAR packaged in a &#39;web&#39; directory. Libraries used for the web-app are already in web/WEB-INF/lib, classes are compiled automatically by Eclipse under web/WEB-INF/classes, and resources are copied automatically by Eclipse. If necessary, it is very easy to script those actions in the python script, with very little code.&lt;br /&gt;&lt;br /&gt;The longest code is the TreeCopier class, that should probably be part of any python make script. The reload method could be reworked to provide a generic method for reloading a tomcat web application. The following is just a working sample code as proof of concept.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(0, 0, 255);&#34;&gt;# call jython make.py method1 method2, ... &lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(0, 0, 255);&#34;&gt;# to invoke method1 and then method2, ...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(160, 32, 240);&#34;&gt;import&lt;/span&gt; sys, os, os.path, shutil, urllib, base64, re&lt;br /&gt;web_dir = &#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;web&lt;/span&gt;&#39;&lt;br /&gt;webapp_name = &#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;myrestaurant&lt;/span&gt;&#39;&lt;br /&gt;tomcat_dir = &#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;c:/java/Tomcat 5.5&lt;/span&gt;&#39;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(0, 0, 255);&#34;&gt;#copy web directory to tomcat app dir&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;deploy&lt;/span&gt;():&lt;br /&gt;   target_dir = tomcat_dir+&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;/webapps&lt;/span&gt;&#39;+&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;/&lt;/span&gt;&#39;+webapp_name&lt;br /&gt;   copier=LatestTreeCopier()&lt;br /&gt;   copier.copytree(web_dir,target_dir)&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;copied %s file(s) to %s&lt;/span&gt;&#34; % (copier.count,target_dir)&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(0, 0, 255);&#34;&gt;#reload tomcat web application&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;reload&lt;/span&gt;():&lt;br /&gt;   url = &#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;http://localhost:8080/manager/reload?path=/&lt;/span&gt;&#34;+webapp_name&lt;br /&gt;   base64string = base64.encodestring(&#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;%s:%s&lt;/span&gt;&#34;%(&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;michelin&lt;/span&gt;&#39;,&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;michelin&lt;/span&gt;&#39;))[:-1]&lt;br /&gt;   opener = urllib.URLopener()&lt;br /&gt;   opener.addheader(&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;Authorization&lt;/span&gt;&#39;,&#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;Basic %s&lt;/span&gt;&#34;%base64string)&lt;br /&gt;   h = opener.open(url)&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; h.read()&lt;br /&gt;   h.close()&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;TreeCopier&lt;/span&gt;:&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;__init__&lt;/span&gt;(self):&lt;br /&gt;       self.count = 0&lt;br /&gt;&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;filter&lt;/span&gt;(self, srcname, dstname):&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/span&gt; true&lt;br /&gt;&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;filterDir&lt;/span&gt;(self, srcname):&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/span&gt; true&lt;br /&gt;&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;copytree&lt;/span&gt;(self, src, dst, symlinks=0):&lt;br /&gt;       &#34;&#34;&#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;Recursively copy a directory tree using copy2().&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;        &lt;/span&gt;&#34;&#34;&#34;&lt;br /&gt;       names = os.listdir(src)&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;not&lt;/b&gt;&lt;/span&gt; os.path.exists(dst):&lt;br /&gt;           os.mkdir(dst)&lt;br /&gt;       count = 0&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;for&lt;/b&gt;&lt;/span&gt; name &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;in&lt;/b&gt;&lt;/span&gt; names:&lt;br /&gt;           srcname = os.path.join(src, name)&lt;br /&gt;           dstname = os.path.join(dst, name)&lt;br /&gt;           &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;try&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;               &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; symlinks &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;and&lt;/b&gt;&lt;/span&gt; os.path.islink(srcname):&lt;br /&gt;                   linkto = os.readlink(srcname)&lt;br /&gt;                   os.symlink(linkto, dstname)&lt;br /&gt;               &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;elif&lt;/b&gt;&lt;/span&gt; os.path.isdir(srcname):&lt;br /&gt;                   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; self.filterDir(srcname):&lt;br /&gt;                       self.copytree(srcname, dstname, symlinks)&lt;br /&gt;               &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;                   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; self.filter(srcname, dstname):&lt;br /&gt;                       shutil.copy2(srcname, dstname)&lt;br /&gt;                       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; srcname&lt;br /&gt;                       count += 1&lt;br /&gt;           &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;except&lt;/b&gt;&lt;/span&gt; (IOError, os.error), why:&lt;br /&gt;               &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;Can&#39;t copy %s to %s: %s&lt;/span&gt;&#34;%(&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;srcname&lt;/span&gt;&#39;, &#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;dstname&lt;/span&gt;&#39;, str(why))&lt;br /&gt;       self.count += count&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;LatestTreeCopier&lt;/span&gt;(TreeCopier):&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;__init__&lt;/span&gt;(self):&lt;br /&gt;       self.count = 0&lt;br /&gt;       self.excludePattern = re.compile(&lt;br /&gt;               &#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;(^\.svn.*|.*\.swp$|.*\.bak$|.*~$|.*\.swo$)&lt;/span&gt;&#39;,re.I)&lt;br /&gt;       self.excludeDirPattern = re.compile(&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;^\.svn.*&lt;/span&gt;&#39;,re.I)&lt;br /&gt;&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;filter&lt;/span&gt;(self, srcname, dstname):&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/span&gt; (&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;not&lt;/b&gt;&lt;/span&gt; self.excludePattern.match(os.path.basename(srcname)))&lt;br /&gt;               &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;and&lt;/b&gt;&lt;/span&gt; (os.path.getmtime(srcname) &amp;gt; os.path.getmtime(dstname))&lt;br /&gt;&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;def&lt;/b&gt;&lt;/span&gt; &lt;span style=&#34;color: rgb(0, 128, 128);&#34;&gt;filterDir&lt;/span&gt;(self, srcname):&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;return&lt;/b&gt;&lt;/span&gt; (&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;not&lt;/b&gt;&lt;/span&gt; self.excludeDirPattern.match(os.path.basename(srcname)))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; __name__ == &#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;__main__&lt;/span&gt;&#34;:&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;if&lt;/b&gt;&lt;/span&gt; (len(sys.argv)) &amp;gt;= 2:&lt;br /&gt;       methods = sys.argv[1:]&lt;br /&gt;       &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;for&lt;/b&gt;&lt;/span&gt; m &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;in&lt;/b&gt;&lt;/span&gt; methods:&lt;br /&gt;           method = m+&#39;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;()&lt;/span&gt;&#39;&lt;br /&gt;           &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;print&lt;/b&gt;&lt;/span&gt; &#34;&lt;span style=&#34;color: rgb(255, 0, 255);&#34;&gt;launching %s&lt;/span&gt;&#34; % method&lt;br /&gt;           eval(method)&lt;br /&gt;   &lt;span style=&#34;color: rgb(128, 64, 64);&#34;&gt;&lt;b&gt;else&lt;/b&gt;&lt;/span&gt;:&lt;br /&gt;       deploy()&lt;br /&gt;       reload()&lt;br /&gt;&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Java development without Ant</title>
				<link>https://31416.org/post/java-development-without-ant/</link>
				<pubDate>Tue, 12 Jul 2005 16:16:00 +0000</pubDate>
				<guid>https://31416.org/post/java-development-without-ant/</guid>
				<description>&lt;p&gt;When &lt;a href=&#34;http://jakarta.apache.org/ant&#34;&gt;Ant&lt;/a&gt; came out, I welcomed it. It was better than Makefiles for Java, it solved the path and classpath format difference between Windows and Linux, did not rely on shell programs. It did provide a platform independent way for building Java software. At that time, there was another alternative, &lt;a href=&#34;http://jmk.sourceforge.net&#34;&gt;JMK&lt;/a&gt; which had a lisp like syntax, and solved the same problems as Ant. But Ant was backed by apache, and this were the times of XML everywhere.&lt;!-- raw HTML omitted --&gt; I got more and more fed up with ant scripts over the years. During a long time you had to resort to an XML trick just to include other ant file, you did not have conditionals, but more importantly, it is quite a pain to write long ant scripts in XML. XML is not that good to write logic with, XSLT did not become as big as it could have been partly for this reason.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
