<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Chase the Devil</title>
    <link>https://chasethedevil.github.io/</link>
    <description>Recent content on Chase the Devil</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <copyright>Copyright 2006-2018 Fabien Le Floc&#39;h. This work is licensed under a Creative Commons Attribution 4.0 International License.</copyright>
    <lastBuildDate>Sat, 30 May 2026 03:43:00 +0000</lastBuildDate>
    <atom:link href="https://chasethedevil.github.io/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Role of Erfcx and Erfc in the Black-Scholes Formula</title>
      <link>https://chasethedevil.github.io/post/black-formula-erfcx-erfc-backends/</link>
      <pubDate>Sat, 30 May 2026 03:43:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/erfcx-cody-commons-johnson/</link>
      <pubDate>Sun, 24 May 2026 03:43:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/erfcx-cody-commons-johnson/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://chasethedevil.github.io/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://chasethedevil.github.io/post/a-faster-monotone-implied-volatility-solver/</link>
      <pubDate>Sat, 23 May 2026 03:43:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Almost Explicit Implied Volatility</title>
      <link>https://chasethedevil.github.io/post/almost-explicit-implied-volatility/</link>
      <pubDate>Thu, 30 Apr 2026 18:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/almost-explicit-implied-volatility/</guid>
      <description>&lt;p&gt;Several years ago, &lt;a href=&#34;https://chasethedevil.github.io/post/fast-and-accurate-implied-volatility-solver/&#34;&gt;I had explored&lt;/a&gt; accuracy and performance of different ways to imply the Black-Scholes volatility. Jherek Healy proposed some improvements over my naive algorithm on &lt;a href=&#34;https://jherekhealy.github.io/blog/post/implied_volatility_algorithms_go_julia/&#34;&gt;his blog&lt;/a&gt;. Recently, a Linkedin post mentioned &lt;a href=&#34;https://arxiv.org/html/2604.24480v2&#34;&gt;a new paper from Wolfgang Schadner&lt;/a&gt; which presents an &lt;em&gt;almost&lt;/em&gt; explicit formula for the implied volatility. &lt;em&gt;Almost&lt;/em&gt; because it actually relies on some implementation of the quantile function for the inverse Gaussian distribution: it requires a specialized numerical algorithm in practice, such as the one from &lt;a href=&#34;https://arxiv.org/abs/1603.06687&#34;&gt;Giner and Smyth&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Owen Scrambling a la Burley</title>
      <link>https://chasethedevil.github.io/post/burley_owen_scrambling/</link>
      <pubDate>Thu, 08 Jan 2026 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/burley_owen_scrambling/</guid>
      <description>&lt;p&gt;In my &lt;a href=&#34;https://chasethedevil.github.io/post/owen_scrambling_in_quantlib/&#34;&gt;last post&lt;/a&gt;, I had a look at Quantlib implementation of a new scrambling method for Sobol due to&#xA;Brent Burley of Walt Disney Studios &lt;a href=&#34;https://jcgt.org/published/0009/04/01/paper.pdf&#34;&gt;Practical Hash-based Owen Scrambling&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Because it originates from the CG community, I had assumed that this was faster than the more classic scrambling &lt;a href=&#34;https://dl.acm.org/doi/10.1145/779359.779360&#34;&gt;ACM Algorithm 823&lt;/a&gt; by Hickernell and Hong. I was wrong. It may be faster for specific use cases, but in general it is (much) slower, especially for the kind of (quasi) Monte-Carlo simulation that we use in quantitative finance.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jack Audio in Opensuse Tumbleweed</title>
      <link>https://chasethedevil.github.io/post/jack_in_opensuse_tumbleweed/</link>
      <pubDate>Mon, 22 Dec 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/jack_in_opensuse_tumbleweed/</guid>
      <description>&lt;p&gt;I struggled a bit having &lt;a href=&#34;https://jackaudio.org/&#34;&gt;Jack Audio Connection Kit&lt;/a&gt; working in Opensuse Tumbleweed.&#xA;My error was to install the jack package. The solution is actually extremely simple: use pipewire-jack instead of jack.&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-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;sudo zypper in pipewire-jack qjackctl&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Owen Scrambling in Quantlib</title>
      <link>https://chasethedevil.github.io/post/owen_scrambling_in_quantlib/</link>
      <pubDate>Wed, 17 Dec 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/owen_scrambling_in_quantlib/</guid>
      <description>&lt;p&gt;The state of the art of Sobol scrambling has changed slightly recently, thanks to the paper from Brent Burley of Walt Disney Studios &lt;a href=&#34;https://jcgt.org/published/0009/04/01/paper.pdf&#34;&gt;Practical Hash-based Owen Scrambling&lt;/a&gt;.&#xA;Before that, &lt;a href=&#34;https://dl.acm.org/doi/10.1145/779359.779360&#34;&gt;ACM Algorithm 823&lt;/a&gt; by Hickernell and Hong was the usual reference. Brent Burley&amp;rsquo;s algorithm is &lt;strong&gt;supposedly&lt;/strong&gt; both faster and with better properties. In particular, it performs both shuffling and scrambling.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://quantlib.wordpress.com/2024/02/03/scrambled-sobol-sequences/&#34;&gt;Peter Caspers&lt;/a&gt; implemented the new algorithm in Quantlib. It&amp;rsquo;s neat to have some decent &lt;a href=&#34;https://github.com/lballabio/QuantLib/blob/master/ql/math/randomnumbers/burley2020sobolrsg.cpp&#34;&gt;implementation in CPP&lt;/a&gt;. In applying the algorithm of the paper, a few sub-optimal choices were made:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Deep Neural Networks and Julia</title>
      <link>https://chasethedevil.github.io/post/deep_neural_networks_and_julia/</link>
      <pubDate>Tue, 07 Oct 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/deep_neural_networks_and_julia/</guid>
      <description>&lt;p&gt;Recently, I have spent some time on simple neural networks. The idea is to employ them as universal function approximators for some problems appearing in quantitative finance. There are some great papers on it such as the one from &lt;a href=&#34;https://mathematicsinindustry.springeropen.com/articles/10.1186/s13362-019-0066-7&#34;&gt;Liu et al. (2019)&lt;/a&gt; or &lt;a href=&#34;https://arxiv.org/abs/1901.09647&#34;&gt;Horvath et al. (2019) Deep Learning Volatility&lt;/a&gt; or &lt;a href=&#34;https://arxiv.org/abs/2107.01611&#34;&gt;Rosenbaum &amp;amp; Zhang (2021)&lt;/a&gt;.&#xA;Incidentally, I met Liu back when I was finishing my PhD in TU Delft around 2020.&lt;/p&gt;&#xA;&lt;p&gt;I thought I would try out what Julia offers in terms of library for neural networks. Being a very trendy subject, and Julia a modern language for the scientific community, I had imagined the libraris to be of good quality (like the many I have been using in the past). Surprisingly, I was wrong.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stochastic Collocation - Old And New</title>
      <link>https://chasethedevil.github.io/post/stochastic_collocation_old_and_new/</link>
      <pubDate>Tue, 05 Aug 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/stochastic_collocation_old_and_new/</guid>
      <description>&lt;p&gt;Thomas Roos recently put a preprint on SSRN called &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5215592&#34;&gt;Simple, Flexible, Analytic, Arbitrage Free Volatility Interpolation&lt;/a&gt;. Being interested in the subject, I had a detailed look at it. It turns out that Thomas stumbled upon &lt;a href=&#34;https://www.mdpi.com/2227-9091/7/1/30&#34;&gt;spline stochastic collocation&lt;/a&gt; without realizing it.&lt;/p&gt;&#xA;&lt;p&gt;There are a few differences in his approach:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The optimization is on the x&amp;rsquo;s instead of the y&amp;rsquo;s, meaning the strike axis is fixed.&lt;/li&gt;&#xA;&lt;li&gt;An original approach to avoid spurious modes, although I would have liked more details on it, with concrete examples of the penalty. Penalties are often challenging to get right.&lt;/li&gt;&#xA;&lt;li&gt;A nice analysis of the asymptotic behavior in the wings, showing that an exponentially quadratic form for extrapolation corresponds to linear slopes in implied variance.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I had  also explored a fixed strike axis initially (even back in 2014 - I uploaded &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5381580&#34;&gt;some old notes on SSRN around this&lt;/a&gt;). I found it to be somewhat unstable back then, but it may well be that I did not put enough efforts into it, especially since optimizing the y&amp;rsquo;s instead of the x&amp;rsquo;s allowed for a straightforward use of B-splines, which is very attractive. It is very direct to impose monotonicity with B-splines.&lt;/p&gt;</description>
    </item>
    <item>
      <title>NUFFT and COS</title>
      <link>https://chasethedevil.github.io/post/nufft_and_cos/</link>
      <pubDate>Mon, 14 Jul 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/nufft_and_cos/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4335916&#34;&gt;Leif Andersen and Mark Lake&lt;/a&gt; recently proposed the use of Non-Uniform Fast Fourier Transform for option pricing via the characteristic function. Fourier techniques are most commonly used for pricing vanilla options under the Heston model, in order to calibrate the model. They can be applied to other models, typically with known characteristic function, but also with numerically solved characteristic function as in the rough Heston model, and to different kind of payoffs, for example variance/volatility swaps, options. The subject has been vastly explored already so what&amp;rsquo;s new with this paper?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Forward Variance Models and Calibration</title>
      <link>https://chasethedevil.github.io/post/forward-variance-models-and-calibration/</link>
      <pubDate>Sat, 21 Jun 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/forward-variance-models-and-calibration/</guid>
      <description>&lt;p&gt;The modern rough volatility models adopt a forward variance curve terminology (see for example &lt;a href=&#34;https://papers.ssrn.com/sol3/Delivery.cfm?abstractid=3191578&#34;&gt;this paper on a rational approximation for the rough Heston&lt;/a&gt;, or &lt;a href=&#34;https://mfe.baruch.cuny.edu/wp-content/uploads/2024/03/AFVPricingDevelopmentsQuantminds2022.pdf&#34;&gt;this presentation on affine forward variance models&lt;/a&gt; or &lt;a href=&#34;https://arxiv.org/pdf/1801.06416&#34;&gt;this paper on affine forward variance models&lt;/a&gt;). In this form, the rough Heston model reads:&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/rough_heston_eqn.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;According to the litterature, the initial forward variance curve is typically built from the implied volatilities through the variance swap replication: for each maturity, the price of a newly issued variance swap is computed to this maturity, using the implied volatilities for this maturity. Then we may compute the forward variance by interpolating linearly the variance swap prices and differentiating. This leads to the plot below.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Not So Great New Simulation Scheme for the Heston Model</title>
      <link>https://chasethedevil.github.io/post/not-so-great-new-scheme-heston/</link>
      <pubDate>Wed, 18 Jun 2025 22:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/not-so-great-new-scheme-heston/</guid>
      <description>&lt;p&gt;I recently saw a news about a great &lt;a href=&#34;https://arxiv.org/pdf/2412.11264&#34;&gt;new simulation scheme for the Heston model by Abi Jaber&lt;/a&gt;.&#xA;The paper suggests it is better than the popular alternatives such as the QE scheme of Leif Andersen. Reading it quickly, perhaps too quickly, I had the impression it would be more accurate especially when the number of time-steps is small.&lt;/p&gt;&#xA;&lt;p&gt;The scheme is simple to implement so I decided to spend a few minutes to try it out. I had some test example for the &lt;a href=&#34;https://chasethedevil.github.io/post/a-new-scheme-for-heston_part2/&#34;&gt;DVSS2X scheme&lt;/a&gt; pricing a vanilla at-the-money option with Heston parameters v0=0.04, kappa=0.5, theta=0.04, rho=-0.9, sigma=1.0, and a time to maturity of 10 years. I don&amp;rsquo;t remember exactly where those parameters come from, possibly from Andersen paper. My example was using 8 time-steps per year, which is not that much. And here are the results with 1M paths (using scrambled Sobol):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Expansions for the time-dependent Heston model: Useless?</title>
      <link>https://chasethedevil.github.io/post/useless-expansions-heston/</link>
      <pubDate>Sun, 01 Jun 2025 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/useless-expansions-heston/</guid>
      <description>&lt;p&gt;Fabrice Rouah wrote two books on the Heston model: one with C# and Matlab code, and one with VBA code. The two books are very similar. They are good in that they tackle most of the important points with the Heston model, from calibration to simulation. The calibration part (chapter 6) is a bit too short, it would have been great if it presented the actual difficulties with calibration in practice and went more in-depth with the techniques.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A New Asian Basket Spread Option Approximation</title>
      <link>https://chasethedevil.github.io/post/new_spread_option_approximation/</link>
      <pubDate>Tue, 22 Apr 2025 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/new_spread_option_approximation/</guid>
      <description>&lt;p&gt;Around 10 years ago, while reading the excellent paper of Etore and Gobet on &lt;a href=&#34;https://hal.science/hal-00507787v1/document&#34;&gt;stochastic Taylor expansions for the pricing of vanilla options with discrete (cash) dividends&lt;/a&gt;, I had the idea of a small improvement, by using &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2698283&#34;&gt;a more precise proxy&lt;/a&gt; for the Taylor expansion.&lt;/p&gt;&#xA;&lt;p&gt;More recently, I applied the idea to &lt;a href=&#34;https://arxiv.org/abs/2402.17684v1&#34;&gt;approximate arithmetic Asian options prices&lt;/a&gt; by using the geometric Asian option price as a proxy (with some adjustments). This worked surprisingly well, and is competitive with the best implementations of Curran approach to Asian options pricing. I quickly noticed that I could apply the same idea to &lt;a href=&#34;https://arxiv.org/abs/2402.17684&#34;&gt;approximate Basket option prices&lt;/a&gt;, and from it obtain another approximation for vanilla options with cash dividends through the &lt;a href=&#34;https://arxiv.org/abs/2106.12971&#34;&gt;mapping described by J. Healy&lt;/a&gt;. Interestingly the resulting approximation is the most accurate amongst all other approximations for cash dividends.&lt;/p&gt;</description>
    </item>
    <item>
      <title>LLMs Are Not Good For Basic Homework</title>
      <link>https://chasethedevil.github.io/post/llm_not_good_at_homework/</link>
      <pubDate>Thu, 06 Mar 2025 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/llm_not_good_at_homework/</guid>
      <description>&lt;p&gt;My 12 years old child recently had a presentation to do with 3 other children for school, the subject was food and health.&#xA;It was particularly difficult to organize the children and one of the children came with a full presentation with text, generated by an LLM (possibly corrected by the parents).&#xA;At first, I thought this was just cheating and completly useless. Furthermore, he failed to read properly the details of the subject, and much of it wasn&amp;rsquo;t relevant.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Calibrating Heston to Variance Swaps - a bad idea?</title>
      <link>https://chasethedevil.github.io/post/heston_variance_swap_calibration/</link>
      <pubDate>Tue, 11 Feb 2025 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/heston_variance_swap_calibration/</guid>
      <description>&lt;p&gt;An interesting idea to calibrate the Heston model in a more stable manner and reduce the calibration time is to make use of variance swap prices. Indeed, there is a simple formula for the theoretical price of a variance swap in the Heston model.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/heston_varswap_formula.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;It is not perfect since it approximates the variance swap price by the expectation of the integrated variance process over time. In particular it does not take into account eventual jumps (obviously), finiteness of replication, and discreteness of observations. But it may be good enough. Thanks to this formula, we can calibrate three parameters of the Heston model: the initial variance, the long-term mean variance, and the speed of mean reversion to the term-structure of variance swaps. We do not need market prices of variance swaps, we may simply use a replication based on market vanilla options prices, such as the model-free replication of Fukasawa.&lt;/p&gt;</description>
    </item>
    <item>
      <title>OpenSuse Tumbleweed to the Rescue</title>
      <link>https://chasethedevil.github.io/post/opensuse_tumbleweed/</link>
      <pubDate>Thu, 06 Feb 2025 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/opensuse_tumbleweed/</guid>
      <description>&lt;p&gt;I recently upgraded a desktop computer, and to my surprise, the new motherboard was not fully supported by most Linux distributions.&#xA;The main culprit was the network adapter, although the secure boot setup gave me lots of troubles as well. I had only a small usb key (2GB)&#xA;and most (all?) live distributions do not fit on 2GB anymore. With the exception of Ubuntu images, I did not manage to boot from USB hard drive where I dumped the live image ISO, due to Secure boot&#xA;related issues, even when disabling the feature or changing the settings in the BIOS. Using the small USB key worked with Secure boot enabled only.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Saving Us - Book Review</title>
      <link>https://chasethedevil.github.io/post/saving_us_book_review/</link>
      <pubDate>Sun, 13 Oct 2024 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/saving_us_book_review/</guid>
      <description>&lt;p&gt;I had the opportunity to receive a free book on climate change, through the company I am working for. I had not heard of that book before, it called &lt;em&gt;Saving Us&lt;/em&gt; and is written by an actual climate scientist (Katharine Hayhoe).&#xA;Unfortunately, written by does not mean that it is a scientific book, and it&amp;rsquo;s not. The author does not spend much effort explaining the physics or the reports, but focuses on how to convince people this is an important problem to tackle. It is mildly interesting at first, as it presents the problem from a psychological angle. But it becomes quickly repetitive. The method is always the same, connect with what&amp;rsquo;s important to an audience who initially rejects climate warming (mostly the phenomenon, sometimes proposals around it), and make them understand that climate warming plays a role in their life, in the very matters they care about. It is presented as a series of personal experiences of the author, a list of examples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Monotonicity of the Black-Scholes Option Prices in Practice</title>
      <link>https://chasethedevil.github.io/post/vol_monotonicity_in_practice/</link>
      <pubDate>Sun, 29 Sep 2024 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/vol_monotonicity_in_practice/</guid>
      <description>&lt;p&gt;It is well known that vanilla option prices must increase when we increase the implied volatility. Recently, a post on the Wilmott forums wondered about the true accuracy of Peter Jaeckel implied volatility solver, whether it was truely IEEE 754 compliant. In fact, the author noticed some inaccuracy in the option price itself. Unfortunately I can not reply to the forum, its login process does not seem to be working anymore, and so I am left to blog about it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Copilot vs ChatGPT on the Optimal Finite Difference Step-Size</title>
      <link>https://chasethedevil.github.io/post/copilot_vs_chatgpt_optimal_step_size/</link>
      <pubDate>Thu, 25 Jul 2024 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/copilot_vs_chatgpt_optimal_step_size/</guid>
      <description>&lt;p&gt;When computing the derivative of a function by finite difference, which step size is optimal? The answer depends on the kind of difference (forward, backward or central), and the degree of the derivative (first or second typically for finance).&lt;/p&gt;&#xA;&lt;p&gt;For the first derivative, the result is very quick to find (it&amp;rsquo;s on &lt;a href=&#34;https://en.wikipedia.org/wiki/Numerical_differentiation&#34;&gt;wikipedia&lt;/a&gt;). For the second derivative, it&amp;rsquo;s more challenging. The &lt;a href=&#34;https://paulklein.ca/newsite/teaching/Notes_NumericalDifferentiation.pdf&#34;&gt;Lecture Notes&lt;/a&gt; of Karen Kopecky provide an answer. I wonder if Copilot or ChatGPT would find a good solution to the question:&lt;/p&gt;</description>
    </item>
    <item>
      <title>News on the COS Method Truncation</title>
      <link>https://chasethedevil.github.io/post/cos_method_truncation/</link>
      <pubDate>Mon, 13 May 2024 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/cos_method_truncation/</guid>
      <description>&lt;p&gt;The COS method is a fast way to price vanilla European options under stochastic volatility models with a known characteristic function. There are alternatives, explored in &lt;a href=&#34;https://chasethedevil.github.io/post/the-cos-method-for-heston/&#34;&gt;previous&lt;/a&gt; &lt;a href=&#34;https://chasethedevil.github.io/post/attari-lord-kahl--cos-methods-comparison-on-heston/&#34;&gt;blog&lt;/a&gt; &lt;a href=&#34;https://chasethedevil.github.io/post/making-classic-heston-integration-faster-than-the-cos-method/&#34;&gt;posts&lt;/a&gt;. A main advantage of the COS method is its simplicity. But this comes at the expense of finding the correct values for the truncation level and the (associated) number of terms.&lt;/p&gt;&#xA;&lt;p&gt;A related issue of the COS method, or its more fancy wavelet cousin the SWIFT method, is to require a huge (&amp;gt;65K) number of points to reach a reasonable accuracy for some somewhat extreme choices of Heston parameters. I provide an example in &lt;a href=&#34;https://arxiv.org/abs/2401.01758&#34;&gt;a recent paper&lt;/a&gt; (see Section 5).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Variance Swap Term-Structure under Schobel-Zhu</title>
      <link>https://chasethedevil.github.io/post/unrealistic_variance_swaps_under_schobel_zhu/</link>
      <pubDate>Tue, 26 Mar 2024 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/unrealistic_variance_swaps_under_schobel_zhu/</guid>
      <description>&lt;p&gt;I never paid too much attention to it, but the term-structure of variance swaps is not always realistic under the Schobel-Zhu stochastic volatility model.&lt;/p&gt;&#xA;&lt;p&gt;This is not fundamentally the case with the Heston model, the Heston model is merely extremely limited to produce either a flat shape or a downward sloping exponential shape.&lt;/p&gt;&#xA;&lt;p&gt;Under the Schobel-Zhu model, the price of a newly issued variance swap reads&#xA;$$&#x9;V(T) = \left[\left(v_0-\theta\right)^2-\frac{\eta^2}{2\kappa}\right]\frac{1-e^{-2\kappa T}}{2\kappa T}+2\theta(v_0-\theta)\frac{1-e^{-\kappa T}}{\kappa T}+\theta^2+\frac{\eta^2}{2\kappa},,$$&#xA;where \( \eta \) is the vol of vol.&lt;/p&gt;</description>
    </item>
    <item>
      <title>New Basket Expansions and Cash Dividends</title>
      <link>https://chasethedevil.github.io/post/new_basket_approximation_and_cash_dividends/</link>
      <pubDate>Sat, 23 Mar 2024 09:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/new_basket_approximation_and_cash_dividends/</guid>
      <description>&lt;p&gt;In the &lt;a href=&#34;https://chasethedevil.github.io/post/new_asian_approximation/&#34;&gt;previous post&lt;/a&gt;, I presented a &lt;a href=&#34;https://arxiv.org/abs/2106.12971&#34;&gt;new stochastic expansion&lt;/a&gt; for the prices of Asian options. The stochastic expansion is generalized to basket options in the paper, and &lt;a href=&#34;https://arxiv.org/abs/2106.12971&#34;&gt;can thus be applied&lt;/a&gt; on the problem of pricing vanilla options with cash dividends.&lt;/p&gt;&#xA;&lt;p&gt;I have updated the paper with comparisons to more direct stochastic expansions for pricing vanilla options with cash dividends, such as the one of &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1687590&#34;&gt;Etoré and Gobet&lt;/a&gt;, and &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2698283&#34;&gt;my own refinement&lt;/a&gt; on it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>New Approximations for the Prices of Asian and basket Options</title>
      <link>https://chasethedevil.github.io/post/new_asian_approximation/</link>
      <pubDate>Sun, 17 Mar 2024 12:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/new_asian_approximation/</guid>
      <description>&lt;p&gt;Many years ago, I had &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2698283&#34;&gt;applied the stochastic expansion&lt;/a&gt; technique of &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1687590&#34;&gt;Etore and Gobet&lt;/a&gt; to a refined proxy, in order to produce more accurate prices for vanilla options with cash dividends under the Black-Scholes model with deterministic jumps at the dividend dates. Any approximation for vanilla basket option prices can also be applied on this problem, and the sophisticated Curran geometric conditioning was found to be particularly competitive in &lt;a href=&#34;https://arxiv.org/abs/2106.12971&#34;&gt;The Pricing of Vanilla Options with Cash Dividends as a Classic Vanilla Basket Option Problem&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Easy Mistake With the Log-Euler Discretization On Black-Scholes</title>
      <link>https://chasethedevil.github.io/post/logeuler_not_exact/</link>
      <pubDate>Mon, 11 Mar 2024 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/logeuler_not_exact/</guid>
      <description>&lt;p&gt;In the Black-Scholes model with a term-structure of volatilities, the Log-Euler Monte-Carlo scheme is not necessarily exact.&lt;/p&gt;&#xA;&lt;p&gt;This happens if you have two assets \(S_1\) and \(S_2\), with two different time varying volatilities \(\sigma_1(t), \sigma_2(t) \). The covariance from the Ito isometry from \(t=t_0\) to \(t=t_1\) reads $$ \int_{t_0}^{t_1} \sigma_1(s)\sigma_2(s) \rho ds, $$ while a naive log-Euler discretization may use&#xA;$$ \rho  \bar\sigma_1(t_0) \bar\sigma_2(t_0)  (t_1-t_0). $$&#xA;In practice, the \( \bar\sigma_i(t_0) \) are calibrated such that the vanilla option prices are exact, meaning&#xA;$$ \bar{\sigma}_i^2(t_0)(t_1-t_0) = \int_{t_0}^{t_1} \sigma_i^2(s) ds.$$&lt;/p&gt;</description>
    </item>
    <item>
      <title>Roughness of Pure Jumps</title>
      <link>https://chasethedevil.github.io/post/roughness_of_jumps/</link>
      <pubDate>Mon, 18 Dec 2023 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/roughness_of_jumps/</guid>
      <description>&lt;p&gt;In my previous &lt;a href=&#34;https://chasethedevil.github.io/post/roughness_of_stochastic_volatility/&#34;&gt;blog post&lt;/a&gt;, I looked at the roughness of the SVCJ stochastic volatility model with jumps (in the volatility). In this model, the jumps occur randomly, but at discrete times. And with typical parameters used in the litterature, the jumps are not so frequent. It is thus more interesting to look at the roughness of pure jump processes, such as the &lt;a href=&#34;https://engineering.nyu.edu/sites/default/files/2018-09/CarrJournalofBusiness2002.pdf&#34;&gt;CGMY process&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The CGMY process is more challenging to simulate. I used the approach based on the characteristic function described in &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1983134&#34;&gt;Simulating Levy Processes from Their Characteristic Functions and Financial Applications&lt;/a&gt;. Ballota and Kyriakou add some variations based on FFT pricing of the characteristic function in &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1951537&#34;&gt;Monte Carlo simulation of the CGMY process and option pricing&lt;/a&gt; and pay much care about a proper truncation range. Indeed, I found that the truncation range was key to simulate the process properly and not always trivial to set up especially for \(Y \in (0,1) \). I however did not  implement any automated range guess as I am merely interested in very specific use cases, and I used the COS method instead of FFT.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Roughness of Stochastic Volatility with Jumps</title>
      <link>https://chasethedevil.github.io/post/roughness_of_stochastic_volatility/</link>
      <pubDate>Thu, 07 Dec 2023 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/roughness_of_stochastic_volatility/</guid>
      <description>&lt;p&gt;I was wondering if adding jumps to stochastic volatility, as is done in the SVCJ model of Duffie, Singleton and Pan &lt;em&gt;&amp;ldquo;Transform Analysis and Asset Pricing for Affine Jump-Diffusion&amp;rdquo;&lt;/em&gt; also in Broadie and Kaya &lt;em&gt;&amp;ldquo;Exact simulation of stochastic volatility and other affine jump diffusion processes&amp;rdquo;&lt;/em&gt;, would lead to rougher paths, or if it would mislead the roughness estimators.&lt;/p&gt;&#xA;&lt;p&gt;The answer to the first question can almost be answered visually:&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/svcj_variance_path.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Measuring Roughness with Julia</title>
      <link>https://chasethedevil.github.io/post/measuring_roughness_with_julia/</link>
      <pubDate>Tue, 07 Nov 2023 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/measuring_roughness_with_julia/</guid>
      <description>&lt;p&gt;I received a few e-mails asking me for the code I used to measure roughness in my preprint on the &lt;a href=&#34;https://chasethedevil.github.io/post/implied_volatility_roughness&#34;&gt;roughness of the implied volatility&lt;/a&gt;. Unfortunately, the code I wrote for this paper is not in a &lt;em&gt;good&lt;/em&gt; state, it&amp;rsquo;s all in one long file line by line, not necessarily in order of execution, with comments that are only meaningful to myself.&lt;/p&gt;&#xA;&lt;p&gt;In this post I will present the code relevant to measuring the oxford man institute roughness with Julia. I won&amp;rsquo;t go into generating Heston or rough volatility model implied volatilities, and focus only on the measure on roughness based on some CSV like input. I downloaded the oxfordmanrealizedvolatilityindices.csv from the Oxford Man Institute website (unfortunately now discontinued, data bought by Refinitiv but still available in some github repos) to my home directory&lt;/p&gt;</description>
    </item>
    <item>
      <title>Black with Bachelier</title>
      <link>https://chasethedevil.github.io/post/black_with_bachelier/</link>
      <pubDate>Tue, 03 Oct 2023 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/black_with_bachelier/</guid>
      <description>&lt;p&gt;I was experimenting with the recent &lt;a href=&#34;https://www.researchgate.net/publication/348192007_SABR_for_Baskets&#34;&gt;SABR basket approximation&lt;/a&gt; of Hagan. The approximation only works&#xA;for the normal SABR model, meaning beta=0 in SABR combined with the Bachelier option formula.&lt;/p&gt;&#xA;&lt;p&gt;I was wondering how good the approximation would be for two flat smiles (in terms of Black volatilities). I then noticed something that escaped me before: the normal SABR model is able to fit the pure Black model (with constant vols) extremely well. A calibration near the money stays valid very out-of-the-money and the error in Black volatilities is very small.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Clenshaw-Curtis Quadrature Implementation by FFT in Practice</title>
      <link>https://chasethedevil.github.io/post/clenshaw_fft_implementation/</link>
      <pubDate>Wed, 27 Sep 2023 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/clenshaw_fft_implementation/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://en.wikipedia.org/wiki/Clenshaw%E2%80%93Curtis_quadrature&#34;&gt;Clenshaw-Curtis quadrature&lt;/a&gt; is known to be competitive with Gauss quadratures. It has several advantages:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the weights are easy and fast to compute.&lt;/li&gt;&#xA;&lt;li&gt;adaptive / doubling quadratures are possible with when the Chebyshev polynomial of the second kind is used for the quadrature.&lt;/li&gt;&#xA;&lt;li&gt;the Chebyshev nodes may also be used to interpolate some costly function.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The wikipedia article has a relatively detailed description on how to compute the quadrature weights corresponding to the Chebyshev polynomial of the second kind (where the points -1 and 1 are included), via a type-I DCT. It does not describe the weights corresponding to the Chebyshev polynomials of the first kind (where -1 and 1 are excluded, like the Gauss quadratures). &lt;a href=&#34;https://numbersandshapes.net/posts/high_precision_clenshaw_curtis/&#34;&gt;The numbersandshapes blog post&lt;/a&gt; describes it very nicely. There are some publications around computation of Clenshaw-Curtis or Fejer rules, a recent one is &lt;a href=&#34;https://www.sciencedirect.com/science/article/pii/S089812211200689X&#34;&gt;Fast construction of Fejér and Clenshaw–Curtis rules for general weight functions&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ghost Vacations</title>
      <link>https://chasethedevil.github.io/post/ghost_vacations/</link>
      <pubDate>Sun, 20 Aug 2023 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/ghost_vacations/</guid>
      <description>&lt;p&gt;During my vacation, I don&amp;rsquo;t know why, but I looked at some stability issue with ghost points and the explicit method. I was initially trying out ghost points with the explicit runge kutta Chebyshev/Legendre/Gegenbauer technique and noticed some explosion in some cases.&lt;/p&gt;&#xA;&lt;p&gt;I cornered it down to a stability issue of the standard explicit Euler method with ghost (or fictitious) points. The technique is described in the book &amp;ldquo;Paul Wilmott on Quantitative Finance&amp;rdquo; (also in Paul Wilmott introduces quantitative finance), which I find quite good, although I have some friends who are not much fond of it. The technique may be used to compute the price of a continuously monitored barrier option when the barrier does not fall on the grid, or more generally for time-dependent barriers. I however look at it in the simple context of a constant barrier in time.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maximum Implied Variance Slope</title>
      <link>https://chasethedevil.github.io/post/maximum_implied_variance_slope/</link>
      <pubDate>Mon, 22 May 2023 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/maximum_implied_variance_slope/</guid>
      <description>&lt;p&gt;The paper &lt;a href=&#34;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=2ahUKEwim__mNp4v_AhUPI0QIHfICCjEQFnoECBEQAQ&amp;amp;url=http%3A%2F%2Fmath.uchicago.edu%2F~rogerlee%2Fmoment.pdf&amp;amp;usg=AOvVaw36Aps9YuK7f3sovbO-KAOW&#34;&gt;The Moment Formula for Implied Volatility at Extreme Strikes&lt;/a&gt; by Roger Lee redefined how practioners extrapolate the implied volatility, by showing that the total implied variance can be at most linear in the wings, with a slope below 2.&lt;/p&gt;&#xA;&lt;p&gt;Shortly after, the SVI model of Jim Gatheral, with its linear wings, started to become popular.&lt;/p&gt;&#xA;&lt;p&gt;In a recent paper in collaboration with Winfried Koller, we show that the asymptotic bounds are usually overly optimistic. This is somewhat expected, as the bound only holds as the log-moneyness goes to infinity. What is less expected, is that, even at very large strikes (nearly up to the limit of what SVI allow numerically), we may happen to have arbitrages, even though the bounds are respected.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Return of the Arbitrage in the Perfect Volatility Surface</title>
      <link>https://chasethedevil.github.io/post/the_return_of_the_arbitrage/</link>
      <pubDate>Wed, 29 Mar 2023 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/the_return_of_the_arbitrage/</guid>
      <description>&lt;p&gt;In a Wilmott article from 2018 (Wilmott magazine no. 97) titled &amp;ldquo;Arbitrage in the perfect volatility surface&amp;rdquo;, Uwe Wystup points out some interesting issues on seemingly innocuous FX volatility surfaces:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a cubic spline tends to produce artificial peaks/modes in the density.&lt;/li&gt;&#xA;&lt;li&gt;SVI not arbitrage-free even on seemingly trivial input.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The examples provided are indeed great and the remarks very valid. There is more to it however:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a cubic spline on strikes or log-moneyness does not produce the artificial peak.&lt;/li&gt;&#xA;&lt;li&gt;SVI with a=0 is arbitrage-free on this example.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For the first point, the denominator of the Dupire formula in terms of the representation of total variance as a function of logmoneyness gives some clues as it constitues a vega scaled version of the probability density&#xA;with direct link to the total variance and its derivatives. In particular it is a  simple function of its value, first and second derivatives, without involving any non-linear function and the second derivative only appears as a linear term. As such a low order polynomial representation of the variance in log-moneyness may be adequate.&#xA;In contrast, the delta based representation introduces a strong non-linearity with the cumulative normal distribution function.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/audnzd_delta_spline_dens.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Splines on AUD/NZD 1w options.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Princeton Fintech and Quant conference of December 2022</title>
      <link>https://chasethedevil.github.io/post/princeton_fintech_conference/</link>
      <pubDate>Sun, 04 Dec 2022 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/princeton_fintech_conference/</guid>
      <description>&lt;p&gt;I recently presented my latest published paper &lt;a href=&#34;https://wilmott.com/wilmott-magazine-november-2022-issue/&#34;&gt;On the Bachelier implied volatility at extreme strikes&lt;/a&gt; at the Princeton Fintech and Quant conference.&#xA;The presenters were of quite various backgrounds. The first presentations were much more business oriented with lots of AI keywords, but relatively little technical content while the last presentation was&#xA;about parallel programming. Many were a pitch to recruit to employees.&lt;/p&gt;&#xA;&lt;p&gt;The diversity was interesting: it was refreshing to hear about quantitative finance from vastly different perspectives. The presentation from Morgan Stanley about &lt;a href=&#34;https://github.com/morganstanley/optimus-cirrus&#34;&gt;their scala annotation framework&lt;/a&gt; to ease up&#xA;parallel programming was enlightening. The main issue they were trying to solve is the necessity for all the boilerplate code to handle concurrency, caching, robustness, which obfuscates significantly the business logic in the code.&#xA;This is an old problem. Decades ago, rule engines were the trend for similar reasons. Using the example of pricing bonds, the presenters put very well forward the issues in evidence, issues that I found&#xA;very relevant.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Desktop Linux in 2022</title>
      <link>https://chasethedevil.github.io/post/linux-in-2022/</link>
      <pubDate>Wed, 26 Oct 2022 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/linux-in-2022/</guid>
      <description>&lt;p&gt;I have been a long time user of Fedora at work and have been happy quite happy about it. Around 6 months ago, I moved to Manjaro under VirtualBox in a Windows host, because the company imposes the use of a VPN client that does not run on Linux. It&amp;rsquo;s much less great for several reasons:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;VirtualBox makes everything graphics much slower. It is still way better than WSL2 as I found WSL2 to be a poor man&amp;rsquo;s Linux, where graphics is via some half broken X11 client for Windows. With VirtualBox, programming is ok, watching videos is not (you need to use the host for that). Something relatively neat is that the VM can be run on any other host, including a Linux host by just copying the vm file.&lt;/li&gt;&#xA;&lt;li&gt;I picked Manjaro out of curiosity and because it was perhaps faster/more optimized than Fedora. I don&amp;rsquo;t have too many issues with it. But I found out that the use of AUR packages would frequently break on upgrades. Futhermore, it is updated less frequently than Fedora, which is a bit surprising for a rolling release. I also installed it with ext4. With hindsight, I think both choices were poor, Fedora with brtfs is the way to go, or some Ubuntu variant.&lt;/li&gt;&#xA;&lt;li&gt;Work also imposes various antivirus programs which tend to always keep the cpu busy.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Overall I am still much more productive than with a raw Windows, which is surprisingly slow for many software development related tasks. Having to deal more with Windows showed me how slow the system is, and how poor the experience is. Before using it again (after many years completely off it), I had started thinking it was good (well, it does crash much less than back in the days).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Roughness of the Implied Volatility</title>
      <link>https://chasethedevil.github.io/post/implied_volatility_roughness/</link>
      <pubDate>Sat, 09 Jul 2022 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/implied_volatility_roughness/</guid>
      <description>&lt;p&gt;This is a follow up of my &lt;a href=&#34;https://chasethedevil.github.io/post/rough-volatility-or-not-a-review/&#34;&gt;previous post&lt;/a&gt; on rough volatility. I recently tried to reproduce the results of the paper &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4065951&#34;&gt;Rough Volatility: Fact or Artefact?&lt;/a&gt; as I was curious to apply the technique using different inputs. The 5-minutes SPX realized volatility is freely available in CSV format at the &lt;a href=&#34;https://realized.oxford-man.ox.ac.uk/data&#34;&gt;&#xA;Oxford-Man Institute of Quantitative Finance&lt;/a&gt; and it is thus relatively straightforward to reproduce the numbers presented in the paper.&lt;/p&gt;&#xA;&lt;p&gt;Using a sampling of K=75 and L=75*75, I obtain an rounghness index H=0.181. The paper uses K=70 and L = 70x70, and their Figure 19 of the paper states 0.187.&#xA;It turns out that there are more than L observations in the time-series, and, with K=70, I end up with a roughness index H=0.222 when I start from the first observation (year 2000), up to the observation L+1. But it is possible to slide this window and compute the roughness index at each starting point. The results are enlightening.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/roughness_spx_K70_oxford.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;SPX historical vol roughness index sliding estimate with K=70.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/roughness_density_spx_K70_oxford.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;density of SPX historical vol roughness index estimate with K=70. The mean is 0.158 with a standard deviation of 0.034&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Volatility: Rough or Not? A Short Review</title>
      <link>https://chasethedevil.github.io/post/rough-volatility-or-not-a-review/</link>
      <pubDate>Tue, 10 May 2022 17:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/rough-volatility-or-not-a-review/</guid>
      <description>&lt;p&gt;It is well-known that the assumption of constant volatility in the Black-Scholes model for pricing financial contracts is wrong and may lead&#xA;to serious mispricing, especially for any exotic derivative contracts.&#xA;A classic approach is to use a deterministic local volatility model to take into account the variation both in the time dimension and in the underlying asset price dimension. But&#xA;the model is still not realistic in terms of forward smile (the implied volatilities of forward starting options). A stochastic volatility component must be added to correct for it.&#xA;More recently, the concept of rough volatility emerged in many academic papers. Instead of using a classic Brownian motion for the stochastic volatility process,&#xA;a fractional Brownian motion is used. The idea of using a fractional Brownian motion for financial time-series can be traced back to Mandelbrot, but it is only relatively recently that it has been proposed for the volatility process (and not the stock process).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Monte-Carlo Parallelization: to vectorize or not?</title>
      <link>https://chasethedevil.github.io/post/monte-carlo-vectorization-or-not/</link>
      <pubDate>Sat, 09 Apr 2022 21:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/monte-carlo-vectorization-or-not/</guid>
      <description>&lt;p&gt;When writing a Monte-Carlo simulation to price financial derivative contracts, the most straightforward is to code a loop over the number of paths, in which each path is fully calculated. Inside the loop, a payoff function takes this path to compute the present value of the contract on the given path. The present values are recorded to lead to the Monte-Carlo statistics (mean, standard deviation).&#xA;I ignore here any eventual callability of the payoff which may still be addressed with some work-arounds in this setup. The idea can be schematized by the following go code:&#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-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#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;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;&lt;span style=&#34;color:#40a070&#34;&gt;0&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;&amp;lt;&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;numSimulations;&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;&#x9;&lt;/span&gt;pathGenerator.&lt;span style=&#34;color:#06287e&#34;&gt;ComputeNextPath&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;&amp;amp;&lt;/span&gt;path)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020&#34;&gt;//path contains an array of n time-steps of float64.&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;&#x9;&lt;/span&gt;pathEvaluator.&lt;span style=&#34;color:#06287e&#34;&gt;Evaluate&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;&amp;amp;&lt;/span&gt;path,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;output)&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;&#x9;&lt;/span&gt;statistics.&lt;span style=&#34;color:#06287e&#34;&gt;RecordValue&lt;/span&gt;(output)&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;A python programmer would likely not write a simulation this way, as the python code inside the large loop will not be fast. Instead, the python programmer will write a vectorized simulation, generating all paths at the same time.&#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-go&#34; data-lang=&#34;go&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pathGenerator.&lt;span style=&#34;color:#06287e&#34;&gt;ComputeAllPaths&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;&amp;amp;&lt;/span&gt;paths)&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#007020&#34;&gt;//paths contains an array of n time-steps of vectors of size numSimulations &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;pathEvaluator.&lt;span style=&#34;color:#06287e&#34;&gt;EvaluateAll&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;&amp;amp;&lt;/span&gt;paths,&lt;span style=&#34;color:#bbb&#34;&gt; &lt;/span&gt;output)&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;statistics.&lt;span style=&#34;color:#06287e&#34;&gt;RecordValues&lt;/span&gt;(output)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>More Automatic Differentiation Awkwardness</title>
      <link>https://chasethedevil.github.io/post/more-automatic-differentiation-awkwardness/</link>
      <pubDate>Tue, 04 Jan 2022 21:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/more-automatic-differentiation-awkwardness/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://quantsrus.github.io/post/exp_b_spline_collocation_autodiff/&#34;&gt;This blog post&lt;/a&gt; from Jherek Healy presents some not so obvious behavior of automatic differentiation, when a function is decomposed&#xA;into the product of two parts where one part goes to infinity and the other to zero, and we know the overall result must go to zero (or to some other specific number).&#xA;This decomposition may be relatively simple to handle for the value of the function, but becomes far less trivial to think of in advance, at the derivative level.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quadprog in Julia</title>
      <link>https://chasethedevil.github.io/post/quadprog-in-julia/</link>
      <pubDate>Sun, 21 Nov 2021 13:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/quadprog-in-julia/</guid>
      <description>&lt;p&gt;As described &lt;a href=&#34;https://en.wikipedia.org/wiki/Quadratic_programming&#34;&gt;on wikipedia&lt;/a&gt;, a quadratic programming problem with &lt;em&gt;n&lt;/em&gt; variables and &lt;em&gt;m&lt;/em&gt; constraints is of the  form&#xA;$$ \min(-d^T x + 1/2 x^T D x) $$ with the&#xA;constraints \( A^T x \geq b_0 \), were \(D\) is a \(n \times n\)-dimensional real symmetric matrix, \(A\) is a \(n \times m\)-dimensional real matrix, \( b_0 \) is a \(m\)-dimensional vector of constraints, \( d \) is a \(n\)-dimensional vector, and the variable \(x\) is a \(n\)-dimensional vector.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Positive Stochastic Collocation</title>
      <link>https://chasethedevil.github.io/post/positive_stochastic_collocation/</link>
      <pubDate>Tue, 31 Aug 2021 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/positive_stochastic_collocation/</guid>
      <description>&lt;p&gt;In the context of my thesis, I &lt;a href=&#34;https://arxiv.org/abs/2109.02405&#34;&gt;explored&lt;/a&gt; the use of stochastic collocation to capture the marginal densities of a positive asset.&#xA;Indeed, most financial asset prices must be non-negative. But the classic stochastic collocation towards the normally distributed random variable, is not.&lt;/p&gt;&#xA;&lt;p&gt;A simple tweak, proposed early on by Grzelak, is to assume absorption and use the put-call parity to price put options (which otherwise depend on the left tail).&#xA;This sort of works most of the time, but a priori, there is no guarantee that we will end up with a positive put option price.&#xA;As an extreme example, we may consider the case where the collocation price formula leads to  \(V_{\textsf{call}}(K=0) &amp;lt; f \) where  \(f \) is the forward price to maturity.&#xA;The put-call parity relation applied at  \(K=0 \) leads to  \(V_{\textsf{put}}(K=0) = V_{\textsf{call}}(K=0)-f &amp;lt; 0 \). This means that for some strictly positive strike, the put option price will be negative, which is non-sensical.&#xA;In reality, it thus implies that absorption must happen earlier, not at  \(S=0 \), but at some strictly positive asset price. And then it is not so obvious to chose the right value in advance.&lt;/p&gt;</description>
    </item>
    <item>
      <title>My Review of Steven Koonin&#39;s Book on Climate</title>
      <link>https://chasethedevil.github.io/post/koonin-on-climate-book-review/</link>
      <pubDate>Mon, 30 Aug 2021 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/koonin-on-climate-book-review/</guid>
      <description>&lt;p&gt;Steven Koonin, who was Secretary for Science, Department of Energy, in the Obama administration recently wrote a somewhat controversial book on climate science with the title &lt;em&gt;Unsettled&lt;/em&gt;.  I was curious to read what kind of critics a physicist who partly worked in the field had, even if I believe that climate warming is real, and humans have an influence on it. It turns out that some of his remarks regarding models are relevant way beyond climate science, but some other subjects are not as convincing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Github and SSH setup</title>
      <link>https://chasethedevil.github.io/post/github-and-ssh/</link>
      <pubDate>Mon, 16 Aug 2021 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/github-and-ssh/</guid>
      <description>&lt;p&gt;Github recently moved to support only ssh access via public/private keys. As I use github to host this blog, I was impacted.&lt;/p&gt;&#xA;&lt;p&gt;The setup on Linux is not very complicated, and relatively well documented on &lt;a href=&#34;https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent&#34;&gt;Github itself&lt;/a&gt; but all the steps are not listed in a simplistic manner, and some Google search is still required to find out how to setup multiple private keys for various different servers or different repos.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Covid-19 Fake News</title>
      <link>https://chasethedevil.github.io/post/covid19-fake-news/</link>
      <pubDate>Tue, 10 Aug 2021 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/covid19-fake-news/</guid>
      <description>&lt;p&gt;One thing that motivated me for vaccination is the fake news propaganda against the Covid-19 vaccines.&lt;/p&gt;&#xA;&lt;p&gt;A mild example relates to the data from Israel about the delta variant. &lt;a href=&#34;https://trialsitenews.com/covid-19-case-data-in-israel-a-troubling-trend/&#34;&gt;This kind of article&lt;/a&gt;, with the title &amp;ldquo;Covid 19 Case Data in Israel, a Troubling Trend&amp;rdquo;, puts emphasis on the doubts on the effectivness of the vaccine:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;the vaccine appears to have a negligible effect on an individual as to whether he/she catches the current strain. Moreover, the data indicates that the current vaccines used (Moderna, Pfizer-BioNTech, AstraZeneca) may have a decreasing effect on reduced hospitalizations and death if one does get infected with the Delta variant.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Are traditional banks ready for the 21st century?</title>
      <link>https://chasethedevil.github.io/post/are-tradional-banks-ready-for-the-21st/</link>
      <pubDate>Sat, 12 Jun 2021 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/are-tradional-banks-ready-for-the-21st/</guid>
      <description>&lt;p&gt;This is a follow up on my parents phishing scam.&lt;/p&gt;&#xA;&lt;p&gt;After several weeks, my parents and I were finally able to have a real world meeting with the advisor at the bank. The advisor is a young woman with an obvious background in sales.&lt;/p&gt;&#xA;&lt;p&gt;In order to process the paperwork around the reimbursement of the phishing scam, the main issue was the request of the original phishing e-mail by the bank, as my mother had deleted the e-mail. It turns out, that in Thunderbird, deleted e-mails are not deleted on disk until an operation of compactification of the mailbox is done. I was thus able to recover the deleted e-mail. Interestingly, the deleted e-mail was not in the trash file, but directly in the inbox file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Yesterday, Pirates Took Over My Parents Bank Account</title>
      <link>https://chasethedevil.github.io/post/yesterday-pirates-took-over-my-parents-bank-account/</link>
      <pubDate>Wed, 10 Mar 2021 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/yesterday-pirates-took-over-my-parents-bank-account/</guid>
      <description>&lt;p&gt;This is the story of their hack.&lt;/p&gt;&#xA;&lt;p&gt;Yesterday evening, I received a call from my mother, frantic over the phone. She says she sees alerts of withdrawals from her bank account on her phone, with new alerts every 5 minutes or so. I try to ask her if she clicked recently on some e-mail related to her bank. She is so panicked that I don&amp;rsquo;t manage to have an answer. While trying to understand if those alerts are real or not, my wife suggests immediately that my mother should call her bank. On the phone, I ask&lt;/p&gt;</description>
    </item>
    <item>
      <title>Remarkable Coincidences, Bad Book?</title>
      <link>https://chasethedevil.github.io/post/reghai_remarkable_coincidences/</link>
      <pubDate>Sat, 21 Nov 2020 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/reghai_remarkable_coincidences/</guid>
      <description>&lt;p&gt;I stumbled upon a new  short book &lt;a href=&#34;https://link.springer.com/book/10.1007%2F978-3-030-57496-3&#34;&gt;Financial Models in Production&lt;/a&gt; from O. Kettani and A. Reghai. A page attracted my attention&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/reghai_coincidences.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;A page from Kettani and Reghai&amp;#39;s book.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;This is the same example as I used on &lt;a href=&#34;https://chasethedevil.github.io/post/implied-volatility-from-black-scholes-price/&#34;&gt;my blog&lt;/a&gt;, where I also present the Li&amp;rsquo;s SOR method combined with the good initial guess from Stefanica. The idea has also been expanded on in &lt;a href=&#34;https://jherekhealy.github.io&#34;&gt;Jherek Healy&amp;rsquo;s book&lt;/a&gt;. What is shocking is that, beside reusing my example, &lt;strong&gt;they reuse my timing&lt;/strong&gt; for Jäckel and my implementation is in &lt;a href=&#34;https://golang.org&#34;&gt;Google Go&lt;/a&gt;, with a timing done on some older laptop. The numbers given are thus highly inconsistent. Of course, none of this is mentioned anywhere, and the book does not reference my blog.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bad papers and the roots of high degree polynomials</title>
      <link>https://chasethedevil.github.io/post/bad-papers-polynomial-roots/</link>
      <pubDate>Sat, 07 Nov 2020 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/bad-papers-polynomial-roots/</guid>
      <description>&lt;p&gt;I was wondering what were exactly the eigenvalues of the Mersenne-Twister random number generator transition matrix. An &lt;a href=&#34;https://arxiv.org/abs/1403.5355&#34;&gt;article&lt;/a&gt; by K. Savvidy sparked my interest on this.&#xA;This article mentioned a poor entropy (sum of log of eigenvalues amplitudes which are greater than 1), with eigenvalues falling almost on the unit circle.&lt;/p&gt;&#xA;&lt;p&gt;The eigenvalues are also the roots of the characteristic polynomial. It turns out, that for jumping ahead in the random number sequence, we use the characteristic polynomial. There is a twist however,&#xA;we use it in F2 (modulo 2), for entropy, we are interested in the characteristic polynomial in Z (no modulo), specified in Appendix A of &lt;a href=&#34;https://dl.acm.org/doi/10.1145/272991.272995&#34;&gt;the Mersenne-Twister paper&lt;/a&gt;. The roots of the two polynomials are of course very different.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Disaster Capitalism - Summer Reading Review</title>
      <link>https://chasethedevil.github.io/post/disaster-capitalism/</link>
      <pubDate>Fri, 06 Nov 2020 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/disaster-capitalism/</guid>
      <description>&lt;p&gt;Several years ago, I read the book &lt;em&gt;No Logo&lt;/em&gt; from Naomi Klein. I did not find it particularly good, but it did raise a valid concern overall.&#xA;This summer I read &lt;em&gt;Shock Therapy - The rise of disaster capitalism&lt;/em&gt;. It suffers from some of the same flaws as &lt;em&gt;No Logo&lt;/em&gt;, namely a lot of repetition of the same idea. Here, the underlying idea is that neoliberalism does not work in practice, and often ends up being some kind of corporatism. At the same time, it is suggested that some mild socialism is often much better for the people, although, the latter is not backed by concrete examples in the book. The former is backed by numerous documents, and is analyzed accross time and countries. It starts with Chili under Pinochet, the prototypical example that force is required to impose neoliberalism, then moves around South America in general, with some cases where a strong inflation, may be enough for the people to accept neoliberalism. Then it continues with China under Deng Xiao Ping, which I find a bit too much of a stretch to make a case about any kind of neoliberalism. Russia under Yeltsin is next, and it ends with the war in Irak and the USA.&lt;/p&gt;</description>
    </item>
    <item>
      <title>More on random number generators</title>
      <link>https://chasethedevil.github.io/post/more-on-random-number-generators/</link>
      <pubDate>Sat, 10 Oct 2020 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/more-on-random-number-generators/</guid>
      <description>&lt;p&gt;My &lt;a href=&#34;https://chasethedevil.github.io/post/war-of-the-random-number-generators/&#34;&gt;previous post&lt;/a&gt; described the recent view on random number generators, with a focus on the Mersenne-Twister war.&lt;/p&gt;&#xA;&lt;p&gt;Since, I have noticed another front in the war of the random number generators:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://arxiv.org/abs/1806.05243&#34;&gt;An example in dimension 121 from K Savvidy&lt;/a&gt; where L&amp;rsquo;Ecuyer MRG32k3a fails to compute the correct result, regardless of the seed. This is a manufactured example, such that the vector, used in the example, falls in the dual lattice of the generator. Similar examples can be constructed for other variants.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://pubsonline.informs.org/doi/abs/10.1287/ijoc.2018.0878&#34;&gt;Spectral Analysis of the MIXMAX Random Number Generator&lt;/a&gt; (by L&amp;rsquo;Ecuyer et al.) shows defects in MIXMAX, for some parameters that were advised in earlier papers of K. Savvidy. MIXMAX is a RNG popularized by K. Savvidy, used &lt;a href=&#34;https://cdcvs.fnal.gov/redmine/projects/g4/wiki/RNDM-Geant4104&#34;&gt;in CLHEP at Fermilab&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Also, I found interesting that Monte-Carlo simulations run at the Los Alamos National Laboratory relied on a relatively simple linear congruential generator (LCG) producing 24- or 48-bits integers &lt;a href=&#34;https://mcnp.lanl.gov/pdf_files/la-ur-11-04859.pdf&#34;&gt;for at least 40 years&lt;/a&gt;. LCGs are today touted as some of the worst random number generators, exhibiting strong patterns in 2D projections. Also the period chosen was very small by today&amp;rsquo;s standards: 7E13.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The war of the random number generators</title>
      <link>https://chasethedevil.github.io/post/war-of-the-random-number-generators/</link>
      <pubDate>Thu, 17 Sep 2020 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/war-of-the-random-number-generators/</guid>
      <description>&lt;p&gt;These days, there seems to be some sort of small war to define what is a modern good random number generators to advise for simulations.&#xA;Historically, the Mersenne-Twister (MT thereafter) won this war. It is used by default in many scientific libraries and software, even if there has been a few issues with it:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A bad initial seed may make it generate a sequence of low quality for at least as many as 700K numbers.&lt;/li&gt;&#xA;&lt;li&gt;It is slow to jump-ahead, making parallelization not so practical.&lt;/li&gt;&#xA;&lt;li&gt;It fails some TestU01 Bigcrush tests, mostly related to the F2 linear algebra, the algebra of the Mersenne-Twister.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;It turns out, that before MT (1997), a lot of the alternatives were much worse, except, perhaps, &lt;a href=&#34;https://arxiv.org/abs/hep-lat/9309020&#34;&gt;RANLUX&lt;/a&gt; (1993), which is quite slow due to the need of skipping many points of the generated sequence.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sobol with 64-bits integers</title>
      <link>https://chasethedevil.github.io/post/sobol-64-bits/</link>
      <pubDate>Wed, 09 Sep 2020 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/sobol-64-bits/</guid>
      <description>&lt;p&gt;A while ago, I wondered how to make some implementation of Sobol support 64-bits integers (long) and double floating points. &lt;a href=&#34;https://en.wikipedia.org/wiki/Sobol_sequence&#34;&gt;Sobol&lt;/a&gt; is the most used&#xA;quasi random number generator (QRNG) for (quasi) Monte-Carlo simulations.&lt;/p&gt;&#xA;&lt;p&gt;The standard Sobol algorithms are all coded with 32-bits integers and lead to double floating point numbers which can not be smaller than&#xA;\( 2^{-31} \). I was recently looking back at the internals at Sobol generators, and noticed that generating with 64-bits integers would not help much.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Intel failure and the future of computing</title>
      <link>https://chasethedevil.github.io/post/intel-failures-and-the-future/</link>
      <pubDate>Fri, 24 Jul 2020 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/intel-failures-and-the-future/</guid>
      <description>&lt;p&gt;What has been happening to the INTC stock today may be revealing of the future. The stock dropped more than 16%, mainly because they announced that their 7nm process does not work (well) and they may rely on an external foundry for their processors. Initially, in 2015, they thought they would have 8nm process by 2017, and 7nm by 2018. They are more than 3 years late.&lt;/p&gt;&#xA;&lt;p&gt;Intel used to be a leader in the manufacturing process for microprocessor. While the company has its share of internal problems, it may also be that we are starting to hit the barrier, where it becomes very difficult to improve on the existing. The end of Moore’s law has been announced many times, it was already a subject 20 years ago. Today, it may be real, if there is only a single company capable of manufacturing processor using a 5nm process (TSMC).&lt;/p&gt;</description>
    </item>
    <item>
      <title>March 9, 2020 crash - where will CAC40 go?</title>
      <link>https://chasethedevil.github.io/post/mar9-cac40-crash/</link>
      <pubDate>Mon, 09 Mar 2020 21:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/mar9-cac40-crash/</guid>
      <description>&lt;p&gt;The stock market crashed by more than 7% on March 9, 2020. It is one of the most important drop since September 2001.&#xA;I looked at BNP warrant prices on the CAC40 French index, with a maturity of March 20, 2020 , to see what they would tell about the market direction on the day of the crash. This is really a not-so-scientific experiment.&lt;/p&gt;&#xA;&lt;p&gt;The quotes I got were quite noisy. I applied a few different techniques to imply the probability density from the option prices:&lt;/p&gt;</description>
    </item>
    <item>
      <title>42</title>
      <link>https://chasethedevil.github.io/post/42/</link>
      <pubDate>Thu, 05 Dec 2019 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/42/</guid>
      <description>&lt;p&gt;Today my 6-years old son came with a math homework. The stated goal was to learn the different ways to make 10 out of smaller numbers. I was impressed. Immediately, I wondered&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;how many ways are there to make 10 out of smaller numbers?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This is one of the beauties of maths: a very simple problem, which a 6-years old can understand, may actually be quite fundamental. If you want to solve this in the general case, for any number instead of 10, you end up with the &lt;a href=&#34;https://en.wikipedia.org/wiki/Partition_(number_theory)#Restricted_part_size_or_number_of_parts&#34;&gt;partition function&lt;/a&gt;. And in order to find this, you will probably learn recurrence relations. So what is the answer for 10?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Numba, Pypy Overrated?</title>
      <link>https://chasethedevil.github.io/post/python-numba-overrated/</link>
      <pubDate>Tue, 12 Feb 2019 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/python-numba-overrated/</guid>
      <description>&lt;p&gt;Many benchmarks show impressive performance gains with the use&#xA;of &lt;a href=&#34;https://numba.pydata.org/&#34;&gt;Numba&lt;/a&gt; or &lt;a href=&#34;https://www.pypy.org/&#34;&gt;Pypy&lt;/a&gt;. Numba allows to compile just-in-time some specific methods, while Pypy takes&#xA;the approach of compiling/optimizing the full python program: you use it just like the standard&#xA;python runtime. From those benchmarks, I imagined that those  tools would improve my 2D Heston PDE solver&#xA;performance easily. The initialization part of my program contains embedded for loops over several 10Ks elements.&#xA;To my surprise, numba did not improve anything (and I had to isolate the code, as it would&#xA;not work on 2D numpy arrays manipulations that are vectorized). I surmise it does not play well&#xA;with scipy sparse matrices.&#xA;Pypy did not behave better, the solver became actually slower than with the standard python&#xA;interpreter, up to twice as slow, for example, in the case of the main solver loop which only does matrix multiplications and LU solves sparse systems. I did not necessarily expect any performance improvement in this specific loop, since it only consists in a few calls to expensive scipy calculations. But I did not expect a 2x performance drop either.&lt;/p&gt;</description>
    </item>
    <item>
      <title>About</title>
      <link>https://chasethedevil.github.io/about/</link>
      <pubDate>Mon, 17 Dec 2018 10:05:07 +0100</pubDate>
      <guid>https://chasethedevil.github.io/about/</guid>
      <description>&lt;p&gt;I just moved my blog to a static website, created with &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt;, I explain the reasons why &lt;a href=&#34;https://chasethedevil.github.io/post/moved-to-hugo/&#34;&gt;here&lt;/a&gt;.&#xA;You can find more about me on my &lt;a href=&#34;https://fr.linkedin.com/in/fabien-le-floc-h-8aa306&#34;&gt;linkedin profile&lt;/a&gt;.&#xA;In addition you might find the following interesting:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1514784&#34;&gt;List of quantitative finance papers&lt;/a&gt; I have freely available on SSRN&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://chasethedevil.github.io/lefloch_trbdf2_draft.pdf&#34;&gt;TR-BDF2 for Stable American Option Pricing&lt;/a&gt;. This is the first draft, not the final version that was published in the Journal of Computational Finance.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://chasethedevil.github.io/lefloch_sabr_slides.pdf&#34;&gt;Presentation on finite difference techniques for arbitrage-free SABR&lt;/a&gt; I gave at the conference on models and numerics in financial mathematics at the Lorentz center in 2015.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://chasethedevil.github.io/lefloch_exact_log.pdf&#34;&gt;Exact Forward for Finite-Difference Schemes on the Log-transformed Black-Scholes PDE&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://chasethedevil.github.io/lefloch_volatility_asymptotics.pdf&#34;&gt;Asymptotic bounds of the normal volatility&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Fixing NaNs in Quadprog</title>
      <link>https://chasethedevil.github.io/post/quadprog-nans/</link>
      <pubDate>Sun, 07 Oct 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/quadprog-nans/</guid>
      <description>&lt;p&gt;Out of curiosity, I tried &lt;a href=&#34;https://github.com/cran/quadprog&#34;&gt;quadprog&lt;/a&gt; as &lt;a href=&#34;https://quantsrus.github.io/post/state_of_convex_quadratic_programming_solvers/&#34;&gt;open-source quadratic programming convex optimizer&lt;/a&gt;, as it is looks fast, and the code stays relatively simple. I however stumbled on cases where the algorithm would return NaNs even though my inputs seemed straighforward. Other libraries such as CVXOPT did not have any issues with those inputs.&lt;/p&gt;&#xA;&lt;p&gt;Searching on the web, I found that I was not the only one to stumble on this kind of issue with quadprog. In particular, in 2014, Benjamen Tyner &lt;a href=&#34;http://r.789695.n4.nabble.com/quadprog-solve-QP-sometimes-returns-NaNs-td4697548.html&#34;&gt;gave a simple example in R&lt;/a&gt;, where solve.QP returns NaNs while the input is very simple: an identity matrix with small perturbations out of the diagonal. Here is a copy of his example:&lt;/p&gt;</description>
    </item>
    <item>
      <title>On the Probability of a Netflix Stock Crash</title>
      <link>https://chasethedevil.github.io/post/nflx-stock-crash-probability/</link>
      <pubDate>Thu, 12 Jul 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/nflx-stock-crash-probability/</guid>
      <description>&lt;p&gt;This is a follow up to my &lt;a href=&#34;https://chasethedevil.github.io/post/tsla-stock-crash-probability&#34;&gt;previous post&lt;/a&gt; where I explore the probability&#xA;of a TSLA stock crash, reproducing the &lt;a href=&#34;https://www.linkedin.com/pulse/options-market-thinks-16-chance-tesla-exist-january-2020-klassen/?lipi=urn%3Ali%3Apage%3Ad_flagship3_feed%3BaOfn2Xf6RIum6%2F9ddKS9fA%3D%3D&#34;&gt;results of Timothy Klassen&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;According to the implied cumulative probability density, TSLA has around 15% chance of crashing below $100. Is this really&#xA;high compared to other stocks? or is it the interpretation of the data erroneous?&lt;/p&gt;&#xA;&lt;p&gt;Here I take a look at NFLX (Netflix). Below is the implied volatility according to three different models.&lt;/p&gt;</description>
    </item>
    <item>
      <title>On the Probability of a TSLA Stock Crash</title>
      <link>https://chasethedevil.github.io/post/tsla-stock-crash-probability/</link>
      <pubDate>Wed, 11 Jul 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/tsla-stock-crash-probability/</guid>
      <description>&lt;p&gt;Timothy Klassen had an &lt;a href=&#34;https://www.linkedin.com/pulse/options-market-thinks-16-chance-tesla-exist-january-2020-klassen/?lipi=urn%3Ali%3Apage%3Ad_flagship3_feed%3BaOfn2Xf6RIum6%2F9ddKS9fA%3D%3D&#34;&gt;interesting post&lt;/a&gt; on linkedin recently, with the title &amp;ldquo;the options market thinks there is a 16% chance that Tesla will not exist in January 2020&amp;rdquo;.&#xA;As I was also recently looking at the TSLA options, I was a bit intrigued. I looked at the option chain on July 10th,&#xA;and implied the European volatility from the American option prices. I then fit a few of my favorite models: Andreasen-Huge with Tikhonov regularization, the lognormal mixture, and a polynomial collocation of degree 7.&#xA;This results in the following graph&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Fourth Moment of the Normal SABR Model</title>
      <link>https://chasethedevil.github.io/post/normal-sabr-fourth-moment/</link>
      <pubDate>Mon, 11 Jun 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/normal-sabr-fourth-moment/</guid>
      <description>&lt;p&gt;I was wondering if I could use the SABR moments to calibrate a model to SABR parameters directly. It turns out that the SABR moments have relatively&#xA;simple expressions when \(\beta=0\), that is, for the normal SABR model (with no absorption). This is for the pure SABR stochatic volatility model, not the Hagan approximation.&#xA;For the Hagan approximation, we would need to use the replication by vanilla options to compute the moments.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Implying the Probability Density from Market Option Prices (Part 2)</title>
      <link>https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices-ii/</link>
      <pubDate>Sun, 27 May 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices-ii/</guid>
      <description>&lt;p&gt;This is a follow-up to my posts on the implied risk-neutral density (RND) of the SPW options before and after the big volatility change that happened in early February with two different techniques:&#xA;&lt;a href=&#34;https://chasethedevil.github.io/post/spx500_bets_after_rates_hike/&#34;&gt;a smoothing spline on the implied volatilities&lt;/a&gt; and a &lt;a href=&#34;https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices/&#34;&gt;Gaussian kernel approach&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The Gaussian kernel (as well as to some extent the smoothing spline) let us believe that there are multiple modes in the distribution (multiple peaks in the density). In reality,&#xA;Gaussian kernel approaches will, by construction, tend to exhibit such modes. It is not so obvious to know if those are real or artificial. There are other ways to apply the Gaussian kernel,&#xA;for example by optimizing the nodes locations and the standard deviation of each Gaussian. The resulting density with those is very similar looking.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Senior Developers Don&#39;t Know OO Anymore</title>
      <link>https://chasethedevil.github.io/post/senior-developers-dont-know-oo-anymore/</link>
      <pubDate>Thu, 08 Mar 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/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>Implying the Probability Density from Market Option Prices</title>
      <link>https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices/</link>
      <pubDate>Tue, 13 Feb 2018 20:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/implying-the-probability-density-from-market-option-prices/</guid>
      <description>&lt;p&gt;In the &lt;a href=&#34;https://chasethedevil.github.io/post/spx500_bets_after_rates_hike/&#34;&gt;previous post&lt;/a&gt;, I showed a plot of the probability implied from SPW options before and after the big volatility change of last week.&#xA;I created it from a least squares spline fit of the market mid implied volatilities (weighted by the inverse of the bid-ask spread). While it looks reasonable, the underlying&#xA;technique is not very robust. It is particularly sensitive to the number of options strikes used as spline nodes.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Where is the S&amp;P 500 going to end?</title>
      <link>https://chasethedevil.github.io/post/spx500_bets_after_rates_hike/</link>
      <pubDate>Tue, 06 Feb 2018 19:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/spx500_bets_after_rates_hike/</guid>
      <description>&lt;p&gt;Yesterday the American stocks went a bit crazy along with the VIX that jumped from 17.50 to 38. It&amp;rsquo;s not exactly clear why, the news mention that the Fed might raise its interest rates, the bonds yield have been recently increasing substantially, and the market self-correcting&#xA;after stocks grew steadily for months in a low VIX environment.&lt;/p&gt;&#xA;&lt;p&gt;I don&amp;rsquo;t exactly follow the SPX/SPW options daily. But I had taken a snapshot two weeks ago when the market was quiet. We can imply the probability density from the market option prices.&#xA;It&amp;rsquo;s not an exact science. Here I do this with a least-squares spline on the implied volatilities (the least squares smoothes out the noise). I will show another approach in a subsequent post.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Discrete Sine Transform via the FFT</title>
      <link>https://chasethedevil.github.io/post/discrete_sine_transform_fft/</link>
      <pubDate>Mon, 05 Feb 2018 13:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/discrete_sine_transform_fft/</guid>
      <description>&lt;p&gt;Several months ago, I had a quick look at &lt;a href=&#34;https://papers.ssrn.com/sol3/Papers.cfm?abstract_id=2585529&#34;&gt;a recent paper&lt;/a&gt; describing how to use&#xA;Wavelets to price options under stochastic volatility models with a known characteristic function.&#xA;The more classic method is to use some numerical quadrature directly on the Fourier integral as described &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2362968&#34;&gt;in this paper&lt;/a&gt; for example.&#xA;When I read the paper, I was skeptical about the Wavelet approach, since it looked complicated, and with many additional parameters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quantitative Finance Books Citing My Papers</title>
      <link>https://chasethedevil.github.io/post/quantitative_finance_books/</link>
      <pubDate>Sat, 09 Dec 2017 13:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/quantitative_finance_books/</guid>
      <description>&lt;p&gt;I would have never really expected that when I started writing papers, but little by little there is a growing list of books citing &lt;a href=&#34;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1514784&#34;&gt;my papers&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.amazon.com/Applied-Quantitative-Finance-Equity-Derivatives/dp/1977557872/ref=sr_1_1?ie=UTF8&amp;amp;qid=1512751819&amp;amp;sr=8-1&amp;amp;keywords=jherek+healy&#34;&gt;Applied Quantitative Finance for Equity Derivatives&lt;/a&gt; by &lt;a href=&#34;https://jherekhealy.github.io&#34;&gt;Jherek Healy&lt;/a&gt;: the most recent book on equity derivatives refers to several of my papers. In contrast with many other books, the author goes beyond and provides additional insights on the papers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.amazon.com/Interest-Rate-Derivatives-Explained-Engineering/dp/1137360186/ref=sr_1_1?ie=UTF8&amp;amp;qid=1512825081&amp;amp;sr=8-1&amp;amp;keywords=Interest+Rate+Derivatives+Explained%3A+Volume+2%3A+Term+Structure+and+Volatility+Modelling&#34;&gt;Interest Rate Derivatives Explained: Volume 2: Term Structure and Volatility Modelling&lt;/a&gt; by Jörg Kienitz and Peter Casper. It refers to the paper &amp;ldquo;finite difference techniques for arbitrage-free SABR&amp;rdquo;, written in collaboration with Gary Kennedy.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.amazon.com/Interest-Rate-Derivatives-Explained-Engineering/dp/1137360062/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1512824387&amp;amp;sr=1-1&#34;&gt;Interest Rate Derivatives Explained: Volume 1: Products and Markets&lt;/a&gt; by Jörg Kienitz. It refers to my paper on curve interpolation (there is a mistake in the actual reference given inside the book,about arbitrage-free SABR, which unrelated to the text). I like how this book gives real world market data related to the products considered.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.amazon.com/Interest-Rate-Modelling-Multi-Curve-Framework/dp/1137374659/ref=sr_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1512825258&amp;amp;sr=1-1&amp;amp;keywords=henrard+interest&#34;&gt;Interest Rate Modelling in the Multi-Curve Framework: Foundations, Evolution and Implementation&lt;/a&gt; by &lt;a href=&#34;http://multi-curve-framework.blogspot.fr/&#34;&gt;Marc Henrard&lt;/a&gt;. It refers to the paper about yield curve interpolation. This is one of the rare books to present curve construction in depth.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;There are also some Springer books which are typically a collection of papers on a specific subject (which I find less interesting).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Google phones are overrated</title>
      <link>https://chasethedevil.github.io/post/google_phones_are_overrated/</link>
      <pubDate>Mon, 02 Oct 2017 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/google_phones_are_overrated/</guid>
      <description>&lt;p&gt;It is a relatively common belief that the vanilla Android experience is better, as it runs smoother. The Samsung Touchwiz is often blamed for making things slow and not more practical.&lt;/p&gt;&#xA;&lt;p&gt;I have had a Nexus 6 for a couple of years and I noticed the slowdowns after each update, up to a point where it sometimes took a few seconds to open the phone app, or to display the keyboard. I freed up storage, removed some apps but this did not make any difference. This is more or less the same experience that people have with the Samsung devices if &lt;a href=&#34;https://www.reddit.com/r/Android/comments/73necm/with_the_note_8_samsung_no_longer_delivers/&#34;&gt;reddit comments&lt;/a&gt; are to be believed.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SVN is dead</title>
      <link>https://chasethedevil.github.io/post/svn_is_dead/</link>
      <pubDate>Tue, 26 Sep 2017 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/svn_is_dead/</guid>
      <description>&lt;p&gt;A few years ago, when &lt;a href=&#34;https://git-scm.com/&#34;&gt;Git&lt;/a&gt; was rising fast and &lt;a href=&#34;https://subversion.apache.org/&#34;&gt;SVN&lt;/a&gt; was already not hype anymore, a friend thought that SVN was for many organizations better suited than Git, with the following classical arguments, which were sound at the time:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Who needs decentralization for a small team or a small company working together?&lt;/li&gt;&#xA;&lt;li&gt;‎SVN is proven, works well and is simple to use and put in place.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Each argument is in reality not so strong. It becomes clear now that Git is much more established.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Neural Network in Your CPU</title>
      <link>https://chasethedevil.github.io/post/the_neural_network_in_your_cpu/</link>
      <pubDate>Sun, 06 Aug 2017 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/the_neural_network_in_your_cpu/</guid>
      <description>&lt;p&gt;Machine learning and artificial intelligence are the current hype (again). In their new Ryzen processors, &lt;a href=&#34;http://www.anandtech.com/Gallery/Album/5197#18&#34;&gt;AMD advertises the Neural Net Prediction&lt;/a&gt;. It turns out this is was already used in their older (2012) Piledriver architecture used for example in the &lt;a href=&#34;http://www.anandtech.com/show/5831/amd-trinity-review-a10-4600m-a-new-hope&#34;&gt;AMD A10-4600M&lt;/a&gt;. It is also present in recent Samsung processors such as &lt;a href=&#34;https://www.theregister.co.uk/2016/08/22/samsung_m1_core/&#34;&gt;the one powering the Galaxy S7&lt;/a&gt;. What is it really?&lt;/p&gt;&#xA;&lt;p&gt;The basic idea can be traced to a paper from Daniel Jimenez and Calvin Lin &lt;a href=&#34;https://www.cs.utexas.edu/~lin/papers/hpca01.pdf&#34;&gt;&amp;ldquo;Dynamic Branch Prediction with Perceptrons&amp;rdquo;&lt;/a&gt;, more precisely described in the subsequent paper &lt;a href=&#34;http://taco.cse.tamu.edu/pdfs/tocs02.pdf&#34;&gt;&amp;ldquo;Neural methods for dynamic branch prediction&amp;rdquo;&lt;/a&gt;. Branches typically occur  in &lt;code&gt;if-then-else&lt;/code&gt; statements. &lt;a href=&#34;https://en.wikipedia.org/wiki/Branch_predictor&#34;&gt;Branch prediction&lt;/a&gt; consists in guessing which code branch, the &lt;code&gt;then&lt;/code&gt; or the &lt;code&gt;else&lt;/code&gt;, the code will execute, thus allowing to precompute the branch in parallel for faster evaluation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Benham disc in web canvas</title>
      <link>https://chasethedevil.github.io/post/benham_disc_in_web_canvas/</link>
      <pubDate>Mon, 10 Jul 2017 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/benham_disc_in_web_canvas/</guid>
      <description>&lt;p&gt;Around 15 years ago, I wrote a small Java applet to try and show the &lt;a href=&#34;https://en.wikipedia.org/wiki/Benham%27s_top&#34;&gt;Benham disk&lt;/a&gt; effect. Even back then applets were already passé and Flash would have been more appropriate. These days, no browser support Java applets anymore, and very few web users have Java installed. Flash also mostly disappeared. The &lt;a href=&#34;https://www.w3schools.com/html/html5_canvas.asp&#34;&gt;web canvas&lt;/a&gt; is today&amp;rsquo;s standard allowing to embbed animations in a web page.&#xA; &#xA;&#xA;This effect shows color perception from a succession of black and white pictures. It is a computer reproduction from the Benham disc with ideas borrowed from &#34;Pour La Science Avril/Juin 2003&#34;.&#xA;Using a delay between 40 and 60ms, the inner circle should appear &lt;font color=&#34;#770000&#34;&gt;red&lt;/font&gt;, the one in the middle &#xA;&lt;font color=&#34;#000077&#34;&gt;blue&lt;/font&gt; and the outer one &lt;font color=&#34;#007700&#34;&gt;green&lt;/font&gt;. When you reverse the rotation direction,&#xA;blue and red circles should be inverted.&#xA;&#xA;&lt;form&gt;&#xA;  Delay: &lt;input type=&#34;number&#34; name=&#34;delay&#34; value=&#34;60&#34; id=&#34;delayInput&#34;&gt; Reverse &lt;input type=&#34;checkbox&#34; value=&#34;false&#34; id=&#34;reverseInput&#34; onclick=&#34;javascript:reverse()&#34;&gt; &lt;input type=&#34;button&#34; value=&#34;Start&#34; onclick=&#34;javascript:startStop()&#34; id=&#34;startButton&#34;&gt;&#xA;&lt;/form&gt;&#xA;&#xA;&lt;canvas id=&#34;myCanvas&#34; width=&#34;480&#34; height=&#34;480&#34; style=&#34;border:1px solid #000000;&#34;&gt;&#xA;&lt;/canvas&gt; &#xA;&#xA;&lt;script type=&#34;text/javascript&#34;&gt;&#xA;var c = document.getElementById(&#34;myCanvas&#34;);&#xA;  c.style.width =&#39;100%&#39;;&#xA;  c.style.height=&#39;100%&#39;;&#xA;  // ...then set the internal size to match&#xA;  c.width  = c.offsetWidth;&#xA;  c.height = c.offsetWidth;&#xA;var x=c.width/2;&#xA;var y=x;&#xA;linewidth = c.width / 100;&#xA;var g = c.getContext(&#34;2d&#34;);&#xA;&#xA;function paintImage(g, x,y,startArcAngle) {&#xA;var radius = 0.9;&#xA;var r = radius*x; endAngle = 2*Math.PI/3+startArcAngle;&#xA;g.beginPath();&#xA;g.arc(x, y, r, Math.PI/3+startArcAngle, endAngle, false);&#xA;g.lineWidth = linewidth;&#xA;g.strokeStyle = &#34;black&#34;;&#xA;g.stroke();&#xA;&#xA;radius = 0.8; r = radius*x;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1, Math.PI/3+startArcAngle, endAngle, false);&#xA;g.stroke();&#xA;&#xA;radius = 0.7; r = radius*x;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1, Math.PI/3+startArcAngle, endAngle, false);&#xA;g.stroke();&#xA;&#xA;radius = 0.6; r = radius*x; endAngle = Math.PI/3+startArcAngle;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1, 0+startArcAngle, endAngle, false); &#xA;g.stroke();&#xA;&#xA;radius = 0.5; r = radius*x;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1, 0+startArcAngle, endAngle, false); &#xA;g.stroke();&#xA;&#xA;radius = 0.4; r = radius*x;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1, 0+startArcAngle, endAngle, false);&#xA;g.stroke();&#xA;&#xA;//  paintImage(g, startArcAngle, 60, 0.3); //red -180 to -60&#xA;radius = 0.3; r = radius*x; endAngle = Math.PI+startArcAngle;// if (endAngle &gt; Math.PI*2) endAngle = endAngle - 2*Math.PI &#xA;g.beginPath();&#xA;g.arc(x, y, r + 1,  2*Math.PI/3+startArcAngle, endAngle, false); &#xA;g.stroke();&#xA;        &#xA;radius = 0.2; r = radius*x;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1,  2*Math.PI/3+startArcAngle, endAngle, false); &#xA;g.stroke();&#xA;&#xA;radius = 0.1; r = radius*x;&#xA;g.beginPath();&#xA;g.arc(x, y, r + 1,  2*Math.PI/3+startArcAngle, endAngle, false); &#xA;g.stroke();&#xA;&#xA;g.beginPath();&#xA;g.arc(x, y, x,  Math.PI+startArcAngle, Math.PI*2+startArcAngle, false); &#xA;g.fill();&#xA;}&#xA;&#xA;var delay = 40;&#xA;var currentAnimate = 0;&#xA;var animationStartTime = window.performance.now();&#xA;var currentIndex = 3;&#xA;var angles = [0.0, 2*Math.PI/3, 4*Math.PI/3];&#xA;&#xA;var offscreenCanvas = [document.createElement(&#39;canvas&#39;),document.createElement(&#39;canvas&#39;),document.createElement(&#39;canvas&#39;)];&#xA;for (var i in offscreenCanvas) {&#xA;  offscreenCanvas[i].width = c.offsetWidth;&#xA;  offscreenCanvas[i].height = c.offsetWidth;&#xA;  g = offscreenCanvas[i].getContext(&#34;2d&#34;);&#xA;  paintImage(g, x, y, angles[i]);&#xA;}&#xA;g = c.getContext(&#34;2d&#34;);&#xA;&#xA;//function animate0() {&#xA;//  g.clearRect(0,0,c.width, c.height);&#xA;//  paintImage(g,x, y,  0.0);&#xA;//  currentAnimate = setTimeout(animate1, delay);&#xA;//}&#xA;//function animate1() {&#xA;//  g.clearRect(0,0,c.width, c.height);&#xA;//  paintImage(g,x, y,  2*Math.PI/3);&#xA;//  currentAnimate = setTimeout(animate2, delay);&#xA;//}&#xA;//function animate2() {&#xA;//  g.clearRect(0,0,c.width, c.height);&#xA;//  paintImage(g,x, y, 4*Math.PI/3);&#xA;//  currentAnimate= setTimeout(animate0, delay);&#xA;//}&#xA;&#xA;window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame ||&#xA;                              window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;&#xA;&#xA;&#xA;function animateContinuous(time) {&#xA;  var index = Math.floor(((time - animationStartTime) % (3*delay))/delay);&#xA;  if (index &lt; 0) index = 0&#xA;  if (index != currentIndex) {&#xA;    //g.clearRect(0,0,c.width, c.height);&#xA;    //paintImage(g, x, y, angles[index]);&#xA;    var offscreenContext = offscreenCanvas[index].getContext(&#39;2d&#39;);&#xA;    var image = offscreenContext.getImageData(0,0,c.width,c.height); &#xA;    g.putImageData(image, 0, 0);       &#xA;    currentIndex = index;&#xA;  }&#xA;  currentAnimate = requestAnimationFrame(animateContinuous);&#xA;}&#xA;&#xA;function reverse() {&#xA;  //tmp = angles[2]; angles[2] = angles[0]; angles[0] = tmp;&#xA;  tmp = offscreenCanvas[2]; offscreenCanvas[2] = offscreenCanvas[0]; offscreenCanvas[0] = tmp;&#xA;}&#xA;&#xA;function startStop() {&#xA;  var elem = document.getElementById(&#34;startButton&#34;);&#xA;  var delayElem = document.getElementById(&#34;delayInput&#34;);&#xA; if (elem.value==&#34;Stop&#34;) {&#xA;    elem.value = &#34;Start&#34;;&#xA;    //clearTimeout(currentAnimate);&#xA;    window.cancelAnimationFrame(currentAnimate);&#xA;    currentAnimate = 0;&#xA;  } else {&#xA;    elem.value = &#34;Stop&#34;;&#xA;    delay = delayElem.value;&#xA;    animationStartTime = window.performance.now();&#xA;    //animate0();&#xA;    currentAnimate = requestAnimationFrame(animateContinuous);&#xA;  }&#xA;}&#xA;&lt;/script&gt;&#xA;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blogs on Quantitative Finance</title>
      <link>https://chasethedevil.github.io/post/quantitative_finance_blogs/</link>
      <pubDate>Wed, 21 Jun 2017 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/quantitative_finance_blogs/</guid>
      <description>&lt;p&gt;There are not many blogs on quantitative finance that I read. Blogs are not so popular anymore with the advent of the various social networks (facebook, stackoverflow, google plus, reddit, &amp;hellip;). Here is a small list:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://www.clarusft.com/blog/&#34;&gt;Clarus FT&lt;/a&gt;: often interesting statistics on the swap market, clearing, plus the &lt;a href=&#34;https://www.clarusft.com/author/gary/&#34;&gt;more technical articles from Gary&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://quantsrus.github.io/&#34;&gt;Quants R Us&lt;/a&gt;: A relatively new blog with a promising starting post analyzing &lt;a href=&#34;https://quantsrus.github.io/post/andreasen_huge_spline/&#34;&gt;Andreasen-Huge one-step local-volatility algorithm with a Spline&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://quantlib.wordpress.com/author/petercaspers/&#34;&gt;Fooling around with Quantlib&lt;/a&gt;: the blog from Peter Caspers, also relevant  to non-Quantlib professionals has original insights such as &lt;a href=&#34;https://quantlib.wordpress.com/2015/09/19/smile-dynamics-by-densities/&#34;&gt;Smile dynamics by densities&lt;/a&gt; or the &lt;a href=&#34;https://quantlib.wordpress.com/2015/08/23/supernatural-libor-coupons/&#34;&gt;Supernatural Libor Coupons&lt;/a&gt;. Unfortunately it is not so active anymore.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.implementingquantlib.com&#34;&gt;Implementing Quantlib&lt;/a&gt;: the blog from Luigi Ballabio, which explains many of the design decisions in Quantlib. Very interesting for developer of financial libraries, see for example &lt;a href=&#34;http://www.implementingquantlib.com/2017/04/fd-solvers.html&#34;&gt;the fd solvers&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://hpcquantlib.wordpress.com/&#34;&gt;HPC Quantlib&lt;/a&gt; from Klaus Spanderen. Yes lots of quantlib blogs, but this one is actually not much focused on quantlib. It goes into great details about some numerical techniques, see for example the &lt;a href=&#34;https://hpcquantlib.wordpress.com/2017/05/07/newer-semi-analytic-heston-pricing-algorithms/&#34;&gt;analysis of Heston pricing algorithm&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://oxfordstrat.com/rd-blog/&#34;&gt;Oxford Strat&lt;/a&gt;. It is a different kind of subject: too many trading strategies but some interesting data, for example &lt;a href=&#34;http://oxfordstrat.com/data/global-market-correlations/&#34;&gt;global market correlations&lt;/a&gt; and &lt;a href=&#34;http://oxfordstrat.com/ideas/sharpe-ratio/&#34;&gt;ideas&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://forum.wilmott.com/&#34;&gt;Wilmott forums&lt;/a&gt; not a blog, but it sometimes (not often) has interesting discussions and can be a good way to connect.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Another way to find out what&amp;rsquo;s going on in the quantitative finance world is to scan regularly recent papers on &lt;a href=&#34;https://arxiv.org/list/q-fin/recent&#34;&gt;arxiv&lt;/a&gt;, &lt;a href=&#34;http://www.ssrn.com&#34;&gt;SSRN&lt;/a&gt; or the suggestions of &lt;a href=&#34;http://scholar.google.com&#34;&gt;Google scholar&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Typo in Hyman non-negative constraint - 28 years later</title>
      <link>https://chasethedevil.github.io/post/typo-in-hyman-non-negative-constraint/</link>
      <pubDate>Tue, 23 May 2017 23:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/typo-in-hyman-non-negative-constraint/</guid>
      <description>&lt;p&gt;In their paper &lt;a href=&#34;http://www.ams.org/journals/mcom/1989-52-186/S0025-5718-1989-0962209-1/S0025-5718-1989-0962209-1.pdf&#34;&gt;&amp;ldquo;Nonnegativity-, Monotonicity-, or Convexity-Preserving Cubic and Quintic Hermite Interpolation&amp;rdquo;&lt;/a&gt;, Dougherty, Edelman and Hyman present a simple filter on the first derivatives to maintain positivity of a cubic spline interpolant.&lt;/p&gt;&#xA;&lt;p&gt;Unfortunately, in their main formula for non-negativity, they made a typo: the equation (3.3) is not consistent with the equation (3.1): the  \( \Delta x_{i-1/2} \)  is interverted with  \( \Delta x_{i+1/2} \).&lt;/p&gt;&#xA;&lt;p&gt;It was not obvious to find out which equation was wrong since there is no proof in the paper. Fortunately, the proof is in the reference paper &lt;a href=&#34;http://epubs.siam.org/doi/abs/10.1137/0722023&#34;&gt;&amp;ldquo;Monotone piecewise bicubic interpolation&amp;rdquo;&lt;/a&gt; from Carlson and Fritsch and it is clear then that equation (3.1) is the correct one.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Implied Volatility from Black-Scholes price</title>
      <link>https://chasethedevil.github.io/post/implied-volatility-from-black-scholes-price/</link>
      <pubDate>Sun, 02 Apr 2017 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/implied-volatility-from-black-scholes-price/</guid>
      <description>&lt;p&gt;Dan Stefanica and Rados Radoicic propose a quite good initial guess in their very recent paper &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2908494&#34;&gt;An Explicit Implied Volatility Formula&lt;/a&gt;. Their formula is simple, fast to compute and results in an implied volatility guess with a relative error of less than 10%.&lt;/p&gt;&#xA;&lt;p&gt;It is more robust than the rational fraction from &lt;a href=&#34;https://mpra.ub.uni-muenchen.de/6867/1/MPRA_paper_6867.pdf&#34;&gt;Minquiang Li&lt;/a&gt;: his rational fraction is only valid for a fixed range of strikes and maturities. The new approximation is mathematically proved accurate across all strikes and all maturities. There is only the need to be careful in the numerical implementation with the case where the price is very small (a Taylor expansion of the variable C will be useful in this case).&lt;/p&gt;</description>
    </item>
    <item>
      <title>The VIX starts smiling</title>
      <link>https://chasethedevil.github.io/post/vix-starts-smiling/</link>
      <pubDate>Tue, 21 Mar 2017 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/vix-starts-smiling/</guid>
      <description>&lt;p&gt;The VIX implied volatilities used to look like a logarithmic function of the strikes. I don&amp;rsquo;t look at them often, but today, I noticed that the VIX had the start of a smile shape.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/vix_smile.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;1m VIX implied volatilities on March 21, 2017 with strictly positive volume.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Very few strikes trades below the VIX future level (12.9). All of this is likely because the VIX is unusually low: not many people are looking to trade it much lower.&lt;/p&gt;</description>
    </item>
    <item>
      <title>When SVI Breaks Down</title>
      <link>https://chasethedevil.github.io/post/when-svi-breaks-down/</link>
      <pubDate>Thu, 16 Mar 2017 07:56:42 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/when-svi-breaks-down/</guid>
      <description>&lt;p&gt;In order to fit the implied volatility smile of equity options, one of the most popular parameterization is Jim Gatheral&amp;rsquo;s SVI, which I have written about before &lt;a href=&#34;https://chasethedevil.github.io/post/another-svi-initial-guess/&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It turns out that in the current market conditions, SVI does not work well for short maturities. &lt;a href=&#34;http://www.optionistics.com/quotes/stock-option-chains/SPX&#34;&gt;SPX options&lt;/a&gt; expiring on March 24, 2017 (one week) offer a good example. I paid attention to include only options with non zero volume, that is options that are actually traded.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Brownian Bridge and Discrete Random Variables</title>
      <link>https://chasethedevil.github.io/post/brownian-bridge-and-discrete-sampling/</link>
      <pubDate>Thu, 26 Jan 2017 14:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/brownian-bridge-and-discrete-sampling/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://chasethedevil.github.io/post/a-new-scheme-for-heston&#34;&gt;new Heston discretisation scheme&lt;/a&gt; I wrote about a few weeks ago makes use&#xA;a discrete random variable matching the first five moments of the normal distribution instead of the usual&#xA;normally distributed random variable, computed via the inverse cumulative distribution function. Their discrete random&#xA;variable is:&#xA;$$\xi =&#x9;\sqrt{1-\frac{\sqrt{6}}{3}} \quad \text{ if } U_1 &amp;lt; 3,,$$&#xA;$$&#x9;\xi =-\sqrt{1-\frac{\sqrt{6}}{3}} \quad \text{ if } U_1 &amp;gt; 4,,$$&#xA;$$\xi =&#x9;\sqrt{1+\sqrt{6}} \quad \text{ if } U_1 = 3,,$$&#xA;$$\xi =&#x9;-\sqrt{1+\sqrt{6}} \quad \text{ if } U_1 = 4,,$$&#xA;with \(U_1 \in \{0,1,&amp;hellip;,7\}\)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Samsung Wireless Printer under Fedora 25</title>
      <link>https://chasethedevil.github.io/post/samsung_wireless_printer_fedora25/</link>
      <pubDate>Thu, 26 Jan 2017 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/samsung_wireless_printer_fedora25/</guid>
      <description>&lt;p&gt;This is a note for those who want to setup a Samsung wireless printer under Linux. It is quite simple,&#xA;&lt;a href=&#34;https://ubuntuforums.org/showthread.php?t=2263245&#34;&gt;this forum post&lt;/a&gt; helped me, the actual useful steps on Fedora 25 are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;download tar.gz linux driver from &lt;a href=&#34;http://www.samsungsetup.com/&#34;&gt;Samsung website&lt;/a&gt;. As root, unpack &amp;amp; install:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;tar xvzf SamsungPrinterInstaller.tar.gz &#xA;cd uld&#xA;./install.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;&#xA;&lt;li&gt;in the printer menu, lookup for the wireless key (8 digits),&lt;/li&gt;&#xA;&lt;li&gt;connect to the printer Wifi network with a computer using the wireless key,&lt;/li&gt;&#xA;&lt;li&gt;enter the network gateway IP, this is typically &lt;a href=&#34;http://192.168.3.1&#34;&gt;http://192.168.3.1&lt;/a&gt;,&lt;/li&gt;&#xA;&lt;li&gt;click on Login with user &amp;ldquo;admin&amp;rdquo; and password &amp;ldquo;sec00000&amp;rdquo;,&lt;/li&gt;&#xA;&lt;li&gt;open the network wifi settings and select &amp;ldquo;Easy Wi-Fi Settings&amp;rdquo;,&lt;/li&gt;&#xA;&lt;li&gt;connect back to your wireless network,&lt;/li&gt;&#xA;&lt;li&gt;add the network printer via the printer settings wizard, or alternatively through CUPS interface &lt;a href=&#34;http://localhost:631&#34;&gt;http://localhost:631&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;That&amp;rsquo;s it. Printer and scanner will then work on your local Wi-Fi network.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A new scheme for Heston - Part 2</title>
      <link>https://chasethedevil.github.io/post/a-new-scheme-for-heston_part2/</link>
      <pubDate>Mon, 23 Jan 2017 07:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/a-new-scheme-for-heston_part2/</guid>
      <description>&lt;p&gt;A couple weeks ago, I wrote about &lt;a href=&#34;https://chasethedevil.github.io/post/a-new-scheme-for-heston&#34;&gt;a new Heston discretisation scheme&lt;/a&gt; which was at least as accurate as Andersen QE scheme and faster, called DVSS2.&lt;/p&gt;&#xA;&lt;p&gt;It turns out that it does not behave very well on the following Vanilla forward start option example (which is quite benign).&#xA;The Heston parameters comes from a calibration to the market and are&lt;/p&gt;&#xA;&lt;p&gt;$$v_0= 0.0718, \kappa= 1.542, \theta= 0.0762, \sigma= 0.582, \rho= -0.352$$&lt;/p&gt;&#xA;&lt;p&gt;with a maturity of one year.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Power management and XFCE under Fedora 25</title>
      <link>https://chasethedevil.github.io/post/xfce_fedora25/</link>
      <pubDate>Thu, 19 Jan 2017 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/xfce_fedora25/</guid>
      <description>&lt;p&gt;The gnome shell has been crashing on me more regularly lately.&#xA;XFCE is a good and fast more tradional desktop, but, from past experiences,&#xA;it does not play well with power management if you only install it via&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;dnf install @xfce-desktop-environment&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;My typical experience is a black screen after resuming from suspend (sometimes, not always), or hibernate (always) and&#xA;most of the time I end up just rebooting. It turns out this is all caused by the interaction between the gdm login daemon and xfce. Moving&#xA;to the lightdm login daemon instead fixes those issues for Fedora 25:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Equivalence between floating-strike and fixed-strike Asian options</title>
      <link>https://chasethedevil.github.io/post/floating_strike_fixed_strike_asian_equivalence/</link>
      <pubDate>Wed, 18 Jan 2017 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/floating_strike_fixed_strike_asian_equivalence/</guid>
      <description>&lt;p&gt;Many papers present formulae to price Asian options in the Black-Scholes world only for the fixed strike Asian case, that is&#xA;a contract that pays \( \max(A-K,0)\) at maturity \(T\) where \(A = \sum_{i=0}^{n-1} w_i S(t_i) \) is the Asian average.&lt;/p&gt;&#xA;&lt;p&gt;More generally, this can be seen as the payoff of a Basket option where the underlyings are just the same asset but at different times.&#xA;And any Basket option formula can actually be used to price fixed-strike Asian options by letting the correlation correspond to the correlation between the asset at the averaging times&#xA;and the variances correspond to the variance at each averaging time. The basket approach allows then naturally for a term-structure of rates, dividends and volatilities.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bachelier Normal Volatility Asymptotics</title>
      <link>https://chasethedevil.github.io/post/normal_volatility_asymptotics/</link>
      <pubDate>Tue, 17 Jan 2017 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/normal_volatility_asymptotics/</guid>
      <description>&lt;p&gt;It is relatively well known that the Black-Scholes volatility can not grow faster than \(\sqrt{\ln(K)}\).&#xA;The rule is also sometimes simply stated as &amp;ldquo;the implied variance can not grow faster than linear&amp;rdquo; (in log-moneyness).&#xA;The proof comes from Roger Lee &lt;a href=&#34;http://math.uchicago.edu/~rogerlee/moment.pdf&#34;&gt;&amp;ldquo;The moment formula for implied volatility at extreme strikes&amp;rdquo;&lt;/a&gt; but the rule was suggested&#xA;earlier, for example in Hodge&amp;rsquo;s paper from 1996 &lt;a href=&#34;http://www.iijournals.com/doi/pdfplus/10.3905/jod.1996.407950&#34;&gt;&amp;ldquo;Arbitrage bounds of the implied volatility strike and term structures of European-style options&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A new scheme for Heston</title>
      <link>https://chasethedevil.github.io/post/a-new-scheme-for-heston/</link>
      <pubDate>Fri, 06 Jan 2017 07:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/a-new-scheme-for-heston/</guid>
      <description>&lt;p&gt;I stumbled recently upon a new Heston discretisation scheme, in the spirit of Alfonsi, not more complex and more accurate.&lt;/p&gt;&#xA;&lt;p&gt;My first attempt at coding the scheme resulted in a miserable failure even though the described algorithm looked&#xA;not too difficult. I started wondering if &lt;a href=&#34;http://gs.elaba.lt/object/elaba:18270166/18270166.pdf&#34;&gt;the paper&lt;/a&gt;, from a little known Lithuanian mathematical journal, was any good.&#xA;Still, the math in it is very well written, with a great emphasis on the settings for each proposition.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Andreasen-Huge interpolation - Don&#39;t stay flat</title>
      <link>https://chasethedevil.github.io/post/dont-stay-flat-with-andreasen-huge-interpolation/</link>
      <pubDate>Tue, 13 Dec 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/dont-stay-flat-with-andreasen-huge-interpolation/</guid>
      <description>&lt;p&gt;Jesper Andreasen and Brian Huge propose an arbitrage-free interpolation method&#xA;based on a single-step forward Dupire PDE solution in their paper &lt;a href=&#34;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1694972&#34;&gt;Volatility interpolation&lt;/a&gt;.&#xA;To do so, they consider a piecewise constant representation of the local volatility in maturity time and strike&#xA;where the number of constants matches the number of market option prices.&lt;/p&gt;&#xA;&lt;p&gt;An interesting example that shows some limits to the technique as described in Jesper Andreasen and Brian Huge paper comes from&#xA;Nabil Kahale paper on &lt;a href=&#34;https://www.researchgate.net/profile/Nabil_Kahale/publication/228872089_An_Arbitrage-free_Interpolation_of_Volatilities/links/0c96053b56097decd5000000.pdf&#34;&gt;an arbitrage-free interpolation of volatilities&lt;/a&gt;.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/kahale_spx500_1995.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;option volatilities for the SPX500 in October 1995.&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Put-Call parity and the log-transformed Black-Scholes PDE</title>
      <link>https://chasethedevil.github.io/post/put_call_parity_with_log_transformed_pde/</link>
      <pubDate>Mon, 05 Dec 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/put_call_parity_with_log_transformed_pde/</guid>
      <description>&lt;p&gt;We will assume zero interest rates and no dividends on the asset \(S\) for clarity.&#xA;The results can be easily generalized to the case with non-zero interest rates and dividends.&#xA;Under those assumptions, the Black-Scholes PDE is:&#xA;$$&#x9;\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} = 0.$$&lt;/p&gt;&#xA;&lt;p&gt;An implicit Euler discretisation on a uniform grid in \(S\) of width \(h\) with linear boundary conditions (zero Gamma) leads to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Benaim et al. extrapolation does not work on equities</title>
      <link>https://chasethedevil.github.io/post/issues_with_bdk_extrapolation/</link>
      <pubDate>Tue, 04 Oct 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/issues_with_bdk_extrapolation/</guid>
      <description>&lt;p&gt;We have seen &lt;a href=&#34;https://chasethedevil.github.io/mystic_parabola.md&#34;&gt;earlier&lt;/a&gt; that a simple parabola allows to capture the smile of AAPL 1m options surprisingly well. For very high and very low strikes,&#xA;the parabola does not obey Lee&amp;rsquo;s moments formula (the behavior in the wings needs to be at most linear in variance/log-moneyness).&lt;/p&gt;&#xA;&lt;p&gt;Extrapolating the volatility smile in the low or high strikes in a smooth \(C^2\) fashion is however not easy.&#xA;A surprisingly popular so called &amp;ldquo;arbitrage-free&amp;rdquo;&#xA;method is the &lt;a href=&#34;http://www.quarchome.org/RiskTailsPaper_v5.pdf&#34;&gt;extrapolation of Benaim, Dodgson and Kainth&lt;/a&gt; developed to remedy the negative density of SABR in interest rates as&#xA;well as to give more control over the wings.&lt;/p&gt;</description>
    </item>
    <item>
      <title>AES for Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/aes_for_monte_carlo/</link>
      <pubDate>Wed, 17 Aug 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/aes_for_monte_carlo/</guid>
      <description>&lt;p&gt;In finance, and also in science, the &lt;a href=&#34;https://en.wikipedia.org/wiki/Mersenne_Twister&#34;&gt;Mersenne-Twister&lt;/a&gt; is the de-factor pseudo-random number generator (PRNG) for Monte-Carlo simulations.&#xA;By the way, there is a &lt;a href=&#34;http://arxiv.org/abs/1301.5435&#34;&gt;recent 64-bit maximally equidistributed version&lt;/a&gt; called MEMT19937 with 53-bit double precision floating point numbers in mind.&lt;/p&gt;&#xA;&lt;p&gt;D.E. Shaw paper &lt;a href=&#34;https://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwiyl5Lg8cjOAhVMahoKHVhPCPQQFggmMAA&amp;amp;url=http%3A%2F%2Fwww.thesalmons.org%2Fjohn%2Frandom123%2Fpapers%2Frandom123sc11.pdf&amp;amp;usg=AFQjCNEZ5I7JeeDSELDJBDjLU84tXKmI3w&amp;amp;sig2=UqLBNOlLjkHsMMncABKkIg&amp;amp;bvm=bv.129759880,d.d2s&#34;&gt;Parallel Random Numbers: As easy as 1, 2, 3&lt;/a&gt;&#xA;makes a bold remark: since &lt;a href=&#34;https://en.wikipedia.org/wiki/AES_instruction_set&#34;&gt;specific AES instructions&lt;/a&gt; have&#xA;been available since 2010 in most x86 processors, why not use them?&lt;/p&gt;&#xA;&lt;p&gt;Historicaly, counter-based PRNGs based on cryptographic standards such as &lt;a href=&#34;https://en.wikipedia.org/wiki/Advanced_Encryption_Standard&#34;&gt;AES&lt;/a&gt;&#xA;were historically slow, which motivated the development of sequential PRNGs with good statistical properties,&#xA;yet not cryptographically strong like the Mersenne Twister for Monte-Carlo simulations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A review of Thomas Piketty - Le capital au XXI siecle</title>
      <link>https://chasethedevil.github.io/post/piketty_capital/</link>
      <pubDate>Tue, 02 Aug 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/piketty_capital/</guid>
      <description>&lt;p&gt;I found back some old notes I had written about the book &amp;ldquo;Le capital au XXI siecle&amp;rdquo; from Thomas Piketty. It took me a while to finish that book last summer.&lt;/p&gt;&#xA;&lt;p&gt;So many journalists have written around Piketty, that I had to buy the book and read it. It turns out that some of the criticism I have read is not really founded once one reads the book, but here are other real obvious criticisms that I suprisingly did not hear.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Number of regressors in a BSDE</title>
      <link>https://chasethedevil.github.io/post/number_of_regressors_in_bdse/</link>
      <pubDate>Tue, 26 Jul 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/number_of_regressors_in_bdse/</guid>
      <description>&lt;p&gt;Last year, I was kindly invited at the workshop on Models and Numerics in Financial Mathematics at the Lorentz center.&#xA;It was surprinsgly interesting on many different levels. Beside the relatively large gap between academia and the industry, which this&#xA;workshop was trying to address, one thing that struck me is how difficult it was for people of slightly different specialties to communicate.&lt;/p&gt;&#xA;&lt;p&gt;It seemed that mathematicians of different countries working on different subjects related to backward stochastic differential equations (BSDEs) would not truly understand each other. I know this is&#xA;very subjective, and maybe those mathematicians did not feel this at all. One concrete example is related to the number of regressors needed to solve a BSDE on 10 different variables.&#xA;Solving a BSDE on 10 variables for EDF was given as an illustration at the end of an otherwise excellent presentation.&#xA;Someone in the audience asked how possibly they could do that in practice since it would involve \(10^{10}\) regression factors. The answer of the speaker was more or less that it was what they do, with no particular trick but with a large computing power, as if \(10^{10}\) was not so big.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Shooting arbitrage - part II</title>
      <link>https://chasethedevil.github.io/post/shooting_arbitrage2/</link>
      <pubDate>Tue, 05 Jul 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/shooting_arbitrage2/</guid>
      <description>&lt;p&gt;In my &lt;a href=&#34;https://chasethedevil.github.io/post/shooting_arbitrage/&#34;&gt;previous post&lt;/a&gt;, I looked at de-arbitraging volatilities of options of a specific maturity with the shooting method.&#xA;In reality it is not so practical. While the local volatility will be continuous at the given expiry \(T\), it won&amp;rsquo;t be so at the times \( t \lt T \)&#xA;because of the interpolation or extrapolation in time. If we consider a single market expiry at time \(T\),&#xA;it is standard practice to extrapolate the implied volatility flatly for \(t \lt T\), that is, \(w(y,t) = v_T(y) t\)&#xA;where the variance at time \(T\) is defined as \(v_T(y)= \frac{1}{T}w(y,T)\).&#xA;Plugging this into the local variance formula leads to&#xA;$$\sigma^{\star 2}\left(y, t\right) = \frac{ v_T(y)}{1 - \frac{y}{v_T}\frac{\partial v_T}{\partial y}&#x9;+ \frac{1}{4}\left(-\frac{t^2}{4}-\frac{t}{v_T}+\frac{y^2}{v_T^2}\right)\left(\frac{\partial v_T}{\partial y}\right)^2 + \frac{t}{2}\frac{\partial^{2} v_T}{\partial y^2}}$$&#xA;for \(t\leq T\). In particular, for \(t=0\), we have&#xA;$$\sigma^{\star 2}\left(y, 0\right) = \frac{ v_T(y)}&#xA;{1 - \frac{y}{v_T}\frac{\partial v_T}{\partial y}&#x9;+ \frac{1}{4}\left(\frac{y^2}{v_T^2}\right)\left(\frac{\partial v_T}{\partial y}\right)^2}$$&#xA;But the first derivative is not continuous, and jumps at \(y=y_0\) and \(y=y_1\). The local volatility will jump as well around those points. Thus, in practice, the technique can not be used for pricing under local volatility.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Shooting arbitrage - part I</title>
      <link>https://chasethedevil.github.io/post/shooting_arbitrage/</link>
      <pubDate>Wed, 22 Jun 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/shooting_arbitrage/</guid>
      <description>&lt;p&gt;In my &lt;a href=&#34;https://chasethedevil.github.io/post/damghani_dearbitraging_a_weak_smile_on_svi/&#34;&gt;previous post&lt;/a&gt;, I looked at de-arbitraging volatilities of options of a specific maturity with SVI (re-)calibration.&#xA;The penalty method can be used beyond SVI. For example I interpolate here with a cubic spline on 11 equidistant nodes the original volatility slice that contains arbitrages and then minimize with Levenberg-Marquardt&#xA;and the negative local variance denominator penalty on 51 equidistant points. This results in a quite small adjustment to the original volatilities:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Dearbitraging a weak smile on SVI with Damghani&#39;s method</title>
      <link>https://chasethedevil.github.io/post/damghani_dearbitraging_a_weak_smile_on_svi/</link>
      <pubDate>Wed, 15 Jun 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/damghani_dearbitraging_a_weak_smile_on_svi/</guid>
      <description>&lt;p&gt;Yesterday, I wrote about some &lt;a href=&#34;https://chasethedevil.github.io/post/svi_zeliade_arbitrage/&#34;&gt;calendar spread arbitrages with SVI&lt;/a&gt;. Today I am looking at the famous example of butterfly spread arbitrage from Axel Vogt.&#xA;$$(a, b, m, \rho, \sigma) = (−0.0410, 0.1331, 0.3586, 0.3060, 0.4153)$$&#xA;The parameters obey the weak no-arbitrage constraint of Gatheral, and yet produce a negative density, or equivalently, a negative denominator in the local variance Dupire formula.&#xA;Those parameters are mentioned in Jim Gatheral and Antoine Jacquier paper on &lt;a href=&#34;http://ssrn.com/abstract=2033323&#34;&gt;arbitrage free SVI volatility surfaces&lt;/a&gt; and also in Damghani&amp;rsquo;s paper &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2428532&#34;&gt;dearbitraging a weak smile&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Arbitrage in Zeliade&#39;s SVI example</title>
      <link>https://chasethedevil.github.io/post/svi_zeliade_arbitrage/</link>
      <pubDate>Tue, 14 Jun 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/svi_zeliade_arbitrage/</guid>
      <description>&lt;p&gt;Zeliade wrote an &lt;a href=&#34;http://www.zeliade.com/whitepapers/zwp-0005.pdf&#34;&gt;excellent paper&lt;/a&gt; about the calibration of the SVI parameterization for the volatility surface in 2008. I just noticed recently&#xA;that their example calibration actually contained strong calendar spread arbitrages. This is not too surprising if you look at the parameters,&#xA;they vary wildly between the first and the second expiry.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;T&lt;/th&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;a&lt;/th&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;b&lt;/th&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;rho&lt;/th&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;m&lt;/th&gt;&#xA;          &lt;th style=&#34;text-align: center&#34;&gt;s&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.082&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.027&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.234&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.068&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.100&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.028&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.16&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.030&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.125&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;-1.0&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.074&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.050&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.26&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.032&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.094&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;-1.0&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.093&lt;/td&gt;&#xA;          &lt;td style=&#34;text-align: center&#34;&gt;0.041&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;The calendar spread arbitrage is very visible in total variance versus log-moneyness graph:&#xA;in those coordinates if lines crosses, there is an arbitrage. This is because the total variance should be increasing with the expiry time.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/svi_zeliade_arb.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Arbitrage in Zeliade&amp;#39;s example&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Dupire Local Volatility with Cash Dividends Part 2</title>
      <link>https://chasethedevil.github.io/post/dupire_cash_dividend_part2/</link>
      <pubDate>Sun, 29 May 2016 17:01:00 +0200</pubDate>
      <guid>https://chasethedevil.github.io/post/dupire_cash_dividend_part2/</guid>
      <description>&lt;p&gt;I had a look at how to price under Local Volatility with Cash dividends in &lt;a href=&#34;https://chasethedevil.github.io/post/dupire_cash_dividend/&#34;&gt;my previous post&lt;/a&gt;. I still had a somewhat large error in my FDM price. After too much time, I managed to find the culprit, it was the extrapolation of the prices when applying the jump continuity condition \(V(S,t_\alpha^-) = V(S-\alpha, t_\alpha^+) \) for an asset \(S\) with a cash dividend of amount \(\alpha\) at \( t_\alpha \).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Dupire Local Volatility with Cash Dividends</title>
      <link>https://chasethedevil.github.io/post/dupire_cash_dividend/</link>
      <pubDate>Thu, 19 May 2016 17:01:00 +0200</pubDate>
      <guid>https://chasethedevil.github.io/post/dupire_cash_dividend/</guid>
      <description>&lt;p&gt;The Dupire equation for local volatility has been derived under the assumption of Martingality, that means no dividends or interest rates.&#xA;The extension to continuous dividend yield is described in many papers or books:&lt;/p&gt;&#xA;&lt;p&gt;$$\sigma^{\star 2}\left(K, T\right) = \frac{\frac{\partial C}{\partial T}+(r_B-q)K \frac{\partial C}{\partial K} + q C(K,T)}{\frac{1}{2}K^2\frac{\partial^2 C}{\partial K^2}}$$&lt;/p&gt;&#xA;&lt;p&gt;In this case, \(C\) is a regular market Call option price, that can also be obtained from market volatilities via the Black-Scholes formula.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SVI, SABR, or parabola on AAPL?</title>
      <link>https://chasethedevil.github.io/post/svi_sabr_or_parabola/</link>
      <pubDate>Thu, 12 May 2016 19:32:42 +0200</pubDate>
      <guid>https://chasethedevil.github.io/post/svi_sabr_or_parabola/</guid>
      <description>&lt;p&gt;In a &lt;a href=&#34;https://chasethedevil.github.io/post/least_squares_spline&#34;&gt;previous post&lt;/a&gt;, I took a look at least squares spline and parabola fits on AAPL 1m options market volatilities. I would have imagined SVI to fit even  better since it has 5 parameters, and SABR to do reasonably well.&lt;/p&gt;&#xA;&lt;p&gt;It turns out that the simple parabola has the lowest RMSE, and SVI is not really better than SABR on that example.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/svi_sabr_parabola.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;SVI, SABR, least squares parabola fitted to AAPL 1m options&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Note that this is just one single example, unlikely to be representative of anything, but I thought this was interesting that in practice, a simple parabola can compare favorably to more complex models.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adaptive Filon quadrature for stochastic volatility models</title>
      <link>https://chasethedevil.github.io/post/filon_for_heston/</link>
      <pubDate>Thu, 12 May 2016 19:08:18 +0200</pubDate>
      <guid>https://chasethedevil.github.io/post/filon_for_heston/</guid>
      <description>&lt;p&gt;A while ago, I have applied a relatively simple adaptive Filon quadrature to the problem of &lt;a href=&#34;http://papers.ssrn.com/abstract=2620166&#34;&gt;volatility swap pricing&lt;/a&gt;. The &lt;a href=&#34;https://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwi18brlh9XMAhWIVhoKHdnGA2UQFggdMAA&amp;amp;url=http%3A%2F%2Fwww.ams.org%2Fmcom%2F1968-22-101%2FS0025-5718-1968-0225485-5%2FS0025-5718-1968-0225485-5.pdf&amp;amp;usg=AFQjCNEQvSMm6vOaXIX2MqAJ-GQt79QRiA&amp;amp;sig2=HLHd-rc74qnCuo5yp1Q13A&#34;&gt;Filon quadrature&lt;/a&gt; is an old quadrature from 1928 that allows to integrate oscillatory integrand like \(f(x)\cos(k x) \) or \(f(x)\sin(k x) \). It turns out that combined with an adaptive Simpson like method, it has many advantages over more generic adaptive quadrature methods like Gauss-Lobatto, which is often used on similar problems.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Least Squares Rational Function</title>
      <link>https://chasethedevil.github.io/post/rational_fit/</link>
      <pubDate>Thu, 21 Apr 2016 16:37:24 +0200</pubDate>
      <guid>https://chasethedevil.github.io/post/rational_fit/</guid>
      <description>&lt;p&gt;In my paper &lt;a href=&#34;http://ssrn.com/abstract=2420757&#34;&gt;&amp;ldquo;Fast and Accurate Analytic Basis Point Volatility&amp;rdquo;&lt;/a&gt;,&#xA;I use a table of Chebyshev polynomials to provide an accurate representation of some function. This is&#xA;an idea I first saw in the &lt;a href=&#34;http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package&#34;&gt;Faddeeva package&lt;/a&gt; to&#xA;represent the cumulative normal distribution with high accuracy, and high performance. It is also&#xA;simple to find out the Chebyshev polynomials, and which intervals are the most appropriate for those, which&#xA;makes this technique quite appealing.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Least Squares Spline for Volatility Interpolation</title>
      <link>https://chasethedevil.github.io/post/least_squares_spline/</link>
      <pubDate>Fri, 19 Feb 2016 18:29:33 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/least_squares_spline/</guid>
      <description>&lt;p&gt;I am experimenting a bit with least squares splines. Existing algorithms (for example from the NSWC Fortran library) usually work&#xA;with B-splines, a relatively simple explanation of how it works is given in &lt;a href=&#34;http://www.geometrictools.com/Documentation/BSplineCurveLeastSquaresFit.pdf&#34;&gt;this paper&lt;/a&gt; (I think this is how De Boor coded it in the NSWC library).&#xA;Interestingly there is &lt;a href=&#34;http://educ.jmu.edu/~lucassk/Papers/Spline3.pdf&#34;&gt;an equivalent formulation in terms of standard cubic splines&lt;/a&gt;, although it seems that the&#xA;pseudo code on that paper has errors.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Mystic Parabola</title>
      <link>https://chasethedevil.github.io/post/mystic_parabola/</link>
      <pubDate>Tue, 16 Feb 2016 22:13:53 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/mystic_parabola/</guid>
      <description>&lt;p&gt;I recently had some fun trying to work directly with the option chain from the &lt;a href=&#34;http://www.nasdaq.com/symbol/aapl/option-chain&#34;&gt;Nasdaq website&lt;/a&gt;.&#xA;The data there is quite noisy, but a simple parabola can still give an amazing fit. I will consider the options of maturity two years as illustration.&#xA;I also relied on a simple implied volatility algorithm that can be summarized in the following steps:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compute a rough guess for the forward price by using interest, borrow curves and by extrapolating the dividends.&lt;/li&gt;&#xA;&lt;li&gt;Imply the forward from the European Put-Call parity relationship on the mid prices of the two strikes closes to the rough forward guess. A simple linear interpolation between the two strikes can be used to compute the forward.&lt;/li&gt;&#xA;&lt;li&gt;Compute the Black implied volatilities as if the option were European using P. Jaeckel algorithm.&lt;/li&gt;&#xA;&lt;li&gt;Calibrate the proportional dividend amount or the growth rate by minimizing, for example with a Levenberg-Marquardt minimizer, the difference between model and mid-option prices corresponding to the three strikes closest to the forward. The parameters in this case are effectively the dividend amount and the volatilities for Put and Call options (the same volatility is used for both options). The initial guess stems directly from the two previous steps. American option prices are computed by the finite difference method.&lt;/li&gt;&#xA;&lt;li&gt;Solve numerically the volatilities one by one with the TOMS748 algorithm so that the model prices match the market mid out-of-the-money option prices.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Then I just fit a least squares parabola in variance on log-moneyness, using options trading volumes as weights and obtain the following figure:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Yahoo Finance Implied Volatility</title>
      <link>https://chasethedevil.github.io/post/yahoo_finance_implied_volatility/</link>
      <pubDate>Wed, 03 Feb 2016 16:45:58 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/yahoo_finance_implied_volatility/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;https://finance.yahoo.com/q/op?s=GOOG&amp;amp;date=1457049600&#34;&gt;option chain&lt;/a&gt; on Yahoo finance shows an implied volatility number for each call or put option in the last column.&#xA;I was wondering a bit how they computed that number. I did not exactly find out their methodology, especially since we don&amp;rsquo;t even know the daycount convention used, but&#xA;I did find that it was likely just garbage.&lt;/p&gt;&#xA;&lt;p&gt;A red-herring is for example the large discrepancy between put vols and call vols. For example strike 670, call vol=50%, put vol=32%.&#xA;This suggests that the two are completely decoupled, and they use some wrong forward (spot price?) to obtain those numbers. If I compute&#xA;the implied volatilities using put-call parity close to the money to find out the implied forward price, I end up with ask vols of 37% and 34% or call and put mid vols of 33%.&#xA;By considering the put-call parity, I assume European option prices, which is not correct in this case. It turns out however, that with the low interest rates we live in, there is nearly zero additional value due to the American early exercise.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Is Tufte overrated?</title>
      <link>https://chasethedevil.github.io/post/is_tufte_overrated/</link>
      <pubDate>Wed, 03 Feb 2016 16:11:30 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/is_tufte_overrated/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://www.edwardtufte.com/tufte/&#34;&gt;Tufte&lt;/a&gt; proposes interesting guidelines to present data, or even to design written semi-scientific papers or books. Some advices&#xA;are particularly relevant like the careful use of colors (don&amp;rsquo;t use all the colors of the rainbow just because you can), and&#xA;in general don&amp;rsquo;t add lines in a graph or designs that are not directly relevant to the message that needs to be conveyed. There is also a parallel&#xA;with Feynman message against (Nasa) &lt;a href=&#34;http://www.zdnet.com/article/death-by-powerpoint/&#34;&gt;Powerpoint presentations&lt;/a&gt;. But other inspirations, are somewhat doubtful.&#xA;He seems to have a fetish for &lt;a href=&#34;http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0000hB&#34;&gt;old texts&lt;/a&gt;. They might be considered pretty, or interesting in some ways, but&#xA;I don&amp;rsquo;t find them particularly easy to read. They look more like esoteric books rather than practical books. If you want to write&#xA;the new Bible for your new cult, it&amp;rsquo;s probably great, not so sure it&amp;rsquo;s so great for a more simple subject.&#xA;Also somewhat surprisingly, his own website is not very well designed, it looks like a maze and very end of 90s.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linear and Flat forward interpolation with cash dividends</title>
      <link>https://chasethedevil.github.io/post/linear_flat_forward_interpolation/</link>
      <pubDate>Tue, 19 Jan 2016 09:55:32 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/linear_flat_forward_interpolation/</guid>
      <description>&lt;p&gt;When the dividend curve is built from discrete cash dividends, the dividend yield is discontinuous at the dividend time as the asset price jumps from the dividend amount.&#xA;This can be particularly problematic for numerical schemes like finite difference methods. In deed, a finite difference grid&#xA;will make use of the forward yield (eventually adjusted to the discretisation scheme), which explodes then.&#xA;Typically, if one is not careful about this, then increasing the number of time steps does not increase accuracy anymore, as&#xA;the spike just becomes bigger on a smaller time interval. A simple work-around is to limit the resolution to one day.&#xA;This means that intraday, we interpolate the dividend yield.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Moved to hugo</title>
      <link>https://chasethedevil.github.io/post/moved-to-hugo/</link>
      <pubDate>Sun, 20 Dec 2015 21:00:57 +0100</pubDate>
      <guid>https://chasethedevil.github.io/post/moved-to-hugo/</guid>
      <description>&lt;p&gt;I moved my blog from blogger to &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt;. Blogger really did not evolve since Google take-over in 2003. Wordpress is today much nicer and prettier. It&amp;rsquo;s clear that Google did not invest at all, possibly because blogs are passé. Compared to mid 2000, there are very few blogs today. Even programming blogs are scarce. It could be interesting to quantify this. My theory is that it is the direct consequence of the popularity of social networks, and especially facebook (possibly also stackoverflow for programmers): people don&amp;rsquo;t have time anymore to write as their extra-time is used on social networks. Similarly I noticed that almost nobody comments anymore to the point that even Disqus is very rarely used, and again I attribute that to the popularity of sites like reddit. This is why I did not bother with a comment section on my blog, just email me or tweet about it instead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Controlling the SABR wings with Hagan PDE </title>
      <link>https://chasethedevil.github.io/post/controlling-the-sabr-wings-with-hagan-pde/</link>
      <pubDate>Tue, 15 Dec 2015 10:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/controlling-the-sabr-wings-with-hagan-pde/</guid>
      <description>On the &lt;a href=&#34;http://www.wilmott.com/messageview.cfm?catid=4&amp;amp;threadid=78001&amp;amp;FTVAR_MSGDBTABLE=&amp;amp;STARTPAGE=4&#34;&gt;Wilmott forum&lt;/a&gt;, Pat Hagan has recently suggested to cap the equivalent local volatility in order to control the wings and better match CMS prices. It also helps making the SABR approximation better behaved as the expansion is only valid when&lt;br /&gt;&lt;div&gt;$$ 1 + 2\frac{\rho\nu}{\alpha}y(K)+\frac{\nu^2}{\alpha^2}y^2(K) $$&lt;/div&gt;&lt;div&gt;is close to 1.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;In the PDE approach (especially the non transformed one), it is very simple, one just needs to update the equivalent local vol as&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;$$\alpha K^\beta \min\left(M, \sqrt{1 + 2\frac{\rho\nu}{\alpha}y(K)+\frac{\nu^2}{\alpha^2}y^2(K)}\right)$$&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While it is straightforward to include in the PDE, it is more difficult to derive a good approximation. The zero-th order behaves as expected, but the first order formula has a unnatural kink, likely because of the non differentiability due to the min function.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The following graphs presents the non capped PDE, the capped PDE with M=4*nu (PDEC4) and M=6*nu (PDEC6) as well as the approximation (Andersen Ratcliffe / Gatheral first order) where I have only taken care of the right wing. The SABR parameters are alpha = 0.0630, beta = 0.7, rho = -0.363, nu = 0.421, T = 10, f = 0.0439.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&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/-7N928DyGhHY/Vm_ibyWlVcI/AAAAAAAAIP0/YF7Mfcpm4w4/s1600/Screenshot%2Bfrom%2B2015-12-15%2B10-25-16.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;400&#34; src=&#34;http://1.bp.blogspot.com/-7N928DyGhHY/Vm_ibyWlVcI/AAAAAAAAIP0/YF7Mfcpm4w4/s400/Screenshot%2Bfrom%2B2015-12-15%2B10-25-16.png&#34; width=&#34;385&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We can see that the higher the cap is, the closer we are to the standard SABR PDE, and the lower the cap is, the flatter are the wings.&lt;br /&gt;&lt;br /&gt;The approximation matches well ATM (it is then equivalent to standard SABR PDE) but then has a discontinuous derivative for the K that reaches the threshold M. Far away, it matches very well again.&lt;/div&gt;</description>
    </item>
    <item>
      <title>Broken Internet?</title>
      <link>https://chasethedevil.github.io/post/broken-internet/</link>
      <pubDate>Mon, 09 Nov 2015 13:40:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/broken-internet/</guid>
      <description>There is something funny going on with upcoming generic top level domains (gTLDs), they seem to be looked up in a strange manner (at least on latest Linux). For example:&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;ping chrome&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;ping nexus&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;returns 127.0.53.53.&lt;br /&gt;&lt;br /&gt;While existing &lt;a href=&#34;https://www.name.com/new-gtld&#34;&gt;official gTLD&lt;/a&gt;s don&#39;t (&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;ping dental&lt;/span&gt; returns &#34;unknown host&#34; as expected). I first thought it was a network misconfiguration, but as &lt;a href=&#34;https://groups.google.com/forum/#!msg/public-dns-discuss/bzhTQnFqE6I/E9F46xhka98J&#34;&gt;I am not the only one to notice this&lt;/a&gt;, it&#39;s likely a genuine internet issue.&lt;br /&gt;&lt;br /&gt;Strange times.</description>
    </item>
    <item>
      <title>Holiday&#39;s read - DFW - Everything and more</title>
      <link>https://chasethedevil.github.io/post/holidays-read---dfw---everything-and-more/</link>
      <pubDate>Sun, 01 Nov 2015 17:55:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/holidays-read---dfw---everything-and-more/</guid>
      <description>&lt;p&gt;I am ambivalent towards David Foster Wallace. He can write the most creative sentences and make innocuous subjects very interesting. At the same time, i never finished his book&lt;a href=&#34;https://en.wikipedia.org/wiki/Infinite_Jest&#34;&gt;Infinite Jest&lt;/a&gt;, partly because the characters names are too awkward for me so that i never exactly remember who is who, but also because the story itself is a bit too crazy.&lt;/p&gt;&#xA;&lt;p&gt;I knew however that &lt;a href=&#34;http://www.amazon.com/Everything-More-Compact-History-Infinity/dp/0393339289&#34;&gt;a non fiction book on the subject of infinity&lt;/a&gt; written by him would make for a very interesting read. And I have not been disappointed. It&amp;rsquo;s in between maths and philosophy going back to the Greeks up to Gödel through a lot of Cantor following more or less the historical chronology.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Crank-Nicolson and Rannacher Issues with Touch options</title>
      <link>https://chasethedevil.github.io/post/crank-nicolson-and-rannacher-issues-with-touch-options/</link>
      <pubDate>Wed, 30 Sep 2015 13:34:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/crank-nicolson-and-rannacher-issues-with-touch-options/</guid>
      <description>I just stumbled upon this particularly illustrative case where the Crank-Nicolson finite difference scheme behaves badly, and the Rannacher smoothing (2-steps backward Euler) is less than ideal: &lt;a href=&#34;http://www.investopedia.com/terms/d/doubleonetouch.asp&#34;&gt;double one touch&lt;/a&gt; and &lt;a href=&#34;http://www.investopedia.com/terms/d/doublenotouch.asp&#34;&gt;double no touch&lt;/a&gt; options.&lt;br /&gt;&lt;br /&gt;It is particularly evident when the option is sure to be hit, for example when the barriers are narrow, that is our delta should be around zero as well as our gamma. Let&#39;s consider a double one touch option with spot=100, upBarrier=101, downBarrier=99.9, vol=20%, T=1 month and a payout of 50K.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-skVEtpSetds/VgvDcK5MycI/AAAAAAAAIIc/BPj70_3z4lo/s1600/Screenshot%2Bfrom%2B2015-09-30%2B13%253A11%253A13.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;326&#34; src=&#34;http://3.bp.blogspot.com/-skVEtpSetds/VgvDcK5MycI/AAAAAAAAIIc/BPj70_3z4lo/s400/Screenshot%2Bfrom%2B2015-09-30%2B13%253A11%253A13.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Crank-Nicolson shows big spikes in the delta near the boundary&lt;/td&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-w0esoFRdaSA/VgvD6QgMDwI/AAAAAAAAIIk/-qdQ6BcTAmU/s1600/Screenshot%2Bfrom%2B2015-09-30%2B13%253A13%253A33.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;325&#34; src=&#34;http://3.bp.blogspot.com/-w0esoFRdaSA/VgvD6QgMDwI/AAAAAAAAIIk/-qdQ6BcTAmU/s400/Screenshot%2Bfrom%2B2015-09-30%2B13%253A13%253A33.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Rannacher shows spikes in the delta as well&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Crank-Nicolson spikes are so high that the price is actually a off itself.&lt;br /&gt;&lt;br /&gt;The Rannacher smoothing reduces the spikes by 100x but it&#39;s still quite high, and would be higher had we placed the spot closer to the boundary. The gamma is worse. Note that we applied the smoothing only at maturity. In reality as the barrier is continuous, the smoothing should really be applied at each step, but then the scheme would be not so different from a simple Backward Euler.&lt;br /&gt;&lt;br /&gt;In contrast, with a proper second order finite difference scheme, there is no spike.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-mj0mUfRCSJk/VgvGiUPP1nI/AAAAAAAAIIw/KKK9sXTrne4/s1600/Screenshot%2Bfrom%2B2015-09-30%2B13%253A24%253A27.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;325&#34; src=&#34;http://2.bp.blogspot.com/-mj0mUfRCSJk/VgvGiUPP1nI/AAAAAAAAIIw/KKK9sXTrne4/s400/Screenshot%2Bfrom%2B2015-09-30%2B13%253A24%253A27.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Delta with the TR-BDF2 finite difference method - the scale goes from -0.00008 to 0.00008.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-okMVRlfdJGw/VgvGsntsjbI/AAAAAAAAII4/xNVchYODHGU/s1600/Screenshot%2Bfrom%2B2015-09-30%2B13%253A24%253A42.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;325&#34; src=&#34;http://1.bp.blogspot.com/-okMVRlfdJGw/VgvGsntsjbI/AAAAAAAAII4/xNVchYODHGU/s400/Screenshot%2Bfrom%2B2015-09-30%2B13%253A24%253A42.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Delta with the Lawson-Morris finite difference scheme - the scale goes from -0.00005 to 0.00005&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;Both &lt;a href=&#34;http://www.risk.net/journal-of-computational-finance/technical-paper/2330321/tr-bdf2-for-fast-stable-american-option-pricing&#34;&gt;TR-BDF2&lt;/a&gt; and Lawson-Morris (based on a local Richardson extrapolation of backward Euler) have a very low delta error, similarly, their gamma is very clean. This is reminiscent of the behavior on American options, but the effect is magnified here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Clouds</title>
      <link>https://chasethedevil.github.io/post/clouds/</link>
      <pubDate>Wed, 02 Sep 2015 15:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/clouds/</guid>
      <description>I was wondering how to generate some nice cloudy like texture with a simple program. I first thought about using the Brownian motion, but of course if one uses it raw, with one pixel representing one movement in time, it&#39;s just going to look like a very noisy and grainy picture like this:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-QfeLi5F03oQ/Vebs3C-XWyI/AAAAAAAAIG4/5q1kKip0PlA/s1600/normal_rng.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;200&#34; src=&#34;http://4.bp.blogspot.com/-QfeLi5F03oQ/Vebs3C-XWyI/AAAAAAAAIG4/5q1kKip0PlA/s200/normal_rng.png&#34; width=&#34;200&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Normal noise&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;There is however a nice continuous representation of the Brownian motion : the Paley-Wiener representation&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/-fkDLapfROaY/Vebtgtm2BCI/AAAAAAAAIHA/-EgKgEF_rEM/s1600/Screenshot%2Bfrom%2B2015-09-02%2B14-37-02.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;31&#34; src=&#34;http://1.bp.blogspot.com/-fkDLapfROaY/Vebtgtm2BCI/AAAAAAAAIHA/-EgKgEF_rEM/s400/Screenshot%2Bfrom%2B2015-09-02%2B14-37-02.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&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/-JdA4jtT3J-A/VebtgjUKcfI/AAAAAAAAIHE/4HCx4BaAPDY/s1600/Screenshot%2Bfrom%2B2015-09-02%2B14-36-42.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;60&#34; src=&#34;http://1.bp.blogspot.com/-JdA4jtT3J-A/VebtgjUKcfI/AAAAAAAAIHE/4HCx4BaAPDY/s400/Screenshot%2Bfrom%2B2015-09-02%2B14-36-42.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This can produce an interesting smooth pattern, but it is just 1D. In the following picture, I apply it to each row (the column index being time), and then for each column (the row index being time). Of course this produces a symmetric picture, especially as I reused the same random numbers&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/-CzAUnTU3V7w/VebuSjnBuLI/AAAAAAAAIHQ/t6a1FGCsIMA/s1600/constructive.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;200&#34; src=&#34;http://4.bp.blogspot.com/-CzAUnTU3V7w/VebuSjnBuLI/AAAAAAAAIHQ/t6a1FGCsIMA/s200/constructive.png&#34; width=&#34;200&#34; /&gt;&lt;/a&gt;&lt;/div&gt;If I use new random numbers for the columns, it is still symmetric, but destructive rather than constructive.&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/-zb3pUtY1ZMo/VebvK0C1xdI/AAAAAAAAIHY/A0-vaxGMwdI/s1600/destructive.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;200&#34; src=&#34;http://3.bp.blogspot.com/-zb3pUtY1ZMo/VebvK0C1xdI/AAAAAAAAIHY/A0-vaxGMwdI/s200/destructive.png&#34; width=&#34;200&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It turns out that spatial processes are something more complex than I first imagined. It is not a simple as using a N-dimensional Brownian motion, as it would produce a very similar picture as the 1-dimensional one. But &lt;a href=&#34;http://www.maths.uq.edu.au/~kroese/ps/MCSpatial.pdf&#34;&gt;this paper has a nice overview of spatial processes&lt;/a&gt;. Interestingly they even suggest to generate a Gaussian process using a &lt;a href=&#34;https://en.wikipedia.org/wiki/Precision_%28statistics%29&#34;&gt;Precision matrix&lt;/a&gt; (inverse of covariance matrix). I never thought about doing such a thing and I am not sure what is the advantage of such a scheme.&lt;br /&gt;&lt;br /&gt;There is a standard graphic technique to generate nice textures, originating from Ken Perlin for Disney, it is called simply &lt;a href=&#34;https://en.wikipedia.org/wiki/Perlin_noise&#34;&gt;Perlin Noise&lt;/a&gt;. It turns out that several web pages in the top Google results &lt;a href=&#34;https://en.wikipedia.org/wiki/Talk%3APerlin_noise&#34;&gt;confuse&lt;/a&gt; simple Perlin noise with fractal sum of noise that Ken Perlin also helped popularize (see his slides: &lt;a href=&#34;http://www.noisemachine.com/talk1/20.html&#34;&gt;standard Perlin noise&lt;/a&gt;, &lt;a href=&#34;http://www.noisemachine.com/talk1/21.html&#34;&gt;fractal noise&lt;/a&gt;). Those pages also believe that the later is simpler/faster. But there are two issues with fractal sum of noise: the first one is that it relies on an existing noise function - you need to first build one (it can be done with a random number generator and an interpolator), and the second one is that it ends up being more complex to program and likely to evaluate as well, see for example the code needed &lt;a href=&#34;http://devmag.org.za/2009/04/25/perlin-noise/&#34;&gt;here&lt;/a&gt;. The fractal sum of noise is really a complementary technique.&lt;br /&gt;&lt;br /&gt;The insight of Perlin noise is to not generate random color values that would be assigned to shades of grey as in my examples, but to generate random gradients, and interpolate on those gradient in a smooth manner. In computer graphics they like the cosine function to give a little bit of non-linearity in the colors. A good approximation, usually used as a replacement in this context is &lt;a href=&#34;http://codeplea.com/simple-interpolation&#34;&gt;3x^2 - 2x^3&lt;/a&gt;.  It&#39;s not much more complicated than that, &lt;a href=&#34;http://webstaff.itn.liu.se/~stegu/TNM022-2005/perlinnoiselinks/perlin-noise-math-faq.html&#34;&gt;this web page&lt;/a&gt; explains it in great details. It can be programmed in a few lines of code.&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://3.bp.blogspot.com/-Yo5dgKoD5P8/Veb6rAQ9jAI/AAAAAAAAIHo/uISQjpVzLfI/s1600/perlin_bw.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;200&#34; src=&#34;http://3.bp.blogspot.com/-Yo5dgKoD5P8/Veb6rAQ9jAI/AAAAAAAAIHo/uISQjpVzLfI/s200/perlin_bw.png&#34; width=&#34;200&#34; /&gt;&lt;/a&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-MovHUFAGbnI/Veb6rsjhkBI/AAAAAAAAIHs/4raZRohDySs/s1600/perlin_color.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;200&#34; src=&#34;http://4.bp.blogspot.com/-MovHUFAGbnI/Veb6rsjhkBI/AAAAAAAAIHs/4raZRohDySs/s200/perlin_color.png&#34; width=&#34;200&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-__3z1MEB92o/Veb65IEgVZI/AAAAAAAAIH4/1B9npSW9XKo/s1600/Screenshot%2Bfrom%2B2015-09-02%2B15-33-11.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;512&#34; src=&#34;http://3.bp.blogspot.com/-__3z1MEB92o/Veb65IEgVZI/AAAAAAAAIH4/1B9npSW9XKo/s640/Screenshot%2Bfrom%2B2015-09-02%2B15-33-11.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;very procedural and non-optimized Go code for Perlin noise&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Go for Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/go-for-monte-carlo/</link>
      <pubDate>Sat, 22 Aug 2015 16:13:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/go-for-monte-carlo/</guid>
      <description>&lt;p&gt;I have &lt;a href=&#34;https://chasethedevil.github.io/post/modern-programming-language-for-monte-carlo/&#34;&gt;looked&lt;/a&gt; a few months ago already at Julia, Dart, Rust and Scala programming languages to see how practical they could be for a simple Monte-Carlo option pricing.&lt;/p&gt;&#xA;&lt;p&gt;I forgot &lt;a href=&#34;https://golang.org/&#34;&gt;the Go language&lt;/a&gt;. I had tried it 1 or 2 years ago, and at that time, did not enjoy it too much. Looking at Go 1.5 benchmarks on the &lt;a href=&#34;http://benchmarksgame.alioth.debian.org/&#34;&gt;computer language shootout&lt;/a&gt;, I was surprised that it seemed so close to Java performance now, while having a GC that guarantees pauses of less 10ms and consuming much less memory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bumping Correlations</title>
      <link>https://chasethedevil.github.io/post/bumping-correlations/</link>
      <pubDate>Sat, 25 Jul 2015 18:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/bumping-correlations/</guid>
      <description>In his book &#34;&lt;i&gt;Monte Carlo Methods in Finance&lt;/i&gt;&#34;, P. Jäckel explains a simple way to clean up a correlation matrix. When a given correlation matrix is not positive semi-definite, the idea is to do a &lt;a href=&#34;https://en.wikipedia.org/wiki/Singular_value_decomposition&#34;&gt;singular value decomposition&lt;/a&gt; (SVD), replace the negative eigenvalues by 0, and renormalize the corresponding eigenvector accordingly.&lt;br /&gt;&lt;br /&gt;One of the cited applications is &#34;&lt;i&gt;stress testing and scenario analysis for market risk&lt;/i&gt;&#34; or &#34;&lt;i&gt;comparative pricing in order to ascertain the extent of correlation exposure for multi-asset derivatives&lt;/i&gt;&#34;, saying that &#34;&lt;i&gt;In many of these cases we end up with a matrix that is no longer positive semi-definite&lt;/i&gt;&#34;.&lt;br /&gt;&lt;br /&gt;It turns out that if one bumps an invalid correlation matrix (the input), that is then cleaned up automatically, the effect can be a very different bump. Depending on how familiar you are with SVD, this could be more or less obvious from the procedure,&lt;br /&gt;&lt;br /&gt;As a simple illustration I take the matrix representing 3 assets A, B, C with rho_ab = -0.6, rho_ac = rho_bc = -0.5.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.60000&amp;nbsp; -0.50000&lt;br /&gt;&amp;nbsp; -0.60000&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.50000&lt;br /&gt;&amp;nbsp; -0.50000&amp;nbsp; -0.50000&amp;nbsp;&amp;nbsp; 1.00000&lt;br /&gt;&lt;br /&gt;For those rho_ac and rho_bc, the correlation matrix is not positive definite unless rho_ab in in the range (-0.5, 1). One way to verify this is to use the fact that positive definiteness is equivalent to a positive determinant. The determinant will be 1 - 2*0.25 - rho_ab^2 + 2*0.25*rho_ab.&lt;br /&gt;&lt;br /&gt;After using P. Jaeckel procedure, we end up with: &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.56299&amp;nbsp; -0.46745&lt;br /&gt;&amp;nbsp; -0.56299&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.46745&lt;br /&gt;&amp;nbsp; -0.46745&amp;nbsp; -0.46745&amp;nbsp;&amp;nbsp; 1.00000&lt;br /&gt;&lt;br /&gt;If we bump now rho_bc by 1% (absolute), we end up after cleanup with:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.56637&amp;nbsp; -0.47045&lt;br /&gt;&amp;nbsp; -0.56637&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.46081&lt;br /&gt;&amp;nbsp; -0.47045&amp;nbsp; -0.46081 &amp;nbsp; 1.00000&lt;br /&gt;&lt;br /&gt;It turns out that rho_bc has changed by only 0.66% and rho_ac by -0.30%, rho_ab by -0.34%. So our initial bump (0,0,1) has been translated to a bump (-0.34, -0.30, 0.66). In other words, it does not work to compute sensitivities.&lt;br /&gt;&lt;br /&gt;One can optimize to obtain the nearest correlation matrix in some norm. Jaeckel proposes a hypersphere decomposition based optimization, using as initial guess the SVD solution. &lt;a href=&#34;https://nickhigham.wordpress.com/2013/02/13/the-nearest-correlation-matrix/&#34;&gt;Higham proposed a specific algorithm&lt;/a&gt; just for that purpose. It turns out that on this example, they will converge to the same solution (if we use the same norm). I tried out of curiosity to see if that would lead to some improvement. The first matrix becomes&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.56435&amp;nbsp; -0.46672&lt;br /&gt;&amp;nbsp; -0.56435&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.46672&lt;br /&gt;&amp;nbsp; -0.46672&amp;nbsp; -0.46672&amp;nbsp;&amp;nbsp; 1.00000&lt;br /&gt;&lt;br /&gt;And the bumped one becomes&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.56766&amp;nbsp; -0.46984&lt;br /&gt;&amp;nbsp; -0.56766&amp;nbsp;&amp;nbsp; 1.00000&amp;nbsp; -0.46002&lt;br /&gt;&amp;nbsp; -0.46984&amp;nbsp; -0.46002&amp;nbsp;&amp;nbsp; 1.00000&lt;br /&gt;&lt;br /&gt;We find back the same issue, rho_bc has changed by only 0.67%, rho_ac by -0.31% and rho_ab by -0.33%. We also see that the SVD correlation or the real near correlation matrix are quite close, as noticed by P. Jaeckel.&lt;br /&gt;&lt;br /&gt;Of course, one should apply the bump directly to the cleaned up matrix, in which case it will actually work as expected, unless our bump produces another non positive definite matrix, and then we would have correlation leaking a bit everywhere. It&#39;s not entirely clear what kind of meaning the risk figures would have then.</description>
    </item>
    <item>
      <title>Andreasen Huge extrapolation</title>
      <link>https://chasethedevil.github.io/post/andreasen-huge-extrapolation/</link>
      <pubDate>Mon, 13 Jul 2015 17:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/andreasen-huge-extrapolation/</guid>
      <description>&lt;p&gt;There are not many arbitrage free extrapolation schemes. Benaim et al. extrapolation is one of the few that claims it. However, despite the paper&amp;rsquo;s title, it is not truely arbitrage free. The density might be positive, but the forward is not preserved by the implied density. It can also lead to wings that don&amp;rsquo;t obey Lee&amp;rsquo;s moments condition.&lt;/p&gt;&#xA;&lt;p&gt;On a Wilmott forum, &lt;a href=&#34;http://www.wilmott.com/messageview.cfm?catid=4&amp;amp;threadid=95309&#34;&gt;P. Caspers proposed&lt;/a&gt; the following counter-example based on extrapolating SABR: \( \alpha=15%, \beta=80%, \nu=50%, \rho=-48%, f=3%, T=20.0 \). He cut this smile at 2.5% and 6% and used the BDK extrapolation scheme with mu=nu=1.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Unintuitive behavior of the Black-Scholes formula - negative volatilities in displaced diffusion extrapolation</title>
      <link>https://chasethedevil.github.io/post/unintuitive-behavior-of-the-black-scholes-formula---negative-volatilities-in-displaced-diffusion-extrapolation/</link>
      <pubDate>Tue, 07 Jul 2015 16:43:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/unintuitive-behavior-of-the-black-scholes-formula---negative-volatilities-in-displaced-diffusion-extrapolation/</guid>
      <description>&lt;p&gt;I am looking at various extrapolation schemes of the implied volatilities. An interesting one I stumbled upon is due to Kahale. Even if &lt;a href=&#34;http://nkahale.free.fr/papers/Interpolation.pdf&#34;&gt;his paper&lt;/a&gt; is on interpolation, there is actually a small paragraph on using the same kind of function for extrapolation. His idea is to simply lookup the standard deviation \( \Sigma \) and the forward \(f\) corresponding to a given market volatility and slope:&#xA;$$ c_{f,\Sigma} = f N(d_1) - k N(d_2)$$&#xA;with&#xA;$$ d_1 = \frac{\log(f/k)+\Sigma^2 /2}{\Sigma} $$&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux Desktops in 2015</title>
      <link>https://chasethedevil.github.io/post/linux-desktops-in-2015/</link>
      <pubDate>Wed, 24 Jun 2015 18:53:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/linux-desktops-in-2015/</guid>
      <description>&lt;p&gt;I seem to &lt;a href=&#34;https://chasethedevil.github.io/post/kde-xfce-gnome-shell-in-2014/&#34;&gt;never be entirely happy with any of the linux desktops&lt;/a&gt; these days. I have used XFCE on Ubuntu quite a bit in the past year, it mostly works, but I still had minor annoyances:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;sometimes (rarely) my laptop would not wake up from sleep.&lt;/li&gt;&#xA;&lt;li&gt;notifications sometimes keep popping up too much.&lt;/li&gt;&#xA;&lt;li&gt;on my desktop, experienced strong tearing issues with the Radeon graphic card, except with some very specific combination of video player settings and desktop settings (and then I had annoying redraw issue when pushing volume up/down in movies).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I am satisfied with two different approaches since:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Square Root Crank-Nicolson</title>
      <link>https://chasethedevil.github.io/post/square-root-crank-nicolson/</link>
      <pubDate>Fri, 19 Jun 2015 16:41:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/square-root-crank-nicolson/</guid>
      <description>C. Reisinger kindly pointed out to me &lt;a href=&#34;http://arxiv.org/abs/1210.5487&#34;&gt;this paper around square root Crank-Nicolson&lt;/a&gt;. The idea is to apply a square root of time transformation to the PDE, and discretize the resulting PDE with Crank-Nicolson. Two reasons come to mind to try this: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;the square root transform will result in small steps initially, where the solution is potentially not so smooth, making Crank-Nicolson behave better.&lt;/li&gt;&lt;li&gt;&amp;nbsp;it is the natural time of the Brownian motion.&lt;/li&gt;&lt;/ul&gt;Interestingly, it has nicer properties than what those reasons may suggest. On the Fokker-Planck density PDE, it does not oscillate under some very mild conditions and &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2605160&#34;&gt;preserves density positivity at the peak&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Out of curiosity I tried it to price a one touch barrier option. Of course there is an analytical solution in my test case (Black-Scholes assumptions), but as soon as rates are assumed not constant or local volatility is used, there is no other solution than a numerical method. In the later case, finite difference methods are quite good in terms of performance vs accuracy.&lt;br /&gt;&lt;br /&gt;The classic Crank-Nicolson gives a reasonable price, but the strong oscillations near the barrier, at every time step are not very comforting.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-XNr7vE77Dfo/VYQoBELx2KI/AAAAAAAAICw/FVVYrehW39Y/s1600/Screenshot%2Bfrom%2B2015-06-19%2B16%253A24%253A59.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;337&#34; src=&#34;http://3.bp.blogspot.com/-XNr7vE77Dfo/VYQoBELx2KI/AAAAAAAAICw/FVVYrehW39Y/s640/Screenshot%2Bfrom%2B2015-06-19%2B16%253A24%253A59.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Crank-Nicolson Prices near the Barrier. Each line is a different time.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Moving to square root of time removes nearly all oscillations on this problem, even with a relatively low number of time steps compared to the number of space steps.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-JXVRuhLrMOQ/VYQodTFBDGI/AAAAAAAAIC4/hrsSdQbA5Wo/s1600/Screenshot%2Bfrom%2B2015-06-19%2B16%253A25%253A14.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;338&#34; src=&#34;http://1.bp.blogspot.com/-JXVRuhLrMOQ/VYQodTFBDGI/AAAAAAAAIC4/hrsSdQbA5Wo/s640/Screenshot%2Bfrom%2B2015-06-19%2B16%253A25%253A14.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Square Root Crank-Nicolson Prices near the Barrier. Each line is a different time.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;We can see that the second step prices are a bit higher than the third step (the lines cross), which looks like a small numerical oscillation in time, even if there is no oscillation is space.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-d-xXHOvO1H0/VYQon2V5eiI/AAAAAAAAIDA/4g-YYby4R0A/s1600/Screenshot%2Bfrom%2B2015-06-19%2B16%253A25%253A06.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;338&#34; src=&#34;http://1.bp.blogspot.com/-d-xXHOvO1H0/VYQon2V5eiI/AAAAAAAAIDA/4g-YYby4R0A/s640/Screenshot%2Bfrom%2B2015-06-19%2B16%253A25%253A06.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;TR-BDF2 Prices near the Barrier. Each line is a different time.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;As a comparison, the TR-BDF2 scheme does relatively well: oscillations are removed after the second step, even with the extreme ratio of time steps vs space steps used on this example so that illustrations are clearer - Crank-Nicolson would still oscillate a lot with 10 times less space steps but we would not see oscillation on the square root Crank-Nicolson and a very mild one on TR-BDF2.&lt;br /&gt;&lt;br /&gt;The LMG2 scheme (a local richardson extrapolation) does not oscillate at all on this problem but is the slowest:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-HTxKtzO8au4/VYQo8t-wkdI/AAAAAAAAIDI/oPOjJWs0SI0/s1600/Screenshot%2Bfrom%2B2015-06-19%2B16%253A25%253A53.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;338&#34; src=&#34;http://3.bp.blogspot.com/-HTxKtzO8au4/VYQo8t-wkdI/AAAAAAAAIDI/oPOjJWs0SI0/s640/Screenshot%2Bfrom%2B2015-06-19%2B16%253A25%253A53.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;LMG2 Prices near the Barrier. Each line is a different time.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The square root Crank-Nicolson is quite elegant. It can however not be applied to that many problems in practice, as often some grid times are imposed by the payoff to evaluate, for example in a case of a discrete weekly barrier. But for continuous time problems (density PDE, Vanilla, American, continuous barriers) it&#39;s quite good.&lt;br /&gt;&lt;br /&gt;In reality, with a continuous barrier, the payoff is not discontinuous at every step, but it is only discontinuous at the first step. So Rannacher smoothing would work very well on that problem:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-A-qqKczuefQ/VYQwf2ba_MI/AAAAAAAAIDY/2cYpi_3Y_pI/s1600/Screenshot%2Bfrom%2B2015-06-19%2B17%253A08%253A35.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;338&#34; src=&#34;http://4.bp.blogspot.com/-A-qqKczuefQ/VYQwf2ba_MI/AAAAAAAAIDY/2cYpi_3Y_pI/s640/Screenshot%2Bfrom%2B2015-06-19%2B17%253A08%253A35.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Rannacher Prices near the Barrier. Each line is a different time.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The somewhat interesting payoff left for the square root Crank-Nicolson is the American.&lt;br /&gt;</description>
    </item>
    <item>
      <title>Decoding Hagan&#39;s arbitrage free SABR PDE derivation</title>
      <link>https://chasethedevil.github.io/post/decoding-hagans-arbitrage-free-sabr-pde-derivation/</link>
      <pubDate>Fri, 08 May 2015 16:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/decoding-hagans-arbitrage-free-sabr-pde-derivation/</guid>
      <description>Here are the main steps of Hagan derivation. Let&#39;s recall his notation for the SABR model where typically, \\(C(F) = F^\beta\\)&#xA;&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-uq2IhJPDd7M/VUzC4Hh3xoI/AAAAAAAAH9k/sY034iAD38Y/s1600/Screenshot_2015-05-08_16-04-27.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/-uq2IhJPDd7M/VUzC4Hh3xoI/AAAAAAAAH9k/sY034iAD38Y/s1600/Screenshot_2015-05-08_16-04-27.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;First, he defines the moments of stochastic volatility:&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&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/-RxzKVIrxbl8/VUzC4HGhMNI/AAAAAAAAH9c/7FmxbMuB4kw/s1600/Screenshot_2015-05-08_16-04-53.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;60&#34; src=&#34;http://2.bp.blogspot.com/-RxzKVIrxbl8/VUzC4HGhMNI/AAAAAAAAH9c/7FmxbMuB4kw/s320/Screenshot_2015-05-08_16-04-53.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;Then he integrates the Fokker-Planck equation over all A, to obtain&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-mDsC-Zd6FMA/VUzC4L9dF_I/AAAAAAAAH9g/cAvRNw1VTkg/s1600/Screenshot_2015-05-08_16-05-36.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/-mDsC-Zd6FMA/VUzC4L9dF_I/AAAAAAAAH9g/cAvRNw1VTkg/s1600/Screenshot_2015-05-08_16-05-36.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;On the backward Komolgorov equation, he applies a Lamperti transform like change of variable:&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-QiYromr1SDU/VUzE5q_OfjI/AAAAAAAAH94/nfbr14tEnj0/s1600/Screenshot_2015-05-08_16-10-33.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/-QiYromr1SDU/VUzE5q_OfjI/AAAAAAAAH94/nfbr14tEnj0/s1600/Screenshot_2015-05-08_16-10-33.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;And then makes another change of variable so that the PDE has the same initial conditions for all moments: &#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-1C8j58UD1lA/VUzE5hZJ95I/AAAAAAAAH-I/541DaJBFbAU/s1600/Screenshot_2015-05-08_16-12-34.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/-1C8j58UD1lA/VUzE5hZJ95I/AAAAAAAAH-I/541DaJBFbAU/s1600/Screenshot_2015-05-08_16-12-34.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;This leads to&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/--wj3nYsi9g8/VUzE5glQ0VI/AAAAAAAAH98/NlVSXIc2NDI/s1600/Screenshot_2015-05-08_16-13-32.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;107&#34; src=&#34;http://3.bp.blogspot.com/--wj3nYsi9g8/VUzE5glQ0VI/AAAAAAAAH98/NlVSXIc2NDI/s320/Screenshot_2015-05-08_16-13-32.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;It turns out that there is a magical symmetry for k=0 and k=2.&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-OStv8D0OSw0/VUzGJ6HKqDI/AAAAAAAAH-Y/jk85U57eHnY/s1600/Screenshot_2015-05-08_16-19-45.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;32&#34; src=&#34;http://1.bp.blogspot.com/-OStv8D0OSw0/VUzGJ6HKqDI/AAAAAAAAH-Y/jk85U57eHnY/s320/Screenshot_2015-05-08_16-19-45.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&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/-67k-xTphi7Q/VUzGJwbwSWI/AAAAAAAAH-U/Faz235QNpKs/s1600/Screenshot_2015-05-08_16-20-09.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;32&#34; src=&#34;http://3.bp.blogspot.com/-67k-xTphi7Q/VUzGJwbwSWI/AAAAAAAAH-U/Faz235QNpKs/s320/Screenshot_2015-05-08_16-20-09.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;Note that in the second equation, the second derivative applies to the whole.&#xA;Because of this, he can express \\(Q^{(2)}\\) in terms of \\(Q^{(0)}\\):&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-k-3DQd9MuIQ/VUzHl5TSuAI/AAAAAAAAH-s/CjTFtlX4upw/s1600/Screenshot_2015-05-08_16-25-36.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;29&#34; src=&#34;http://1.bp.blogspot.com/-k-3DQd9MuIQ/VUzHl5TSuAI/AAAAAAAAH-s/CjTFtlX4upw/s320/Screenshot_2015-05-08_16-25-36.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;And he plugs that back to the integrated Fokker-Planck equation to obtain the arbitrage free SABR PDE:&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-aEwTOxulsWI/VUzHl3qfZAI/AAAAAAAAH-o/qQZPb8Vvz7o/s1600/Screenshot_2015-05-08_16-25-48.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;29&#34; src=&#34;http://1.bp.blogspot.com/-aEwTOxulsWI/VUzHl3qfZAI/AAAAAAAAH-o/qQZPb8Vvz7o/s320/Screenshot_2015-05-08_16-25-48.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&#xA;There is a simple more common explanation in the world of local stochastic volatility for what&#39;s going on. For example, in the particle method paper from Guyon-Labordère, we have the following expression for the true local volatility.&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-uV792mNz4Xo/Ul6baEs2ktI/AAAAAAAAG1U/8Iv1i23oXok/s1600/Screenshot%2Bfrom%2B2013-10-16%2B15%3A51%3A46.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;127&#34; src=&#34;http://3.bp.blogspot.com/-uV792mNz4Xo/Ul6baEs2ktI/AAAAAAAAG1U/8Iv1i23oXok/s320/Screenshot%2Bfrom%2B2013-10-16%2B15%3A51%3A46.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&#xA;&#xA;&#xA;&lt;p&gt;In the first equation, the numerator is simply \(Q^{(2)}\) and the denominator \(Q^{(0)}\). Of course, the integrated Fokker-Planck equation can be rewritten as:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Matching Hagan PDE SABR with the one-step Andreasen-Huge SABR</title>
      <link>https://chasethedevil.github.io/post/matching-hagan-pde-sabr-with-the-one-step-andreasen-huge-sabr/</link>
      <pubDate>Thu, 30 Apr 2015 17:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/matching-hagan-pde-sabr-with-the-one-step-andreasen-huge-sabr/</guid>
      <description>&lt;p&gt;I looked nearly two years ago already at &lt;a href=&#34;https://chasethedevil.github.io/post/sabr-with-new-hagan-pde-approach&#34;&gt;the arbitrage free SABR of Andreasen-Huge in comparison to the arbitrage free PDE of Hagan&lt;/a&gt; and showed how close the &lt;a href=&#34;https://chasethedevil.github.io/post/arbitrage-free-sabr---another-view-on-hagan-approach&#34;&gt;ideas were&lt;/a&gt;: Andreasen-Huge relies on the normal Dupire forward PDE using a slightly simpler local vol (no time dependent exponential term) while Hagan works directly on the Fokker-Planck PDE (you can think of it as the Dupire Forward PDE for the density) and uses an expansion of same order as the original SABR formula (which leads to an additional exponential term in the local volatility).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Modern Programming Language for Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/modern-programming-language-for-monte-carlo/</link>
      <pubDate>Sat, 18 Apr 2015 22:58:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Volatility Swap vs Variance Swap Replication - Truncation</title>
      <link>https://chasethedevil.github.io/post/volatility-swap-vs-variance-swap-replication---truncation/</link>
      <pubDate>Mon, 16 Mar 2015 14:39:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/volatility-swap-vs-variance-swap-replication---truncation/</guid>
      <description>&lt;p&gt;I have looked at &lt;a href=&#34;https://chasethedevil.github.io/post/jumps-impact-variance-swap-vs-volatility-swap/&#34;&gt;jump effects on volatility vs. variance swaps&lt;/a&gt;. There is a similar behavior on tail events, that is, on truncating the replication. One main &lt;a href=&#34;https://chasethedevil.github.io/post/variance-swap-replication--discrete-or-continuous&#34;&gt;problem with discrete replication of variance swaps&lt;/a&gt; is the implicit domain truncation, mainly because the variance swap equivalent log payoff is far from being linear in the wings. The equivalent payoff with Carr-Lee for a volatility swap is much more linear in the wings (&lt;a href=&#34;https://chasethedevil.github.io/post/a-volatility-swap-and-a-straddle&#34;&gt;not so far of a straddle&lt;/a&gt;). So we could expect the replication to be less sensitive to the wings truncation.&#xA;I have done a simple test on flat 40% volatility:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Arbitrage free SABR with negative rates - alternative to shifted SABR</title>
      <link>https://chasethedevil.github.io/post/arbitrage-free-sabr-with-negative-rates---alternative-to-shifted-sabr/</link>
      <pubDate>Wed, 11 Mar 2015 18:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/arbitrage-free-sabr-with-negative-rates---alternative-to-shifted-sabr/</guid>
      <description>&lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2557046&#34;&gt;Antonov et al.&lt;/a&gt; present an interesting view on SABR with negative rates: instead of relying on a shifted SABR to allow negative rates up to a somewhat arbitrary shift, they modify slightly the SABR model to allow negative rates directly:&#xA;$$ dF_t = |F_t|^\beta v_t dW_F $$&#xA;with \\( v\_t \\) being the standard lognormal volatility process of SABR.&lt;br /&gt;&lt;br /&gt;Furthermore they derive a clever semi-analytical approximation for this model, based on low correlation, quite close to the Monte-Carlo prices in their tests. It&#39;s however not clear if it is arbitrage-free.&lt;br /&gt;&lt;br /&gt;It turns out that it is easy to tweak Hagan SABR PDE approach to this &#34;absolute SABR&#34; model: one just needs to push the boundary \\(F\_{min}\\) far away, and to use the absolute value in C(F).&lt;br /&gt;&lt;br /&gt;It then reproduces the same behavior as in Antonov et al. paper:&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-kKiSIo-QgAg/VQBp3sRtYFI/AAAAAAAAH34/_A9DKmA_n-E/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A13%3A45%2BPM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://1.bp.blogspot.com/-kKiSIo-QgAg/VQBp3sRtYFI/AAAAAAAAH34/_A9DKmA_n-E/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A13%3A45%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;&#34;Absolute SABR&#34; arbitrage free PDE&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-cRLZged_Ees/VQBp7sKKTrI/AAAAAAAAH4A/PIZbUBBHP1I/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A14%3A02%2BPM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-cRLZged_Ees/VQBp7sKKTrI/AAAAAAAAH4A/PIZbUBBHP1I/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A14%3A02%2BPM.png&#34; height=&#34;250&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Antonov et al. graph&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&amp;nbsp;I obtain a higher spike, it would look much more like Antonov graph had I used a lower resolution to compute the density: the spike would be smoothed out.&lt;br /&gt;&lt;br /&gt;Interestingly, the arbitrage free PDE will also work for high beta (larger than 0.5):&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-YngRqD1ilNw/VQBroKrwKWI/AAAAAAAAH4M/3h9N7zHVjx0/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A21%3A13%2BPM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-YngRqD1ilNw/VQBroKrwKWI/AAAAAAAAH4M/3h9N7zHVjx0/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A21%3A13%2BPM.png&#34; height=&#34;190&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;beta = 0.75&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;It turns out to be then nearly the same as the absorbing SABR, even if prices can cross a little the 0. This is how the bpvols look like with beta = 0.75:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-J_cdl8wwUms/VQBsOst-xYI/AAAAAAAAH4U/xWRMyUpOwxA/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A24%3A18%2BPM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-J_cdl8wwUms/VQBsOst-xYI/AAAAAAAAH4U/xWRMyUpOwxA/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A24%3A18%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;red = absolute SABR, blue = absorbing SABR with beta=0.75&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;They overlap when the strike is positive.&lt;br /&gt;&lt;br /&gt;If we go back to Antonov et al. first example, the bpvols look a bit funny (very symmetric) with beta=0.1:&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/-DrQY0znkznc/VQBsxqF8GAI/AAAAAAAAH4g/MGMwg4sS2Zw/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A26%3A30%2BPM.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/-DrQY0znkznc/VQBsxqF8GAI/AAAAAAAAH4g/MGMwg4sS2Zw/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A26%3A30%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;For beta=0.25 we also reproduce Antonov bpvol graph, but with a lower slope for the left wing:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-QtPOjLCr4ts/VQBtT6hqvmI/AAAAAAAAH4o/jHLn9yC6Frk/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A28%3A55%2BPM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://1.bp.blogspot.com/-QtPOjLCr4ts/VQBtT6hqvmI/AAAAAAAAH4o/jHLn9yC6Frk/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A28%3A55%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;bpvols with beta = 0.25&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;It&#39;s interesting to see that in this case, the positive strikes bp vols are closer to the normal Hagan analytic approximation (which is not arbitrage free) than to the absorbing PDE solution.&lt;br /&gt;&lt;br /&gt;For longer maturities, the results start to be a bit different from Antonov, as Hagan PDE relies on a order 2 approximation only:&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-kPhdB8qyCKI/VQBuC3w2G4I/AAAAAAAAH40/lIIp0-zSokU/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A31%3A59%2BPM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-kPhdB8qyCKI/VQBuC3w2G4I/AAAAAAAAH40/lIIp0-zSokU/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A31%3A59%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;absolute SABR PDE with 10y maturity&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&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/-h2QCjhFGF14/VQBuTcUmlOI/AAAAAAAAH48/TarV9Gu24M0/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A33%3A08%2BPM.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/-h2QCjhFGF14/VQBuTcUmlOI/AAAAAAAAH48/TarV9Gu24M0/s1600/Screenshot%2B-%2B03112015%2B-%2B05%3A33%3A08%2BPM.png&#34; height=&#34;153&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;The right wing is quite similar, except when it goes towards 0, it&#39;s not as flat, the left wing is much lower.&lt;br /&gt;&lt;br /&gt;Another important aspect is to reproduce Hagan&#39;s knee, the atm vols should produce a knee like curve, as different studies show (see for example &lt;a href=&#34;http://www-2.rotman.utoronto.ca/~hull/downloadablepublications/TreeBuilding.pdf&#34;&gt;this recent Hull &amp;amp; White study&lt;/a&gt; or this &lt;a href=&#34;http://www.tandfonline.com/doi/abs/10.1080/14697688.2012.740569&#34;&gt;other recent analysis by DeGuillaume&lt;/a&gt;). Using the same parameters as Hagan (beta=0, rho=0) leads to a nearly flat bpvol: no knee for the absolute SABR, curiously there is a bump at zero, possibly due to numerical difficulty with the spike in the density:&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/-H7PhpMWdy6U/VQB_m9TNZ0I/AAAAAAAAH5M/4yp7RMOwmo4/s1600/Screenshot%2B-%2B03112015%2B-%2B06%3A46%3A44%2BPM.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/-H7PhpMWdy6U/VQB_m9TNZ0I/AAAAAAAAH5M/4yp7RMOwmo4/s1600/Screenshot%2B-%2B03112015%2B-%2B06%3A46%3A44%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;The problem is still there with beta = 0.1:&lt;br /&gt;&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://3.bp.blogspot.com/-ljZ11v0FIqw/VQB_m_hao1I/AAAAAAAAH5Q/Jpn7wgZ2Dwg/s1600/Screenshot%2B-%2B03112015%2B-%2B06%3A46%3A55%2BPM.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/-ljZ11v0FIqw/VQB_m_hao1I/AAAAAAAAH5Q/Jpn7wgZ2Dwg/s1600/Screenshot%2B-%2B03112015%2B-%2B06%3A46%3A55%2BPM.png&#34; height=&#34;191&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Overall, the idea of extending SABR to the full real line with the absolute value looks particularly simple, but it&#39;s not clear that it makes real financial sense.</description>
    </item>
    <item>
      <title>Variance swaps on a foreign asset</title>
      <link>https://chasethedevil.github.io/post/variance-swaps-on-a-foreign-asset/</link>
      <pubDate>Tue, 24 Feb 2015 13:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/variance-swaps-on-a-foreign-asset/</guid>
      <description>There is very little information on variance swaps on a foreign asset. There can be two kinds of contracts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;one that pays the foreign variance in a domestic currency, this is a quanto contract as the exchange rate is implicitly fixed.&lt;/li&gt;&lt;li&gt;one that pays the foreign variance, multiplied by the fx rate at maturity. This is a flexo contract, and is just about buying a variance swap from a foreign bank. The price of such a contract today is very simple, just the standard variance swap price multiplied by the fx rate today (change of measure).&lt;/li&gt;&lt;/ul&gt;For quanto contracts, it&#39;s not so obvious a priori. If we consider a stochastic volatility model for the asset, the replication formula will not be applicable directly as the stochastic volatility will appear in the quanto drift correction. Furthermore, vanilla quanto option prices can not be computed simply as under Black-Scholes, a knowledge of the underlying model is necessary.&lt;br /&gt;&lt;br /&gt;Interestingly, under the Schobel-Zhu model, it is simple to fit an analytic formula for the quanto variance swap. The standard variance swap price is:&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/-gfq9trxBHhg/VOxxHi0khTI/AAAAAAAAH00/xD8NbXUSJls/s1600/Screenshot%2B-%2B230215%2B-%2B19%3A33%3A17.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/-gfq9trxBHhg/VOxxHi0khTI/AAAAAAAAH00/xD8NbXUSJls/s1600/Screenshot%2B-%2B230215%2B-%2B19%3A33%3A17.png&#34; height=&#34;50&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;The quanto variance swap can be priced with the same formula using a slightly different theta:&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/-OwYg8Hs9qRw/VOxxMe-iifI/AAAAAAAAH08/xBeV56UEGV8/s1600/Screenshot%2B-%2B230215%2B-%2B19%3A34%3A06.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/-OwYg8Hs9qRw/VOxxMe-iifI/AAAAAAAAH08/xBeV56UEGV8/s1600/Screenshot%2B-%2B230215%2B-%2B19%3A34%3A06.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;We can use it to assess the accuracy of a naive quanto option replication where we use the ATM quanto forward instead of the forward in the variance swap replication formula.&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://4.bp.blogspot.com/-ate0oZ41eoY/VOxxhwqGI_I/AAAAAAAAH1E/6LRgNiAHCJg/s1600/Screenshot%2B-%2B230215%2B-%2B19%3A34%3A52.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/-ate0oZ41eoY/VOxxhwqGI_I/AAAAAAAAH1E/6LRgNiAHCJg/s1600/Screenshot%2B-%2B230215%2B-%2B19%3A34%3A52.png&#34; height=&#34;289&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Interestingly, the&amp;nbsp; quanto forward approximation turns out to be very accurate and the correction is important. The price without correction is the price with zero correlation, and we see it can be +/-5% off in this case.&lt;br /&gt;&lt;br /&gt;The local vol price seems a bit off, I am not sure exactly why. It could be due the discretization, the theoretical variance should be divided by (N-1) but here we divide by N where N is the number of observations. That would still lead to a skewed price but better centered around correlation 0.&lt;br /&gt;&lt;br /&gt;It&#39;s also a bit surprising that local vol is worse than the simpler ATM quanto forward approximation: it seems that it&#39;s extracting the wrong information to do a more precise quanto correction, likely related to the shift of stochastic volatility under the domestic measure.</description>
    </item>
    <item>
      <title>Jumps impact: Variance swap vs volatility swap</title>
      <link>https://chasethedevil.github.io/post/jumps-impact-variance-swap-vs-volatility-swap/</link>
      <pubDate>Fri, 20 Feb 2015 13:24:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/jumps-impact-variance-swap-vs-volatility-swap/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20-%20200215%20-%2013%2013%2038.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Beside &lt;a href=&#34;https://chasethedevil.github.io/post/variance-swap-replication--discrete-or-continuous&#34;&gt;the problem with the discreteness&lt;/a&gt; of the replication, variance swaps are sensitive to jumps. This is an often mentioned reason for the collapse of the single name variance swap market in 2008 as jumps are more likely on single name equities.&lt;/p&gt;&#xA;&lt;p&gt;Those graphs are the result of Monte-Carlo simulations with various jump sizes using the Bates model, and using Local Volatility implied from the Bates vanilla prices. The local volatility price will be the same price as per static replication for the variance swap, and we can see it they converge when there is no jump.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Variance Swap Replication : Discrete or Continuous?</title>
      <link>https://chasethedevil.github.io/post/variance-swap-replication--discrete-or-continuous/</link>
      <pubDate>Thu, 19 Feb 2015 18:45:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/variance-swap-replication--discrete-or-continuous/</guid>
      <description>People regularly believe that Variance swaps need to be priced by discrete replication, because the market trades only a discrete set of options.&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/-9dEW7QRFa7k/VOYguM8BHOI/AAAAAAAAH0Q/RPFxCeyq6nU/s1600/Screenshot%2B-%2B190215%2B-%2B18%3A36%3A26.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/-9dEW7QRFa7k/VOYguM8BHOI/AAAAAAAAH0Q/RPFxCeyq6nU/s1600/Screenshot%2B-%2B190215%2B-%2B18%3A36%3A26.png&#34; height=&#34;340&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In reality, a discrete replication will misrepresent the tail, and can be quite arbitrary. It looks like the discrete replication as described in &lt;a href=&#34;http://bfi.cl/papers/Derman%201999%20-%20More%20about%20Variance%20Swaps.pdf&#34;&gt;Derman Goldman Sachs paper&lt;/a&gt; is in everybody&#39;s mind, probably because it&#39;s easy to grasp. Strangely, it looks like most forget the section &#34;Practical problems with replication&#34; on p27 of his paper, where you can understand that discrete replication is not all that practical.&lt;br /&gt;&lt;br /&gt;Reflecting on all of this, I noticed it was possible to create more accurate discrete replications easily, and that those can have vastly different hedging weights. It is a much better idea to just replicate the log payoff continuously with a decent model for interpolation and extrapolation and imply the hedge from the greeks.&lt;br /&gt;&lt;br /&gt;I wrote &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2567398&#34;&gt;a small paper around this here&lt;/a&gt;.</description>
    </item>
    <item>
      <title>GTK 3.0 / Gnome 3.0 annoyance</title>
      <link>https://chasethedevil.github.io/post/gtk-3.0--gnome-3.0-annoyance/</link>
      <pubDate>Sun, 08 Feb 2015 22:30:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/gtk-3.0--gnome-3.0-annoyance/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s quite incredible that Gnome 3.0 was almost an identical mess as KDE 4.0 had been a year or two earlier. Both are much better now, more stable, but both also still have their issues, and don&amp;rsquo;t feel like a real improvement over Gnome 2.0 or KDE 3.5.&lt;/p&gt;&#xA;&lt;p&gt;Now the main file manager for Gnome 3.0, Nautilus has buttons with nearly identical icons that mean vastly different things, one is a menu, the other is a list view. Also it does not integrate with other desktops well from a look and feel perpective, here is a screenshot under XFCE (KDE would not look better).The push for window buttons inside the toolbar makes for a funny looking window. In Gnome Shell, it&amp;rsquo;s not much better, plus there are some windows with a dark theme and some with a standard theme all mixed together.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Monte Carlo &amp; Inverse Cumulative Normal Distribution</title>
      <link>https://chasethedevil.github.io/post/monte-carlo--inverse-cumulative-normal-distribution/</link>
      <pubDate>Tue, 03 Feb 2015 14:53:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/monte-carlo--inverse-cumulative-normal-distribution/</guid>
      <description>In most financial Monte-Carlo simulations, there is the need of generating normally distributed random numbers. One technique is to use the inverse cumulative normal distribution function on uniform random numbers. There are several different popular numerical implementations:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Wichura AS241 (1988)&lt;/li&gt;&lt;li&gt;Moro &#34;The full Monte&#34; (1995)&lt;/li&gt;&lt;li&gt;&lt;a href=&#34;http://home.online.no/~pjacklam/notes/invnorm/&#34;&gt;Acklam&lt;/a&gt; (2004)&lt;/li&gt;&lt;li&gt;&lt;a href=&#34;http://arxiv.org/abs/0901.0638&#34;&gt;Shaw breakless formula&lt;/a&gt; optimized for GPUs (2011) &lt;/li&gt;&lt;/ul&gt;W. Shaw has an excellent overview of the accuracy of the various methods in his paper &lt;i&gt;&lt;a href=&#34;http://www.mth.kcl.ac.uk/~shaww/web_page/papers/NormalQuantile1.pdf&#34;&gt;Refinement of the normal quantile&lt;/a&gt;&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;But what about performance? In Monte-Carlo, we could accept a slighly lower accuracy for an increase in performance.&lt;br /&gt;&lt;br /&gt;I tested the various methods on the Euler full truncation scheme for Heston using a small timestep (0.01). Here are the results with Sobol quasi-rng:&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;AS241&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.9186256922511046 0.42s&lt;br /&gt;MORO &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.9186256922459066 0.38s&lt;/span&gt;&lt;/span&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;ACKLAM &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.9186256922549364 0.40s&lt;/span&gt;&lt;/span&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;ACKLAM REFINED 0.9186256922511045 2.57s&lt;br /&gt;SHAW-HYBRID &amp;nbsp;&amp;nbsp; 0.9186256922511048 0.68s&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In practice, the most accurate algorithm, AS241, is of comparable speed as the newer but less accurate algorithms of MORO and ACKLAM. Acklam refinement to go to double precision (which AS241 is) kills its performance.&lt;br /&gt;&lt;br /&gt;What about the Ziggurat on pseudo rng only? Here are the results with Mersenne-Twister-64, and using the Doornik implementation of the Ziggurat algorithm:&lt;br /&gt;&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;AS241&amp;nbsp; 0.9231388565879476&amp;nbsp; 0.49s&lt;br /&gt;ZIGNOR 0.9321405648313437&amp;nbsp; 0.44s&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a more optimized algorithm, VIZIGNOR, also from Doornik which should be a bit faster. As expected, the accuracy is quite lower than with Sobol, and the Ziggurat looks worse. This is easily visible if one plots the implied volatilities as a function of the spot for AS241 and for ZIGNOR.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-lITlDFhF-cE/VNDQfqtNbTI/AAAAAAAAHzU/zki5VJADyv4/s1600/Screenshot%2Bfrom%2B2015-02-03%2B14%3A43%3A10.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-lITlDFhF-cE/VNDQfqtNbTI/AAAAAAAAHzU/zki5VJADyv4/s1600/Screenshot%2Bfrom%2B2015-02-03%2B14%3A43%3A10.png&#34; height=&#34;321&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;AS241 implied volatility on Mersenne-Twister&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-QxKOGzNMSXE/VNDQp7dL0EI/AAAAAAAAHzc/wm1c-ymLYww/s1600/Screenshot%2Bfrom%2B2015-02-03%2B14%3A18%3A51.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://1.bp.blogspot.com/-QxKOGzNMSXE/VNDQp7dL0EI/AAAAAAAAHzc/wm1c-ymLYww/s1600/Screenshot%2Bfrom%2B2015-02-03%2B14%3A18%3A51.png&#34; height=&#34;321&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;ZIGNOR implied volatility on Mersenne-Twister&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Zignor is much noisier.&lt;br /&gt;&lt;br /&gt;Note the slight bump in the scheme EULER-FT-BK that appears because the scheme, that approximates the Broadie-Kaya integrals with a trapeze (as in Andersen QE paper), does not respect martingality that well compared to the standard full truncated Euler scheme EULER-FT, and the slightly improved EULER-FT-MID where the variance integrals are approximated by a trapeze as in Van Haastrecht paper on Schobel-Zhu:&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/-pIO5C8vN1Es/VNDSPriO-OI/AAAAAAAAHzo/d0DUYBjiG8Q/s1600/Screenshot%2B-%2B030215%2B-%2B14%3A49%3A29.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/-pIO5C8vN1Es/VNDSPriO-OI/AAAAAAAAHzo/d0DUYBjiG8Q/s1600/Screenshot%2B-%2B030215%2B-%2B14%3A49%3A29.png&#34; height=&#34;76&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;This allows to leak less correlation than the standard full truncated Euler.</description>
    </item>
    <item>
      <title>Local Stochastic Volatility - Particles and Bins</title>
      <link>https://chasethedevil.github.io/post/local-stochastic-volatility---particles-and-bins/</link>
      <pubDate>Fri, 30 Jan 2015 12:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/local-stochastic-volatility---particles-and-bins/</guid>
      <description>&lt;p&gt;In an &lt;a href=&#34;https://chasethedevil.github.io/post/local-stochastic-volatility-with-monte-carlo&#34;&gt;earlier post&lt;/a&gt;, I mentioned the similarities between the Guyon-Labordere &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1885032&#34;&gt;particle method&lt;/a&gt; and the Vanderstoep-Grzelak-Oosterlee &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDIQFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fabstract%3D2278122&amp;amp;ei=255eUqaEDMaxhAfdqoBI&amp;amp;usg=AFQjCNF2KqSTT2ouvAyiA2J77foOFTzMKw&amp;amp;sig2=fzb4vlDPp49Hp1oT5Wja4A&amp;amp;bvm=bv.54176721,d.ZG4&#34;&gt;&amp;ldquo;bin&amp;rdquo; method&lt;/a&gt; to calibrate and price under Local Stochastic volatility. I will be a bit more precise here. &lt;strong&gt;The same thing, really&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The particle method can be seen as a generalization of the &amp;ldquo;bin&amp;rdquo; method. In deed, the bin method consists in doing the particle method using a histogram estimation of the conditional variance. The histogram estimation can be more or less seen as a very basic rectangle kernel with the appropriate bandwidth. The &amp;ldquo;bin&amp;rdquo; method is then just the particle method with another kernel (wiki link) (in the particle method, the kernel is a quartic with bandwidth defined by some slightly elaborate formula). A very good paper on this is Silverman &lt;em&gt;&lt;a href=&#34;https://ned.ipac.caltech.edu/level5/March02/Silverman/paper.pdf&#34;&gt;Density estimation for statistics and data analysis&lt;/a&gt;&lt;/em&gt;, referenced by Guyon-Labordere.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Flat Volatility Surfaces &amp; Discrete Dividends</title>
      <link>https://chasethedevil.github.io/post/flat-volatility-surfaces--discrete-dividends/</link>
      <pubDate>Tue, 25 Nov 2014 13:58:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/flat-volatility-surfaces--discrete-dividends/</guid>
      <description>In papers around volatility and cash (discrete) dividends, we often encounter the example of the flat volatility surface. For example, the &lt;a href=&#34;http://www.opengamma.com/sites/default/files/equity-variance-swaps-dividends-opengamma.pdf&#34;&gt;OpenGamma paper&lt;/a&gt; presents this graph:&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/-AuaTFyvjgVA/VHRxUid4HzI/AAAAAAAAHjs/T4PAQTnUBN8/s1600/Screenshot%2Bfrom%2B2014-11-25%2B12%3A59%3A09.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/-AuaTFyvjgVA/VHRxUid4HzI/AAAAAAAAHjs/T4PAQTnUBN8/s1600/Screenshot%2Bfrom%2B2014-11-25%2B12%3A59%3A09.png&#34; height=&#34;167&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It shows that if the Black volatility surface is fully flat, there are jumps in the pure volatility surface (corresponding to a process that includes discrete dividends in a consistent manner) at the dividend dates or equivalently if the pure volatility surface is flat, the Black volatility jumps.&lt;br /&gt;&lt;br /&gt;This can be traced to the fact that the Black formula does not respect C(S,K,Td-) = C(S,K-d,Td) as the forward drops from F(Td-) to F(Td-)-d where d is dividend amount at td, the dividend ex date.&lt;br /&gt;&lt;br /&gt;Unfortunately, those examples are not very helpful. In practice, the market observables are just Black volatility points, which can be interpolated to volatility slices for each expiry without regards to dividends, not a full volatility surface. Discrete dividends will mostly happen between two slices: the Black volatility jump will happen on some time-interpolated data.&lt;br /&gt;&lt;br /&gt;While the jump size is known (it must obey to the call price continuity), the question of how one should interpolate that data until the jump is far from trivial even using two flat Black volatility slices.&lt;br /&gt;&lt;br /&gt;The most logical is to consider a model that includes discrete dividends consistently. For example, one can fully lookup the Black volatility corresponding the price of an option assuming a piecewise lognormal process with jumps at the dividend dates. It can be priced by applying a finite difference method on the PDE. Alternatively, &lt;a href=&#34;http://www.risk.net/risk-magazine/technical-paper/1530307/finessing-fixed-dividends&#34;&gt;Bos &amp;amp; Vandermark&lt;/a&gt; propose a simple spot and strike adjusted Black formula that obey the continuity requirement (the Lehman model), which, in practice, stays quite close to the piecewise lognormal model price. Another possibility is to rely on a forward modelling of the dividends, as in &lt;a href=&#34;http://www.quantitative-research.de/dl/Dividends_And_Volatility.pdf&#34;&gt;Buehler&lt;/a&gt; (if one is comfortable with the idea that the option price will then depend ultimately on dividends past the option expiry).&lt;br /&gt;&lt;br /&gt;Recently, a &lt;a href=&#34;http://onlinelibrary.wiley.com/doi/10.1002/wilm.10112/abstract&#34;&gt;Wilmott article&lt;/a&gt; suggested to only rely on the jump adjustment, but did not really mention how to find the volatility just before or just after the dividend. Here is an illustration of how those assumptions can change the volatility in between slices using two dividends at T=0.9 and T=1.1.&lt;br /&gt;&lt;br /&gt;In the first graph, we just interpolate linearly in forward moneyness the pure vol from the Bos &amp;amp; Vandermark formula, as it should be continuous with the forward (the PDE would give nearly the same result) and compute the equivalent Black volatility (and thus the jump at the dividend dates).&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/-Pye5KeoR16M/VHR1WACQD3I/AAAAAAAAHj4/h65Vpj4mMjI/s1600/bos_2_div_flat.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/-Pye5KeoR16M/VHR1WACQD3I/AAAAAAAAHj4/h65Vpj4mMjI/s1600/bos_2_div_flat.png&#34; height=&#34;300&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In the second graph, we interpolate linearly the two Black slices, until we find a dividend, at which point we impose the jump condition and repeat the process until the next slice. We process forward (while the Wilmott article processes backward) as it seemed a bit more natural to make the interpolation not depend on future dividends. Processing backward would just make the last part flat and first part down-slopping. On this example backward would be closer to the Bos Black volatility, but when the dividends are near the first slice, the opposite becomes true.&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/-ScSlBHCBoWc/VHR1eOigrXI/AAAAAAAAHkA/3HJ9zRQvguA/s1600/blackjump_2_div_flat.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/-ScSlBHCBoWc/VHR1eOigrXI/AAAAAAAAHkA/3HJ9zRQvguA/s1600/blackjump_2_div_flat.png&#34; height=&#34;300&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;While the scale of those changes is not that large on the example considered, the choice can make quite a difference in the price of structures that depend on the volatility in between slices. A recent example I encountered is the variance swap when one includes adjustment for discrete dividends (then the prices just after the dividend date are used).&lt;br /&gt;&lt;br /&gt;To conclude, if one wants to use the classic Black formula everywhere, the volatility must jump at the dividend dates. Interpolation in time is then not straightforward and one will need to rely on a consistent model to interpolate. It is not exactly clear then why would anyone stay with the Black formula except familiarity.</description>
    </item>
    <item>
      <title>Machine Learning &amp; Quantitative Finance</title>
      <link>https://chasethedevil.github.io/post/machine-learning--quantitative-finance/</link>
      <pubDate>Tue, 18 Nov 2014 12:34:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/machine-learning--quantitative-finance/</guid>
      <description>&lt;p&gt;There is an interesting course on &lt;a href=&#34;https://class.coursera.org/ml-007/lecture&#34;&gt;Machine Learning on Coursera&lt;/a&gt;, it does not require much knowledge and yet manages to teach quite a lot.&lt;/p&gt;&#xA;&lt;p&gt;I was struck by the fact that most techniques and ideas apply also to problems in quantitative finance.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Linear regression: used for example in the Longstaff-Schwartz approach to price Bermudan options with Monte-Carlo. Interestingly the teacher insists on feature normalization, something we can forget easily, especially with the polynomial features.&lt;/li&gt;&#xA;&lt;li&gt;Gradient descent: one of the most basic minimizer and we use minimizers all the time for model calibration.&lt;/li&gt;&#xA;&lt;li&gt;Regularization: in finance, this is sometimes used to smooth out the volatility surface, or can be useful to add stability in calibration. The lessons are very practical, they explain well how to find the right value of the regularization parameter.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://en.wikipedia.org/wiki/Artificial_neural_network&#34;&gt;Neural networks&lt;/a&gt;: calibrating a model is very much like training a neural network. The &lt;a href=&#34;http://en.wikipedia.org/wiki/Backpropagation&#34;&gt;backpropagation&lt;/a&gt; is the same thing as the adjoint differentiation. It&amp;rsquo;s very interesting to see that it is a key feature for Neural networks, otherwise training would be much too slow and Neural networks would not be practical. Once the network is trained, it is evaluated relatively quickly forward. It&amp;rsquo;s basically the same thing as calibration and then pricing.&lt;/li&gt;&#xA;&lt;li&gt;Support vector machines: A gaussian kernel is often used to represent the frontier. We find the same idea in the particle Monte-Carlo method.&lt;/li&gt;&#xA;&lt;li&gt;Principal component analysis: can be applied to the covariance matrix square root in Monte-Carlo simulations, or to &amp;ldquo;compress&amp;rdquo; large baskets, as well as for portfolio risk.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It&amp;rsquo;s also interesting to hear the teacher repeating that people should not try possible improvements at random (often because they have only one idea) but analyze before what makes the most sense. And that can imply digging in the details, looking at what&amp;rsquo;s going on 100 samples.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pseudo-Random vs Quasi-Random Numbers</title>
      <link>https://chasethedevil.github.io/post/pseudo-random-vs-quasi-random-numbers/</link>
      <pubDate>Wed, 12 Nov 2014 17:05:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/pseudo-random-vs-quasi-random-numbers/</guid>
      <description>Quasi-Random numbers (like &lt;a href=&#34;http://en.wikipedia.org/wiki/Sobol_sequence&#34;&gt;Sobol&lt;/a&gt;) are a relatively popular way in finance to improve the Monte-Carlo convergence compared to more classic Pseudo-Random numbers (like &lt;a href=&#34;http://en.wikipedia.org/wiki/Mersenne_twister&#34;&gt;Mersenne-Twister&lt;/a&gt;). Behind the scenes one has to be a bit more careful about the dimension of the problem as the Quasi-Random numbers depends on the dimension (defined by how many random variables are independent from each other).&lt;br /&gt;&lt;br /&gt;For a long time, Sobol was limited to 40 dimensions using the so called Bratley-Fox direction numbers (his paper actually gives the numbers for 50 dimensions). Later Lemieux gave direction numbers for up to 360 dimensions. Then, P. Jäckel proposed some extension with a random initialization of the direction vectors in his book from 2006. And finally Joe &amp;amp; Kuo published direction numbers for up to 21200 dimensions.&lt;br /&gt;&lt;br /&gt;But there are very few studies about how good are real world simulations with so many quasi-random dimensions. A recent paper &#34;&lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2210420&#34;&gt;Fast Ninomiya-Victoir Calibration of the Double-Mean-Reverting Model&lt;/a&gt;&#34; by Bayer, Gatheral &amp;amp; Karlsmark tests this for once, and the results are not so pretty:&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;https://3.bp.blogspot.com/-aYBusg02Kr0/VGOAlrsHGjI/AAAAAAAAHis/o4zfFf8-5hA/s1600/Screenshot%2Bfrom%2B2014-11-12%2B16%3A15%3A17.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;342&#34; src=&#34;https://3.bp.blogspot.com/-aYBusg02Kr0/VGOAlrsHGjI/AAAAAAAAHis/o4zfFf8-5hA/s640/Screenshot%2Bfrom%2B2014-11-12%2B16%3A15%3A17.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;With their model, the convergence with Sobol numbers becomes worse when the number of time-steps increases, that is when the number of dimension increases. There seems to be even a threshold around 100 time steps (=300 dimensions for Euler) beyond which a much higher number of paths (2^13) is necessary to restore a proper convergence. And they use the latest and greatest Joe-Kuo direction numbers.&lt;br /&gt;&lt;br /&gt;Still the total number of paths is not that high compared to what I am usually using (2^13 = 8192). It&#39;s an interesting aspect of their paper: the calibration with a low number of paths.</description>
    </item>
    <item>
      <title>Integrating an oscillatory function</title>
      <link>https://chasethedevil.github.io/post/integrating-an-oscillatory-function/</link>
      <pubDate>Wed, 05 Nov 2014 16:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/integrating-an-oscillatory-function/</guid>
      <description>Recently, some instabilities were noticed in the Carr-Lee seasoned volatility swap price in some situations. &lt;br /&gt;&lt;br /&gt;The &lt;a href=&#34;https://math.nyu.edu/financial_mathematics/content/02_financial/2008-3.pdf&#34;&gt;Carr-Lee&lt;/a&gt; seasoned volatility swap price involve the computation of a double integral. The inner integral is really the problematic one as the integrand can be highly oscillating.&lt;br /&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-9Fh24CvDs_4/VFpCjz8_sMI/AAAAAAAAHig/Q0iTCTb3f9E/s1600/Screenshot%2Bfrom%2B2014-11-05%2B16%3A30%3A00.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/-9Fh24CvDs_4/VFpCjz8_sMI/AAAAAAAAHig/Q0iTCTb3f9E/s1600/Screenshot%2Bfrom%2B2014-11-05%2B16%3A30%3A00.png&#34; height=&#34;151&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;br /&gt;I&amp;nbsp; first found a somewhat stable behavior using a specific adaptive Gauss-Lobatto implementation (&lt;a href=&#34;http://www.ii.uib.no/%7Eterje/Papers/bit2003.pdf&#34;&gt;the one from Espelid&lt;/a&gt;) and a change of variable. But it was not very satisfying to see that the outer integral was stable only with another specific adaptive Gauss-Lobatto (the one from Gander &amp;amp; Gauschi, present in Quantlib). I tried various choices of adaptive (coteda, modsim, adaptsim,...) or brute force trapezoidal integration, but either they were order of magnitudes slower or unstable in some cases. Just using the same Gauss-Lobatto implementation for both would fail...&lt;br /&gt;&lt;br /&gt;I then noticed you could write the integral as a Fourier transform as well, allowing the use of FFT. Unfortunately, while this worked, it turned out to require a very large number of points for a reasonable accuracy. This, plus the tricky part of defining the proper step size, makes the method not so practical.&lt;br /&gt;&lt;br /&gt;I had heard before of the &lt;a href=&#34;http://www.cs.berkeley.edu/~fateman/papers/oscillate.pdf&#34;&gt;Filon quadrature&lt;/a&gt;, which I thought was more of a curiosity. The main idea is to integrate exactly x^n * cos(k*x). One then relies on a piecewise parabolic approximation of the function f to integrate f(x) * cos(k*x). Interestingly, a very similar idea has been used in the &lt;a href=&#34;http://www.risk.net/risk-magazine/technical-paper/1500323/cutting-edges-domain-integration&#34;&gt;Sali quadrature method&lt;/a&gt; for option pricing, except one integrates exactly x^n * exp(-k*x^2).&lt;br /&gt;&lt;br /&gt;It turned out to be remarkable on that problem, combined with a &lt;a href=&#34;http://en.wikipedia.org/wiki/Adaptive_Simpson%27s_method&#34;&gt;simple adaptive Simpson&lt;/a&gt; like method to find the right discretization. Then as if by magic, any outer integration quadrature worked. &lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>The elusive reference: the Lamperti transform</title>
      <link>https://chasethedevil.github.io/post/the-elusive-reference-the-lamperti-transform/</link>
      <pubDate>Mon, 03 Nov 2014 11:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/the-elusive-reference-the-lamperti-transform/</guid>
      <description>&lt;p&gt;Without knowing that it was a well known general concept, I first noticed the use of the Lamperti transform in the Andersen-Piterbarg &amp;ldquo;Interest rate modeling&amp;rdquo; book p.292 &amp;ldquo;finite difference solutions for general phi&amp;rdquo;.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202014-11-03%2010%2055%2001.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;Pat Hagan used that transformation for a better discretization of the &lt;a href=&#34;https://chasethedevil.github.io/post/coordinate-transform-of-the-andreasen-huge-sabr-pde--spline-interpolation&#34;&gt;arbitrage free SABR PDE model&lt;/a&gt;.I then started to notice the use of this transformation in many more papers. The first one I saw naming it &amp;ldquo;Lamperti transform&amp;rdquo; was the paper from Ait-Sahalia  &lt;a href=&#34;http://www.princeton.edu/~yacine/mle.pdf&#34;&gt;Maximum likelyhood estimation of discretely sampled diffusions: a closed-form approximation approach&lt;/a&gt;. Recently those closed form formulae have been applied to the quadrature method (where one integrates the transition density by a quadrature rule) in &amp;ldquo;Advancing the universality of quadrature methods to any underlying process for option pricing&amp;rdquo;. There is also a recent interesting application to Monte-Carlo simulation in &amp;ldquo;&lt;a href=&#34;http://www-leland.stanford.edu/~glynn/papers/2013/RheeG13a.pdf&#34;&gt;Unbiased Estimation with Square Root Convergence for SDE Models&lt;/a&gt;&amp;rdquo;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Barrier options under negative rates: complex numbers to the rescue</title>
      <link>https://chasethedevil.github.io/post/barrier-options-under-negative-rates-complex-numbers-to-the-rescue/</link>
      <pubDate>Thu, 02 Oct 2014 11:58:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/barrier-options-under-negative-rates-complex-numbers-to-the-rescue/</guid>
      <description>I stumbled upon an unexpected problem: the &lt;a href=&#34;http://books.google.com/books?id=FU7gam7ZqVsC&amp;amp;q=haug+binary+barrier&amp;amp;dq=haug+binary+barrier&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ei=QyAtVITAGdjdatPxgMAO&amp;amp;ved=0CB0Q6AEwAA&#34;&gt;one touch barrier formula&lt;/a&gt; can break down under negative rates. While negative rates can sound fancy, they are actually quite real on some markets. Combined with relatively low volatilities, this makes the standard Black-Scholes one touch barrier formula blow up because somewhere the square root of a negative number is taken.&lt;br /&gt;&lt;br /&gt;At first, I had the idea to just floor the number to 0. But then I needed to see if this rough approximation would be acceptable or not. So I relied on a &lt;a href=&#34;http://www.risk.net/journal-of-computational-finance/technical-paper/2330321/tr-bdf2-for-fast-stable-american-option-pricing&#34;&gt;TR-BDF2&lt;/a&gt; discretization of the Black-Scholes PDE, where negative rates are not a problem.&lt;br /&gt;&lt;br /&gt;Later, I was convinced that we ought to be able to find a closed form formula for the case of negative rates. I went back to the derivation of the formula, &lt;a href=&#34;http://books.google.fr/books?id=2sGwSAfA8eAC&amp;amp;lpg=PA278&amp;amp;dq=kwok%20barrier&amp;amp;pg=PA193#v=onepage&amp;amp;q&amp;amp;f=false&#34;&gt;the book from Kwok&lt;/a&gt; is quite good on that. The closed form formula just stems from being the solution of an integral of the first passage time density (which is a simpler way to compute the one touch price than the PDE approach). It turns out that, then, the closed form solution to this integral with negative rates is just the same formula with complex numbers (there are actually some simplifications then).&lt;br /&gt;&lt;br /&gt;It is a bit uncommon to use the cumulative normal distribution on complex numbers, but the error function on complex numbers is more popular: it&#39;s actually even on &lt;a href=&#34;http://en.wikipedia.org/wiki/Error_function&#34;&gt;the wikipedia page of the error function&lt;/a&gt;. And it can be computed very quickly with machine precision thanks to the &lt;a href=&#34;http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package&#34;&gt;Faddeeva library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;With this simple closed form formula, there is no need anymore for an approximation. I wrote &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2501907&#34;&gt;a small paper around this here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Later a collegue made the remark that it could be interesting to have the bivariate complex normal distribution for the case of partial start one touch options or partial barrier option rebates (not sure if those are common). Unfortunately I could not find any code or paper for this. And after asking Prof. Genz (who found a very elegant and fast algorithm for the bivariate normal distribution), it looks like an open problem.</description>
    </item>
    <item>
      <title>Initial Guesses for SVI - A Summary</title>
      <link>https://chasethedevil.github.io/post/initial-guesses-for-svi---a-summary/</link>
      <pubDate>Fri, 26 Sep 2014 10:46:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/initial-guesses-for-svi---a-summary/</guid>
      <description>&lt;p&gt;I have been looking at various ways of finding initial guesses for SVI calibration (&lt;a href=&#34;https://chasethedevil.github.io/post/another-svi-initial-guess&#34;&gt;Another SVI Initial Guess&lt;/a&gt;, &lt;a href=&#34;https://chasethedevil.github.io/post/more-svi-initial-guesses&#34;&gt;More SVI Initial Guesses&lt;/a&gt;, &lt;a href=&#34;https://chasethedevil.github.io/post/svi-and-long-maturities-issues&#34;&gt;SVI and long maturities issues&lt;/a&gt;). I decided to write &lt;a href=&#34;http://papers.ssrn.com/abstract=2501898&#34;&gt;a paper&lt;/a&gt; summarizing this. I find that the process of writing a paper makes me think more carefully about a problem.&lt;/p&gt;&#xA;&lt;p&gt;In this case, it turns out that the Vogt initial guess method (guess via asymptotes and minimum variance) is actually very good as long as one has a good way to lookup the asymptotes (the data is not always convex, while SVI is) and as long as rho is not close to -1, that is for long maturity affine like smiles, where SVI is actually more difficult to calibrate properly due to the over-parameterisation in those cases.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Asymptotic Behavior of SVI vs SABR</title>
      <link>https://chasethedevil.github.io/post/asymptotic-behavior-of-svi-vs-sabr/</link>
      <pubDate>Tue, 23 Sep 2014 12:06:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/asymptotic-behavior-of-svi-vs-sabr/</guid>
      <description>The variance under SVI becomes linear when the log-moneyness is very large in absolute terms. The lognormal SABR formula with beta=0 or beta=1 has a very different behavior. Of course, the theoretical SABR model has actually a different asymptotic behavior.&lt;br /&gt;&lt;br /&gt;As an illustration, we calibrate SABR (with two different values of beta) and SVI against the same implied volatility slice and look at the wings behavior. &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/-1w0jjvR9-Mk/VCFFhSiOcdI/AAAAAAAAHg4/E3yP_m3vhKA/s1600/Screenshot%2Bfrom%2B2014-09-23%2B11%3A52%3A07.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/-1w0jjvR9-Mk/VCFFhSiOcdI/AAAAAAAAHg4/E3yP_m3vhKA/s1600/Screenshot%2Bfrom%2B2014-09-23%2B11%3A52%3A07.png&#34; height=&#34;497&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;While the Lee moments formula implies that the variance should be at most linear, something that the SABR formula does not respect. It is in practice not the problem with SABR as the actual Lee boundary: V(x) &amp;lt; 2|x|/T (where V is the square of the implied volatility and x the log-moneyness) is attained for extremely low strikes only with SABR, except maybe for very long maturities.&lt;br /&gt;&lt;br /&gt;A related behavior is the fact that the lognormal SABR formula can actually match steeper curvatures at the money than SVI for given asymptotes.</description>
    </item>
    <item>
      <title>SVI and long maturities issues</title>
      <link>https://chasethedevil.github.io/post/svi-and-long-maturities-issues/</link>
      <pubDate>Fri, 01 Aug 2014 12:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/svi-and-long-maturities-issues/</guid>
      <description>&lt;p&gt;On long maturities equity options, the smile is usually very much like a skew: very little curvature. This usually means that the SVI rho will be very close to -1, in a similar fashion as what can happen for the the correlation parameter of a real stochastic volatility model (Heston, SABR).&lt;/p&gt;&#xA;&lt;p&gt;In terms of initial guess, &lt;a href=&#34;https://chasethedevil.github.io/post/another-svi-initial-guess&#34;&gt;I looked&lt;/a&gt; at the more usual use cases and showed that matching a parabola at the minimum variance point often leads to a decent initial guess if one has an ok estimate of the wings. We will see here that we can do also something a bit better than just a flat slice at-the-money in the case where rho is close to -1.&lt;/p&gt;</description>
    </item>
    <item>
      <title>More SVI Initial Guesses</title>
      <link>https://chasethedevil.github.io/post/more-svi-initial-guesses/</link>
      <pubDate>Thu, 31 Jul 2014 14:54:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/more-svi-initial-guesses/</guid>
      <description>In the previous post, I showed one could extract the SVI parameters from a best fit parabola at-the-money. It seemed to work reasonably well, but I found some real market data where it can be much less satisfying.&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://4.bp.blogspot.com/-NBr8TEcIAXQ/U9o1x6oA6AI/AAAAAAAAHc8/g6-auObo244/s1600/Screenshot+from+2014-07-31+14:24:59.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/-NBr8TEcIAXQ/U9o1x6oA6AI/AAAAAAAAHc8/g6-auObo244/s1600/Screenshot+from+2014-07-31+14:24:59.png&#34; height=&#34;588&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;Sometimes (actually not so rarely) the ATM slope and curvatures can&#39;t be matched given rho and b found through the asymptotes. As a result if I force to just match the curvature and set m=0 (when the slope can&#39;t be matched), the simple ATM parabolic guess looks shifted. It can be much worse than this specific example.&lt;br /&gt;&lt;br /&gt;It is then a bit clearer why Vogt looked to match the lowest variance instead of ATM. We can actually also fit a parabola at the lowest variance (MV suffix in the graph) instead of ATM. It seems to fit generally better.&lt;br /&gt;&lt;br /&gt;I also tried to estimate the asymptotic slopes more precisely (using the slope of the 5-points parabola at each end), but it seems to not always be an improvement.&lt;br /&gt;&lt;br /&gt;However this does not work when rho is close to -1 or 1 as there is then no minimum. Often, matching ATM also does not work when rho is -1 or 1. This specific case, but quite common as well for longer expiries in equities need more thoughts, usually a constant slice is ok, but this is clearly where Zeliade&#39;s quasi explicit method shines.&lt;br /&gt;&lt;br /&gt;So far it still all looks good, but then looking at medium maturities (1 year), sometimes all initial guesses don&#39;t look comforting (although Levenberg-Marquardt minimization still works on those - but one can easily imagine that it can break as well, for example by tweaking slightly the rho/b and look at what happens then).&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/-ft_Sj8P5LuU/U9pLLDlt1nI/AAAAAAAAHdY/vMsuRvqonHs/s1600/Screenshot+from+2014-07-31+15:56:06.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/-ft_Sj8P5LuU/U9pLLDlt1nI/AAAAAAAAHdY/vMsuRvqonHs/s1600/Screenshot+from+2014-07-31+15:56:06.png&#34; height=&#34;640&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;There is lots of data on this 1 year example. One can clearly see the problem when the slope can not be fitted ATM (SimpleParabolicATM-guess), and even if by chance when it can (TripleParabolicATM-guess), it&#39;s not so great.&lt;br /&gt;Similarly fitting the lowest variance leads only to a good fit of the right wing and a bad fit everywhere else.&lt;br /&gt;&lt;br /&gt;Still, as if by miracle, everything converges to the best fit on this example (again one can find cases where some guesses don&#39;t converge to the best fit). I have added some weights +-20% around the money, to ensure that we capture the ATM behavior accurately (otherwise the best fit is funny).&lt;br /&gt;&lt;br /&gt;It is interesting to see that if one minimizes the min square sum of variances (what I do in Vogt-LM, it&#39;s in theory slightly faster as there is no sqrt function cost) it results in an ugly looking steeper curvature, while if we just minimize the min square sum of volatilities (what I do in SimpleParabolicMV_LM), it looks better.</description>
    </item>
    <item>
      <title>Another SVI Initial Guess</title>
      <link>https://chasethedevil.github.io/post/another-svi-initial-guess/</link>
      <pubDate>Tue, 29 Jul 2014 14:39:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/another-svi-initial-guess/</guid>
      <description>The SVI formula is:&lt;br /&gt;$$w(k) = a + b ( \rho (k-m) + \sqrt{(k-m)^2+ \sigma^2}$$&lt;br /&gt;where k is the log-moneyness, w(k) the implied variance at a given moneyness and a,b,rho,m,sigma the 5 SVI parameters.&lt;br /&gt;&lt;br /&gt;A. Vogt described a particularly simple way to find an initial guess to fit SVI to an implied volatility slice &lt;a href=&#34;http://www.nuclearphynance.com/User%20Files/66/GatheralSmile_estimation_for_one_expiry_NP.pdf&#34; target=&#34;_blank&#34;&gt;a while ago&lt;/a&gt;. The idea to compute rho and sigma from the left and right asymptotic slopes. a,m are recovered from the crossing point of the asymptotes and sigma using the minimum variance.&lt;br /&gt;&lt;br /&gt;Later, &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CB4QFjAA&amp;amp;url=http%3A%2F%2Fwww.zeliade.com%2Fwhitepapers%2Fzwp-0005.pdf&amp;amp;ei=xI3XU9T3OYme7AbzwoHQDw&amp;amp;usg=AFQjCNGsvbseObGCDAZ1QbYtvOL9J2-aRw&amp;amp;sig2=rz4SilY2q1RSuD9XgWKFig&amp;amp;bvm=bv.71778758,d.ZGU&#34; target=&#34;_blank&#34;&gt;Zeliade has shown&lt;/a&gt; a very nice reduction of the problem to 2 variables, while the remaining 3 can be deduced explicitly. The practical side is that constraints are automatically included, the less practical side is the choice of minimizer for the two variables (Nelder-Mead) and of initial guess (a few random points).&lt;br /&gt;&lt;br /&gt;Instead, a simple alternative is the following: given b and rho from the asymptotic slopes, one could also just fit a parabola at-the-money, in a similar spirit as the &lt;a href=&#34;http://papers.ssrn.com/abstract=2467231&#34; target=&#34;_blank&#34;&gt;explicit SABR calibration&lt;/a&gt;, and recover explicitly a, m and sigma.&lt;br /&gt;&lt;br /&gt;To illustrate I take the data from Zeliade, where the input is already some SVI fit to market data.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-nX_T_AL-OTs/U9eShNryCVI/AAAAAAAAHcE/hmho6OMqGks/s1600/Screenshot+from+2014-07-29+13:38:09.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://1.bp.blogspot.com/-nX_T_AL-OTs/U9eShNryCVI/AAAAAAAAHcE/hmho6OMqGks/s1600/Screenshot+from+2014-07-29+13:38:09.png&#34; height=&#34;385&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;3M expiry - Zeliade data&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-PSrSfZ2DLms/U9eTJXJ0WdI/AAAAAAAAHcM/Mvw0c_Reo-c/s1600/Screenshot+-+290714+-+13:36:05.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-PSrSfZ2DLms/U9eTJXJ0WdI/AAAAAAAAHcM/Mvw0c_Reo-c/s1600/Screenshot+-+290714+-+13:36:05.png&#34; height=&#34;391&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;4Y expiry, Zeliade data&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;We clearly see that ATM the fit is better for the parabolic initial guess than for Vogt, but as one goes further away from ATM, Vogt guess seems better.&lt;br /&gt;&lt;br /&gt;Compared to SABR, the parabola itself fits decently only very close to ATM. If one computes the higher order Taylor expansion of SVI around k=0, powers of (k/sigma) appear, while sigma is often relatively small especially for short expiries: the fourth derivative will quickly make a difference.&lt;br /&gt;&lt;br /&gt;On implied volatilities stemming from a SABR fit of the SP500, here is how the various methods behave:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-FfrG3BodMg4/U9eUXHyHoWI/AAAAAAAAHcY/AILqs_rf5us/s1600/Screenshot+-+290714+-+11:57:48.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-FfrG3BodMg4/U9eUXHyHoWI/AAAAAAAAHcY/AILqs_rf5us/s1600/Screenshot+-+290714+-+11:57:48.png&#34; height=&#34;383&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;1M expiry on SABR data&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-KtBTJ6WvRew/U9eUsgTvEuI/AAAAAAAAHcg/Re-gFxN3Rcg/s1600/Screenshot+-+290714+-+11:51:15.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-KtBTJ6WvRew/U9eUsgTvEuI/AAAAAAAAHcg/Re-gFxN3Rcg/s1600/Screenshot+-+290714+-+11:51:15.png&#34; height=&#34;383&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;4Y expiry on SABR data&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;As expected, because SABR (and thus the input implied vol) is much closer to a parabola, the parabolic initial guess is much better than Vogt. The initial guess of Vogt is particularly bad on long expiries, although it will still converge quite quickly to the true minimum with Levenberg-Marquardt.&lt;br /&gt;&lt;br /&gt;In practice, I have found the method of Zeliade to be very robust, even if a bit slower than Vogt, while Vogt can sometimes (rarely) be too sensitive to the estimate of the asymptotes.&lt;br /&gt;&lt;br /&gt;The parabolic guess method could also be applied to always fit exactly ATM vol, slope and curvature, and calibrate rho, b to gives the best overall fit. It might be an idea for the next blog post.</description>
    </item>
    <item>
      <title>New SABR Formulae</title>
      <link>https://chasethedevil.github.io/post/new-sabr-formulae/</link>
      <pubDate>Wed, 16 Jul 2014 22:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/new-sabr-formulae/</guid>
      <description>In a talk at the Global Derivatives conference of Amsterdam (2014), Pat Hagan presented some new SABR formulas, supposedly close to the arbitrage free PDE behavior.&lt;br /&gt;&lt;br /&gt;I tried to code those from the slides, but somehow that did not work out well on his example, I just had something very close to the good old SABR formulas. I am not 100% sure (only 99%) that it is due to a mistake in my code. Here is what I was looking to reproduce:&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-gSpOYAndMkk/U8bfHfczKEI/AAAAAAAAHZ8/-eBE_igGVgw/s1600/Screenshot+from+2014-07-16+22:21:08.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-gSpOYAndMkk/U8bfHfczKEI/AAAAAAAAHZ8/-eBE_igGVgw/s1600/Screenshot+from+2014-07-16+22:21:08.png&#34; height=&#34;328&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Pat Hagan Global Derivatives example&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Fortunately, I then found in some thesis the idea of using Andersen &amp;amp; Brotherton-Ratcliffe local volatility expansion. In deed, the arbitrage free PDE from Hagan is equivalent to some Dupire local volatility forward PDE (see &lt;a href=&#34;http://papers.ssrn.com/abstract=2402001&#34;&gt;http://papers.ssrn.com/abstract=2402001&lt;/a&gt;), so Hagan just gave us the local volatility expansion to expand on&amp;nbsp; (the thesis uses Doust, which is not so different in this case).&lt;br /&gt;&lt;br /&gt;And then it produces on this global derivatives example the following:&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/-xH6i6aZ0O0A/U8bhUO5EQlI/AAAAAAAAHaI/oobJM0YaWQs/s1600/Screenshot+-+07162014+-+10:32:04+PM.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/-xH6i6aZ0O0A/U8bhUO5EQlI/AAAAAAAAHaI/oobJM0YaWQs/s1600/Screenshot+-+07162014+-+10:32:04+PM.png&#34; height=&#34;267&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The AB suffix are the new SABR formula. Even though the formulas are different, that looks very much like Hagan&#39;s own illustration (with a better scale)!&lt;br /&gt;&lt;br /&gt;I have a draft paper around this and more practical ideas to calibrate SABR:&lt;br /&gt;&lt;a href=&#34;http://papers.ssrn.com/abstract=2467231&#34;&gt;http://papers.ssrn.com/abstract=2467231&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Heston or Schobel-Zhu issues with short expiries</title>
      <link>https://chasethedevil.github.io/post/heston-or-schobel-zhu-issues-with-short-expiries/</link>
      <pubDate>Thu, 03 Jul 2014 23:28:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/heston-or-schobel-zhu-issues-with-short-expiries/</guid>
      <description>It&#39;s relatively well known that Heston does not fit the market for short expiries. Given that there are just 5 parameters to fit a full surface, it&#39;s almost logical that one part of the surface of it is not going to fit well the market.&lt;br /&gt;I was more surprised to see how bad Heston or Schobel-Zhu were to fit a single short expiry volatility slice. As an example I looked at SP500 options with 1 week expiry. It does not really matter if one forces kappa and rho to constant values (even to 0) the behavior is the same and the error in fit does not change much.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-BBnY4WPXQSY/U7XGBnRN4oI/AAAAAAAAHV8/xhG_WFcg2gI/s1600/Screenshot+-+07032014+-+11%253A02%253A15+PM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-BBnY4WPXQSY/U7XGBnRN4oI/AAAAAAAAHV8/xhG_WFcg2gI/s1600/Screenshot+-+07032014+-+11%253A02%253A15+PM.png&#34; height=&#34;400&#34; width=&#34;390&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Schobel-Zhu fit for a slice of maturity 1 week&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;In this graph, the brown, green and red smiles corresponds to Schobel-Zhu fit using an explicit guess (matching skew &amp;amp; curvature ATM), using Levenberg-Marquardt on this guess, and using plain differential evolution. &lt;br /&gt;What happens is that the smiles flattens to quickly in the strike dimension. One consequence is that the implied volatility can not be computed for extreme strikes: the smile being too low, the price becomes extremely small, under machine epsilon and the numerical method (Cos) fails. There is also a bogus angle in the right wing, because of numerical error. I paid attention to ignore too small prices in the calibration by truncating the initial data.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-2ezn28O1sEw/U7XKnXa7OaI/AAAAAAAAHWM/jUXgimXTsHU/s1600/Screenshot+-+07032014+-+11:25:26+PM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-2ezn28O1sEw/U7XKnXa7OaI/AAAAAAAAHWM/jUXgimXTsHU/s1600/Screenshot+-+07032014+-+11:25:26+PM.png&#34; height=&#34;400&#34; width=&#34;391&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Heston fit, with Lord-Kahl (exact wings)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;SABR behaves much better (fixing beta=1 in this case) in comparison (As I use the same truncation as for Schobel-Zhu, the flat left wing part is ignored). &lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-5f4nhQUoASE/U7XGYmQtQhI/AAAAAAAAHWA/mV2tcliE1oo/s1600/Screenshot+-+07032014+-+11:06:42+PM.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-5f4nhQUoASE/U7XGYmQtQhI/AAAAAAAAHWA/mV2tcliE1oo/s1600/Screenshot+-+07032014+-+11:06:42+PM.png&#34; height=&#34;400&#34; width=&#34;391&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;SABR fit for a slice of maturity 1 week&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;For longer expiries, Heston &amp;amp; Schobel-Zhu, even limited to 3 parameters, actually give a better fit in general than SABR.</description>
    </item>
    <item>
      <title>On the Role of Static Types and Generic Types on Productivity</title>
      <link>https://chasethedevil.github.io/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://chasethedevil.github.io/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>Moore-Penrose Inverse &amp; Gauss-Newton SABR Minimization</title>
      <link>https://chasethedevil.github.io/post/moore-penrose-inverse--gauss-newton-sabr-minimization/</link>
      <pubDate>Tue, 24 Jun 2014 15:29:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/moore-penrose-inverse--gauss-newton-sabr-minimization/</guid>
      <description>I have found a particularly nice initial guess to calibrate SABR. As it is quite close to the true best fit, it is tempting to use a very simple minimizer to go to the best fit. Levenberg-Marquardt works well on this problem, but can we shave off a few iterations?&lt;br /&gt;&lt;br /&gt;I firstly considered the basic &lt;a href=&#34;http://en.wikipedia.org/wiki/Newton%27s_method_in_optimization&#34; target=&#34;_blank&#34;&gt;Newton&#39;s method&lt;/a&gt;, but for least squares minimization, the Hessian (second derivatives) is needed. It&#39;s possible to obtain it, even analytically with SABR, but it&#39;s quite annoying to derive it and code it without some automatic differentiation tool. It turns out that as I experimented with the numerical Hessian, I noticed that it actually did not help convergence in our problem. &lt;a href=&#34;http://en.wikipedia.org/wiki/Gauss%E2%80%93Newton_algorithm&#34; target=&#34;_blank&#34;&gt;Gauss-Newton&lt;/a&gt; converges similarly (likely because the initial guess is good), and what&#39;s great about it is that you just need the Jacobian (first derivatives). &lt;a href=&#34;https://www.math.lsu.edu/system/files/MunozGroup1%20-%20Paper.pdf&#34; target=&#34;_blank&#34;&gt;Here&lt;/a&gt; is a good overview of Newton, Gauss-Newton and Levenberg-Marquardt methods.&lt;br /&gt;&lt;br /&gt;While Gauss-Newton worked on many input data, I noticed it failed also on some long maturities equity smiles. The full Newton&#39;s method did not fare&amp;nbsp; better. I had to take a close look at the matrices involved to understand what was going on. It turns out that sometimes, mostly when the SABR rho parameter is close to -1, the Jacobian would be nearly rank deficient (a row close to 0), but not exactly rank deficient. So everything would appear to work, but it actually misbehaves badly.&lt;br /&gt;&lt;br /&gt;My first idea was to solve the reduced problem if a row of the Jacobian is too small, by just removing that row, and keep the previous value for the guess corresponding to that row. And this simplistic approach made the process work on all my input data. Here is the difference in RMSE compared to a highly accurate Levenberg-Marquardt minimization for 10 iterations:&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/-A37UNSIHtzQ/U6l53-sbMTI/AAAAAAAAHVA/s5g9safiiaw/s1600/Screenshot+-+06242014+-+10:01:39+AM.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/-A37UNSIHtzQ/U6l53-sbMTI/AAAAAAAAHVA/s5g9safiiaw/s1600/Screenshot+-+06242014+-+10:01:39+AM.png&#34; height=&#34;260&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Later, while reading some more material related to least square optimization, I noticed the use of the &lt;a href=&#34;http://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse&#34; target=&#34;_blank&#34;&gt;Moore-Penrose inverse&lt;/a&gt; in cases where a matrix is rank deficient. The Moore-Penrose inverse is defined as:&lt;br /&gt;$$ M^\star = V S^\star U^T$$&lt;br /&gt;where \( S^\star \) is the diagonal matrix with inverted eigenvalues and 0 if those are deemed numerically close to 0, and \(U, V\) the eigenvectors of the SVD decomposition:&lt;br /&gt;$$M=U S V^T$$&lt;br /&gt;It turns out to work very well, beside being simpler to code, I expected it to be more or less equivalent to the previous approach (a tiny bit slower but we don&#39;t care as we deal with small matrices, and the real slow part is the computation of the objective function and the Hessian, which is why looking at iterations is more important).&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/-pDJ-3L1PARQ/U6l63hQQcvI/AAAAAAAAHVI/8Y9fg-TEcf8/s1600/Screenshot+-+06242014+-+02:50:44+PM.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/-pDJ-3L1PARQ/U6l63hQQcvI/AAAAAAAAHVI/8Y9fg-TEcf8/s1600/Screenshot+-+06242014+-+02:50:44+PM.png&#34; height=&#34;267&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It seems to converge a little bit less quickly, likely due to the threshold criteria that I picked (1E-15).&lt;br /&gt;Three iterations is actually most of the time (90%) more than enough to achieve a good accuracy (the absolute RMSE is between 1E-4 and 5E-2) as the following graph shows. The few spikes near 1E-3 represent too large errors, the rest is accurate enough compared to the absolute RMSE.&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/-uRD-sBYpw_E/U6l7YOQg-NI/AAAAAAAAHVQ/aGBd1twGu5U/s1600/Screenshot+-+06242014+-+03:20:34+PM.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/-uRD-sBYpw_E/U6l7YOQg-NI/AAAAAAAAHVQ/aGBd1twGu5U/s1600/Screenshot+-+06242014+-+03:20:34+PM.png&#34; height=&#34;242&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;To conclude, we have seen that using the Moore-Penrose inverse in a Gauss-Newton iteration allowed the Gauss-Newton method to work on rank-deficient systems.&lt;br /&gt;I am not sure how general that is, in my example, the true minimum either lies inside the region of interest, or on the border, where the system becomes deficient. Of course, this is related to a &#34;physical&#34; constraint, here namely rho &amp;gt; -1.</description>
    </item>
    <item>
      <title>One Interview Question for Job Seekers in Finance</title>
      <link>https://chasethedevil.github.io/post/one-interview-question-for-job-seekers-in-finance/</link>
      <pubDate>Thu, 19 Jun 2014 21:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/one-interview-question-for-job-seekers-in-finance/</guid>
      <description>&lt;p&gt;I presented in an &lt;!-- raw HTML omitted --&gt;earlier post&lt;!-- raw HTML omitted --&gt; that I was mostly disillusioned with interview questions, it&amp;rsquo;s better to find out if you can learn something out of a candidate.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Well there is maybe one very simple question that could be revealing, for people who pretend to be vaguely familiar with Black-Scholes:&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;What is the price of an at-the-money  binary option under very high volatility? &lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;Alternatively it can be asked with just an at-the-money european option under very high volatility.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;What makes think of it is that some &amp;ldquo;product manager&amp;rdquo; recently tested risk with volatilities at 300% and was wondering why they did not see any vega (based on a 1% additive shift), and opened bugs, generated noise&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>On the importance of accuracy for bpvol solvers</title>
      <link>https://chasethedevil.github.io/post/on-the-importance-of-accuracy-for-bpvol-solvers/</link>
      <pubDate>Thu, 12 Jun 2014 17:31:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/on-the-importance-of-accuracy-for-bpvol-solvers/</guid>
      <description>&lt;p&gt;While I was playing around calibrating the arbitrage free SABR model from Hagan (using the PDE on probability density approach), I noticed a misbehavior for some short maturity smiles. I thought it was due to the PDE implementation. Actually some of it was, but the remaining large error was due to the bpvol solver.&lt;/p&gt;&#xA;&lt;p&gt;I initially took the same approach as Choi et al. in &lt;a href=&#34;https://chasethedevil.github.io/post/building-a-more-accurate-basis-point-volatility-formula&#34;&gt;my solver&lt;/a&gt;, that is to work with in-the-money prices (they work with straddles) because it&amp;rsquo;s nice and convenient. I thought it was no big deal if prices lower than 1E-16 were not solved. It turns out I was wrong. Choi et al. solver has the same issue.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20-%2006122014%20-%2005%2024%2027%20PM.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>throws Exception</title>
      <link>https://chasethedevil.github.io/post/throws-exception/</link>
      <pubDate>Tue, 27 May 2014 10:49:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>KDE, XFCE, Gnome-Shell in 2014</title>
      <link>https://chasethedevil.github.io/post/kde-xfce-gnome-shell-in-2014/</link>
      <pubDate>Sun, 25 May 2014 09:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/kde-xfce-gnome-shell-in-2014/</guid>
      <description>Many people (and notoriously, Linus Torvald) complained about Gnome-shell, especially the early iterations. Similarly KDE 4 was a nightmare of instability and inflexibility when it came out. And XFCE has always sounded a bit too basic. the moves of Gnome and KDE were particularly shocking as the earlier iteration: Gnome 2 and KDE 3 were well appreciated, productive environments.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-size: large;&#34;&gt;Gnome Shell 3.10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It took me a bit of time to get used to it, and in the early stages I went to KDE 4 for a while, only to come back to it later.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Positive aspects:&lt;/i&gt; lots of space on the desktop, things don&#39;t get in the way, looks good,very good desktop overview (fast and well presented), a dock by default, great external monitor support (plug and play, remembers settings automatically), best OSD (volume) of all.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Negative aspects:&lt;/i&gt; the notifications bar looks awkward and badly integrated (better with an extension), still unstable and big memory leaks (on Fedora 20, where the integration should be the best, it regularly crashes, starts with 300Mb and goes up to 1Gb in a couple of days), fallback-session completely useless as one can not customize it at all. But the killer for my work was&amp;nbsp; inability to share the desktop with Webex, while XFCE could.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style=&#34;font-size: large;&#34;&gt;KDE&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;I gave it a long try especially in 2012, it has not changed much in 2014. My opinion of it fell when I tried it a very short time after months of Gnome Shell, and even more so after seeing the trouble my parents had with it, compared to Gnome 2.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Positive aspects:&lt;/i&gt; desktop search (needs to be configured in order to scan only the relevant folders, used to be slow and resource intensive, not so much in 2014)&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;Negative aspects:&lt;/i&gt; resource hog, awful start menu, too many shiny effects by default that only distract the user from his task, silly concepts like activities, every aspect of the desktop seems to require tweaking in non obvious ways for it to be more usable, looks ok but not great.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style=&#34;font-size: large;&#34;&gt;XFCE&lt;/span&gt;&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/-nw0i5RiPfz0/U4RIv9aY2pI/AAAAAAAAHTQ/xF9ZwyRtXZk/s1600/Screenshot+-+05272014+-+10:06:57+AM.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/-nw0i5RiPfz0/U4RIv9aY2pI/AAAAAAAAHTQ/xF9ZwyRtXZk/s1600/Screenshot+-+05272014+-+10:06:57+AM.png&#34; height=&#34;223&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;On Fedora, the default XFCE is very very basic, so much that I could hardly see a difference with one from 10 years ago. On Xubuntu, it&#39;s much much better. When I came to it from Gnome-Shell, I was surprised at how good was the &#34;old&#34; desktop paradigm for productivity. I also surprisingly found multiple desktops more natural to use than on Gnome Shell/KDE.&lt;br /&gt;On Fedora the way to make it like Xubuntu is to install elementary icons, the whisker menu and choose the greybird/bluebird themes.&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;&lt;br /&gt;&lt;/span&gt;&lt;/span&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;yum groups install &#34;Xfce Desktop&#34;&lt;br /&gt;yum install xfce4-mixer.x86_64 xfce4-whiskermenu-plugin.x86_64 xfce4-cpugraph-plugin.x86_64 xfce4-mount-plugin.x86_64 xfce4-icon-theme.noarch google-droid* elementary-xfce-icon-theme.noarch xfce4-volumed.x86_64 pavucontrol.x86_64&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Positive aspects:&lt;/i&gt; fast and lean, great start menu. &lt;/li&gt;&lt;li&gt;&lt;i&gt;Negative aspects:&lt;/i&gt; external monitor support could be more automatic like Gnome-Shell, no nice overview of all windows, default installation can be a bit too bare, sometimes not sexy (volume applet is ugly, xubuntu provides the unity indicators in xfce as a remedy), primitive OSD.&lt;/li&gt;&lt;/ul&gt;&lt;span style=&#34;font-size: large;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&#34;font-size: large;&#34;&gt;Cinnamon, Unity, Conclusion&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I gave a short try to cinnamon as well, in hopes that it was more stable than gnome shell. In short, it was not. It&#39;s certainly less of a memory hog, but I had some strange behavior with an additional phantom panel sometimes appearing at the bottom at the screen. And overall it looks a lot less polished.&lt;br /&gt;&lt;br /&gt;Unity is more interesting, but it&#39;s too Ubuntu centric, I don&#39;t like the start button equivalent (slow, badly presented, don&#39;t care about HUD), the windows overview is not as useful as Gnome shell, the dock, something I usually like, is strangely annoying.&lt;br /&gt;&lt;br /&gt;This is a very subjective review, my feeling is that in 2014, people should not waste their time with KDE or Cinnamon. Gnome shell could be worth a try if you don&#39;t care so much about memory leaks and slight instability but value a distraction free desktop. Otherwise go for XFCE or Unity on (X)ubuntu.</description>
    </item>
    <item>
      <title>Two SABR for the same smile</title>
      <link>https://chasethedevil.github.io/post/two-sabr-for-the-same-smile/</link>
      <pubDate>Tue, 20 May 2014 12:08:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/two-sabr-for-the-same-smile/</guid>
      <description>&lt;p&gt;While playing around with &lt;a href=&#34;https://chasethedevil.github.io/post/good--popular-algorithms-are-simple/&#34;&gt;differential evolution&lt;/a&gt; to calibrate SABR, I noticed that sometimes, several set of parameters can lead to a very similar smile, usually the good one is for relatively low vol of vol and the bad one is for relatively high vol of vol. I first looked for errors in my implementation, but it&amp;rsquo;s a real phenomenon.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202014-05-19%2017%2055%2050.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;I used the normal implied volatility formula with beta=1, then converted it to lognormal (Black) volatility. While it might not be a great idea to rely on the normal formula with beta=1, I noticed the same phenomenon with the &lt;a href=&#34;https://chasethedevil.github.io/post/sabr-with-new-hagan-pde-approach&#34;&gt;arbitrage free PDE density approach&lt;/a&gt;, especially for long maturities. Interestingly, I did not notice such behavior before with other stochastic volatility models like Heston or Schobel-Zhu: I suspect it has to do with the approximations rather than with the true behavior of SABR.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Heston vs SABR slice by slice fit</title>
      <link>https://chasethedevil.github.io/post/heston-vs-sabr-slice-by-slice-fit/</link>
      <pubDate>Thu, 15 May 2014 22:06:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/heston-vs-sabr-slice-by-slice-fit/</guid>
      <description>&lt;p&gt;Some people use &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCoQFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fsol3%2Fpapers.cfm%3Fabstract_id%3D1496982&amp;amp;ei=nx11U6QOoozQBcrfgIAK&amp;amp;usg=AFQjCNHi149E0_JiOzZRT9kgDWWYvHWlFQ&amp;amp;sig2=ZnhySOuJd8V-jBcWo4Ky2w&amp;amp;bvm=bv.66699033,d.d2k&#34;&gt;Heston to fit one slice&lt;/a&gt; of a volatility surface. In this case, some parameters are clearly redundant. Still, I was wondering how it fared against SABR, which is always used to fit a slice. And what about Schobel-Zhu?&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202014-05-15%2021%2020%2028.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Aggregated error in fit per slice on 10 surfaces&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;With Heston, the calibration is actually slightly better with kappa=0, that is, without mean reversion, because the global optimization is easier and the mean reversion is fully redundant. It&amp;rsquo;s still quite remarkable that 3 parameters result in a fit as good as 5 parameters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quadratic Spline with Knots at Mid-Points</title>
      <link>https://chasethedevil.github.io/post/quadratic-spline-with-knots-at-mid-points/</link>
      <pubDate>Wed, 14 May 2014 14:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/quadratic-spline-with-knots-at-mid-points/</guid>
      <description>&lt;p&gt;Two months ago, I looked at &lt;a href=&#34;https://chasethedevil.github.io/post/arbitrage-free-interpolation-of-option-prices-using-piecewise-constant-density&#34;&gt;arbitrage free interpolation using piecewise-constant density&lt;/a&gt;. This is equivalent to a piecewise quadratic polynomial in call prices where each piece is centered around each call strike.&lt;/p&gt;&#xA;&lt;p&gt;I wondered at the time what a quadratic spline would look like on this problem, as it should be very close in theory, except that we can ensure that it is C1, a condition for a good looking implied volatility.&lt;/p&gt;</description>
    </item>
    <item>
      <title>On Interviewing Candidates for a Job</title>
      <link>https://chasethedevil.github.io/post/on-interviewing-candidates-for-a-job/</link>
      <pubDate>Wed, 23 Apr 2014 17:18:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/on-interviewing-candidates-for-a-job/</guid>
      <description>&lt;p&gt;I am going to write a little about my experience and conclusions so far around interviewing a candidate for a software developer position or for a quant position, but it should be quite general.&lt;/p&gt;&#xA;&lt;p&gt;At first, I used to ask interview questions I liked when I was myself a candidate. On the technical side, it would stuff like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;which design patterns do you know?&lt;/li&gt;&#xA;&lt;li&gt;what&amp;rsquo;s your opinion on design patterns?&amp;lt;&lt;/li&gt;&#xA;&lt;li&gt;what&amp;rsquo;s a virtual method?&lt;/li&gt;&#xA;&lt;li&gt;any interesting algorithm you like?&lt;/li&gt;&#xA;&lt;li&gt;which libraries did you use?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;For a quant type I&amp;rsquo;d ask more specific questions:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Non-linear Option Pricing</title>
      <link>https://chasethedevil.github.io/post/non-linear-option-pricing/</link>
      <pubDate>Fri, 18 Apr 2014 22:18:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/non-linear-option-pricing/</guid>
      <description>&lt;p&gt;I am currently reading the book &amp;ldquo;&lt;a href=&#34;http://www.amazon.co.uk/Nonlinear-Pricing-Chapman-Financial-Mathematics/dp/1466570334/ref=sr_1_1?ie=UTF8&amp;amp;qid=1397852099&amp;amp;sr=8-1&amp;amp;keywords=nonlinear+option+pricing&#34;&gt;Nonlinear Option Pricing&lt;/a&gt;&amp;rdquo; by J. Guyon and P. Henry-Labordère. It&amp;rsquo;s quite interesting even if the first third is quite theoretical. For example they describe how to solve some not well defined non-linear parabolic PDE by relying on the parabolic envelope. They also explain why most problems lead to parabolic PDEs in finance.&lt;/p&gt;&#xA;&lt;p&gt;The rest is a bit more practical. I stumbled upon an good remark regarding Longstaff-Schwartz: the algorithm as Longstaff and Schwarz describe it does not necessary lead to a low-biased estimate as they use future information (the paths they regress on) in the Monte-Carlo estimate. It was actually &lt;a href=&#34;https://chasethedevil.github.io/post/quasi-monte-carlo--longstaff-schwartz-american-option-price/&#34;&gt;a subject of discussion&lt;/a&gt; with colleagues, and I analyzed the numerical impact in a simple use case in &lt;a href=&#34;http://papers.ssrn.com/abstract=2262259&#34;&gt;http://papers.ssrn.com/abstract=2262259&lt;/a&gt; In short: it&amp;rsquo;s actually more precise to include the path, even if the estimate is not purely low biased anymore, but the bias is really small in practice.&lt;/p&gt;</description>
    </item>
    <item>
      <title>5 Minutes of Xtend</title>
      <link>https://chasethedevil.github.io/post/5-minutes-of-xtend/</link>
      <pubDate>Tue, 08 Apr 2014 17:37:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Building a more accurate basis point volatility formula</title>
      <link>https://chasethedevil.github.io/post/building-a-more-accurate-basis-point-volatility-formula/</link>
      <pubDate>Sat, 05 Apr 2014 15:42:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/building-a-more-accurate-basis-point-volatility-formula/</guid>
      <description>P. Jaeckel has defied the limits of accuracy with his&lt;a href=&#34;http://www.pjaeckel.webspace.virginmedia.com/LetsBeRational.7z&#34; target=&#34;_blank&#34;&gt; latest Black-Scholes volatility solver&lt;/a&gt;, managing to also improve performance compared to his earlier solver &#34;&lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CC8QFjAA&amp;amp;url=http%3A%2F%2Fwww.pjaeckel.webspace.virginmedia.com%2FByImplication.pdf&amp;amp;ei=dwNAU5zkO4aI7AaFy4H4BQ&amp;amp;usg=AFQjCNF1RnfynBrckd79E9RVbhVhuXQrQg&amp;amp;sig2=kOxFO9jmD3wL1E94GjYhRQ&amp;amp;bvm=bv.64125504,d.ZGU&#34; target=&#34;_blank&#34;&gt;By Implication&lt;/a&gt;&#34;. Out of a silly exercise, I decided to try my hand for a more accurate &lt;a href=&#34;http://www.clarusft.com/analytic-implied-basis-point-volatility/&#34; target=&#34;_blank&#34;&gt;Normal (or basis point) volatility solver&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In reality, the problem is much simpler in the Bachelier/Normal model. A very basic analysis of Bachelier formula shows that the problem can be reduced to a single variable, as Choi et al explain in &lt;a href=&#34;http://www.tandfonline.com/doi/abs/10.1080/13504860802583436&#34; target=&#34;_blank&#34;&gt;their paper&lt;/a&gt;. So the problem is not really one of solving, but one of approximating (the inverse of) a function.&lt;br /&gt;&lt;br /&gt;The first step to build that function is to actually have a highly accurate slow solver as reference. This is quite easy, I just started with Choi formula and used &lt;a href=&#34;http://en.wikipedia.org/wiki/Halley%27s_method&#34; target=&#34;_blank&#34;&gt;Halley&#39;s method&lt;/a&gt; to refine. In reality, &lt;a href=&#34;http://en.wikipedia.org/wiki/Halley%27s_method&#34; target=&#34;_blank&#34;&gt;Halley&#39;s method&lt;/a&gt; is already a bit overkill on this problem: it works impressively well, 1 iteration is enough to have an insane level of accuracy, only noticeable when one works in high precision arithmetic (for example 50 digits). For double precision, &lt;a href=&#34;http://en.wikipedia.org/wiki/Newton%27s_method&#34; target=&#34;_blank&#34;&gt;Newton&#39;s method&lt;/a&gt; would actually be enough - I initially thought that my Halley&#39;s implementation did not work as it produced the exact same output as Newton in double precision. &lt;a href=&#34;http://www.tandfonline.com/doi/abs/10.1080/14697680902849361&#34; target=&#34;_blank&#34;&gt;Li proposes&lt;/a&gt; the use of the SOR method, which for this exercise, behaves very much like Newton&#39;s method.&lt;br /&gt;&lt;br /&gt;I then followed the logic from Choi et al, but working directly with in-the-money call options instead of &lt;a href=&#34;http://en.wikipedia.org/wiki/Straddle&#34; target=&#34;_blank&#34;&gt;straddles&lt;/a&gt;. Straddles sound neat at first (hides that we work in-the-money), but it&#39;s actually useless for the algorithm. Choi et al. ignore half of the straddle range when they use their eta transform in the paper. One other change is the mapping itself, I found a better mapping for the call options (but not that far of Choi initial idea). Finally, because I am lazy, I did not go to the pain of finding a good rational fraction approximation along with the square root problem they describe, I just tried a Chebyshev polynomial.&lt;br /&gt;&lt;br /&gt;Unfortunately, a single Chebyshev polynomial does not work well: even with a very large (1000) degree it&#39;s not very precise, so much that I thought that my transform was garbage. I had noticed by mistake, that on another part (negative) of the interval, the Chebyshev polynomial worked actually very well to approximate something related to the volatility of another option. Suddendly came to me the idea of, like Johnson does in &lt;a href=&#34;http://ab-initio.mit.edu/wiki/index.php/Faddeeva_Package&#34; target=&#34;_blank&#34;&gt;his Faddeeva package&lt;/a&gt;, using N Chebyshev polynomials on N small intervals. This is like the big heavy hammer for which everything looks like nails, but it&#39;s actually very fast to evaluate as the degree of each polynomial can then be low (7), plus a table lookup (could be coded as switch statements if one really cares about such details). The slowest part is actually the call to the log function.&lt;br /&gt;&lt;br /&gt;The final bit is the use of a Taylor approximation for my -u/log(1-u) transform as it is not all that accurate in double precision when u is near 0. And that produces the following graph&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/-r3FCXrjN13k/U0AHWIg7MRI/AAAAAAAAHGU/yDE6BEPtmIs/s1600/Screenshot+from+2014-04-05+15%253A37%253A03.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/-r3FCXrjN13k/U0AHWIg7MRI/AAAAAAAAHGU/yDE6BEPtmIs/s1600/Screenshot+from+2014-04-05+15%253A37%253A03.png&#34; height=&#34;342&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It is interesting to note that &#34;solving&#34; the b.p. vol is &lt;b&gt;10x faster&lt;/b&gt; than solving the Black vol.&lt;br /&gt;&lt;br /&gt;I wrote &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2420757&#34; target=&#34;_blank&#34;&gt;a small paper around all this&lt;/a&gt; where you&#39;ll find the details as well as Matlab code.</description>
    </item>
    <item>
      <title>Fast and Accurate Implied Volatility Solver</title>
      <link>https://chasethedevil.github.io/post/fast-and-accurate-implied-volatility-solver/</link>
      <pubDate>Wed, 19 Mar 2014 18:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/fast-and-accurate-implied-volatility-solver/</guid>
      <description>&lt;p&gt;The calibration of a stochastic volatility model or a volatility surface parameterization (like SVI) involves minimizing the model options volatilities against market options volatilities. Often, the model computes an option price, not an implied volatility. It is therefore useful to have a fast way to invert that option price to get back the implied volatility that corresponds to it. Furthermore during the calibration procedure, the model option price can vary widely: it is convenient to have a robust implied volatility solver.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Arbitrage Free Interpolation of Option Prices using Piecewise Constant Density</title>
      <link>https://chasethedevil.github.io/post/arbitrage-free-interpolation-of-option-prices-using-piecewise-constant-density/</link>
      <pubDate>Mon, 17 Mar 2014 15:25:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/arbitrage-free-interpolation-of-option-prices-using-piecewise-constant-density/</guid>
      <description>&lt;p&gt;Tension splines can produce in some cases &lt;a href=&#34;https://chasethedevil.github.io/post/c2-arbitrage-free-interpolation-with-tension-splines&#34;&gt;arbitrage free C2 interpolation&lt;/a&gt; of options, but unfortunately this is not guaranteed. It turns out that, on some not so nice looking data, where the discrete probability density is not monotone but only positive, all previously considered interpolation fail (spline in volatility or variance, tension spline in log prices, harmonic spline on prices).&lt;/p&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;K&lt;/th&gt;&#xA;          &lt;th&gt;vol&lt;/th&gt;&#xA;          &lt;th&gt;put&lt;/th&gt;&#xA;          &lt;th&gt;b-slope&lt;/th&gt;&#xA;          &lt;th&gt;b-convexity&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;300.0&lt;/td&gt;&#xA;          &lt;td&gt;0.682&lt;/td&gt;&#xA;          &lt;td&gt;0.090&lt;/td&gt;&#xA;          &lt;td&gt;0.00e+00&lt;/td&gt;&#xA;          &lt;td&gt;0.00e+00&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;310.0&lt;/td&gt;&#xA;          &lt;td&gt;0.654&lt;/td&gt;&#xA;          &lt;td&gt;0.136&lt;/td&gt;&#xA;          &lt;td&gt;4.60e-03&lt;/td&gt;&#xA;          &lt;td&gt;0.00e+00&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;320.0&lt;/td&gt;&#xA;          &lt;td&gt;0.621&lt;/td&gt;&#xA;          &lt;td&gt;0.192&lt;/td&gt;&#xA;          &lt;td&gt;5.60e-03&lt;/td&gt;&#xA;          &lt;td&gt;1.00e-03&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;330.0&lt;/td&gt;&#xA;          &lt;td&gt;0.594&lt;/td&gt;&#xA;          &lt;td&gt;0.288&lt;/td&gt;&#xA;          &lt;td&gt;9.60e-03&lt;/td&gt;&#xA;          &lt;td&gt;4.00e-03&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;340.0&lt;/td&gt;&#xA;          &lt;td&gt;0.560&lt;/td&gt;&#xA;          &lt;td&gt;0.404&lt;/td&gt;&#xA;          &lt;td&gt;1.16e-02&lt;/td&gt;&#xA;          &lt;td&gt;2.00e-03&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;350.0&lt;/td&gt;&#xA;          &lt;td&gt;0.520&lt;/td&gt;&#xA;          &lt;td&gt;0.530&lt;/td&gt;&#xA;          &lt;td&gt;1.26e-02&lt;/td&gt;&#xA;          &lt;td&gt;1.00e-03&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;360.0&lt;/td&gt;&#xA;          &lt;td&gt;0.484&lt;/td&gt;&#xA;          &lt;td&gt;0.736&lt;/td&gt;&#xA;          &lt;td&gt;2.06e-02&lt;/td&gt;&#xA;          &lt;td&gt;8.00e-03&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;370.0&lt;/td&gt;&#xA;          &lt;td&gt;0.467&lt;/td&gt;&#xA;          &lt;td&gt;1.232&lt;/td&gt;&#xA;          &lt;td&gt;4.96e-02&lt;/td&gt;&#xA;          &lt;td&gt;2.90e-02&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;380.0&lt;/td&gt;&#xA;          &lt;td&gt;0.442&lt;/td&gt;&#xA;          &lt;td&gt;1.898&lt;/td&gt;&#xA;          &lt;td&gt;6.66e-02&lt;/td&gt;&#xA;          &lt;td&gt;1.70e-02&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;390.0&lt;/td&gt;&#xA;          &lt;td&gt;0.427&lt;/td&gt;&#xA;          &lt;td&gt;3.104&lt;/td&gt;&#xA;          &lt;td&gt;1.21e-01&lt;/td&gt;&#xA;          &lt;td&gt;5.40e-02&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;400.0&lt;/td&gt;&#xA;          &lt;td&gt;0.412&lt;/td&gt;&#xA;          &lt;td&gt;4.930&lt;/td&gt;&#xA;          &lt;td&gt;1.83e-01&lt;/td&gt;&#xA;          &lt;td&gt;6.20e-02&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;http://4.bp.blogspot.com/-AILZMFsJ09w/Uyb9SWnrYbI/AAAAAAAAHFE/3wzhISGziaU/s1600/Screenshot&amp;#43;from&amp;#43;2014-03-17&amp;#43;14:34:04.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Possibly the simplest arbitrage free interpolation is to postulate the density as piecewise constant, ideally centered around each strike (if not centered, there is no guarantee that it will be positive). If a spline is used for interpolation, this means a quadratic spline. Unfortunately, because it is not C2, it then still fails to be arbitrage free.&lt;/p&gt;</description>
    </item>
    <item>
      <title>C2 Arbitrage Free Interpolation with Tension Splines</title>
      <link>https://chasethedevil.github.io/post/c2-arbitrage-free-interpolation-with-tension-splines/</link>
      <pubDate>Tue, 11 Mar 2014 17:05:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/c2-arbitrage-free-interpolation-with-tension-splines/</guid>
      <description>&lt;p&gt;In a previous post, I have explored the &lt;a href=&#34;https://chasethedevil.github.io/post/arbitrage-free-wiggles&#34;&gt;arbitrage free wiggles&lt;/a&gt; in the volatility surface that P. Jaeckel found in &lt;a href=&#34;http://www.pjaeckel.webspace.virginmedia.com/ClampingDownOnArbitrage.pdf&#34;&gt;his paper&lt;/a&gt;. I showed that interpolating in log prices instead of prices was enough to remove the wiggles, but then, it appears that the interpolation is not guaranteed to be arbitrage free, even though it often is. On another example from P. Jaeckel paper, that I reproduced inaccurately but well enough, it is not.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bachelier and Black-Scholes Fits of the Volatility Surface, what about SABR?</title>
      <link>https://chasethedevil.github.io/post/bachelier-and-black-scholes-fits-of-the-volatility-surface-what-about-sabr/</link>
      <pubDate>Fri, 07 Mar 2014 15:31:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/bachelier-and-black-scholes-fits-of-the-volatility-surface-what-about-sabr/</guid>
      <description>I always wondered if Bachelier was really worse than Black-Scholes in practice. As an experiment I fit various implied volatility surfaces with Bachelier and Black-Scholes and look at the average error in implied volatility by slice.&lt;br /&gt;&lt;br /&gt;In theory Bachelier is appealing because slightly simpler: log returns are a bit more challenging to think about than returns. And it also takes indirectly into account the fact that OTM calls are less likely than OTM puts because of default risk, if you assume absorbing probability at strike 0.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-FtWwKMYTItY/Uxn4UIURgnI/AAAAAAAAHDk/qJDWTdPl6gw/s1600/bachelier.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-FtWwKMYTItY/Uxn4UIURgnI/AAAAAAAAHDk/qJDWTdPl6gw/s1600/bachelier.png&#34; height=&#34;336&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Bachelier&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-XGjl9Pcs5aY/Uxn4aNFFB8I/AAAAAAAAHDs/-v8zOpNFu24/s1600/black.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-XGjl9Pcs5aY/Uxn4aNFFB8I/AAAAAAAAHDs/-v8zOpNFu24/s1600/black.png&#34; height=&#34;336&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Black-Scholes&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The error is in general smaller for Black-Scholes for short expiries, and higher for long expiries when compared to Bachelier. Interestingly, in theory, the difference of the models is more pronounced for longer expiries. One would have imagined that for very short expiries Bachelier would be equivalent to Black, it is not the case in term of fitting the smile.&lt;br /&gt;&lt;br /&gt;Displaced diffusion (mixing both Bachelier and Black linearly) allows to gain x2 accuracy.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-zCvfSvMtsmc/Uxn5HHk0gBI/AAAAAAAAHD0/FrFzvnmnd08/s1600/dd.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-zCvfSvMtsmc/Uxn5HHk0gBI/AAAAAAAAHD0/FrFzvnmnd08/s1600/dd.png&#34; height=&#34;336&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Displaced Diffusion&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;What about SABR? Let&#39;s look at lognormal SABR, usually used for equities.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-lvB1kTAXh7U/Uxn5VHjEWvI/AAAAAAAAHD8/XMGwCisCiKg/s1600/sabr.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-lvB1kTAXh7U/Uxn5VHjEWvI/AAAAAAAAHD8/XMGwCisCiKg/s1600/sabr.png&#34; height=&#34;336&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Lognormal SABR (beta=1)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The fit is much better for long expiries, but not so great for a few outliers for long maturities, it can be actually worse than the simple displaced diffusion. A normal SABR might fix that.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-QcGK_40mOHQ/Uxn5qLeI45I/AAAAAAAAHEE/tMWUPEtaxvs/s1600/sabr0.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-QcGK_40mOHQ/Uxn5qLeI45I/AAAAAAAAHEE/tMWUPEtaxvs/s1600/sabr0.png&#34; height=&#34;336&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Normal SABR (beta=0) using Hagan lognormal formula&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;If one relies on the standard lognormal formula, the beta=0 SABR behaves very badly.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-kpi0HJKc25o/Uxn57qj8QpI/AAAAAAAAHEM/TLBa6dseWzI/s1600/Screenshot+from+2014-03-07+17:35:49.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://4.bp.blogspot.com/-kpi0HJKc25o/Uxn57qj8QpI/AAAAAAAAHEM/TLBa6dseWzI/s1600/Screenshot+from+2014-03-07+17:35:49.png&#34; height=&#34;321&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Normal SABR using Hagan normal formula&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;This is fixed using the normal (bpvol) Hagan formula directly. The fit is then better overall for long maturities as expected from Black-Scholes vs Bachelier behavior.&lt;br /&gt;&lt;br /&gt;If one look in log scale, the conclusion is not so obvious: beta=1 produces a better fit for a majority even for long expiries, but worse for a few (30% in my case) outliers.&lt;br /&gt;&lt;br /&gt;What&#39;s clear however, is that one should never use the Black implied volatility Hagan formula with beta=0. This leaves a question on displaced SABR. Is displaced SABR is better suited than SABR with varying beta?</description>
    </item>
    <item>
      <title>Arbitrage Free Wiggles</title>
      <link>https://chasethedevil.github.io/post/arbitrage-free-wiggles/</link>
      <pubDate>Mon, 03 Mar 2014 17:13:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/arbitrage-free-wiggles/</guid>
      <description>Peter Jaeckel, in a &lt;a href=&#34;http://www.pjaeckel.webspace.virginmedia.com/ClampingDownOnArbitrage.pdf&#34;&gt;recent paper (pdf)&lt;/a&gt;, shows that something that sounds like a reasonable arbitrage free interpolation can produce wiggles in the implied volatility slice.&lt;br /&gt;&lt;br /&gt;The interpolation in question is using some convexity preserving spline on call and put option prices directly and in strike, assuming those input prices are arbitrage free. This is very similar to &lt;a href=&#34;http://nkahale.free.fr/papers/Interpolation.pdf&#34;&gt;Kahale interpolation (pdf)&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;It seemed too crazy for me so I had to try out his example. And using a &lt;a href=&#34;http://papers.ssrn.com/abstract=2175002&#34;&gt;harmonic spline&lt;/a&gt;, it does produce arbitrage free wiggles.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-HhHvYhvdlwU/UxSkNCTJiXI/AAAAAAAAHBQ/buAU6Q_wALM/s1600/Screenshot+from+2014-03-03+16:29:29.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://3.bp.blogspot.com/-HhHvYhvdlwU/UxSkNCTJiXI/AAAAAAAAHBQ/buAU6Q_wALM/s1600/Screenshot+from+2014-03-03+16:29:29.png&#34; height=&#34;297&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Wiggles in the implied volatility&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;If we look at the probability density (the curvature), the Harmonic spline maintains a positive density, nearly piecewise flat in log scale, while Hyman, because it preserves only monotonicity, has some negative density which are cut out from the graph.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-UKuoXUcVRYY/UxSk1ylZ7jI/AAAAAAAAHBY/RDxMR2Q69GY/s1600/Screenshot+from+2014-03-03+16:47:46.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; src=&#34;http://2.bp.blogspot.com/-UKuoXUcVRYY/UxSk1ylZ7jI/AAAAAAAAHBY/RDxMR2Q69GY/s1600/Screenshot+from+2014-03-03+16:47:46.png&#34; height=&#34;297&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Probability Density&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;In reality, if we look at the interpolation of prices in log scale, one can see that splines won&#39;t behave as expected at first on small numbers: they will give a much higher weight to the high values, producing something like a piecewise linear interpolation.&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/-5WOPPmW088c/UxSml6PGWmI/AAAAAAAAHBk/xOfiaaRcpLI/s1600/Screenshot+from+2014-03-03+16:57:33.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/-5WOPPmW088c/UxSml6PGWmI/AAAAAAAAHBk/xOfiaaRcpLI/s1600/Screenshot+from+2014-03-03+16:57:33.png&#34; height=&#34;297&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In reality, what one really wants for such data is to just interpolate the log prices with a spline, not the prices. This is the curve named &#34;Log&#34; in the graphs, where a simple cubic spline is used on the log prices, and fed to exp after interpolation.&lt;br /&gt;&lt;br /&gt;Now it sounds like a reasonable arbitrage free interpolation would be to interpolate the discrete density log linearly, in a similar spirit as &lt;a href=&#34;http://finmod.co.za/interpreview.pdf&#34;&gt;Hagan-West yield curve interpolation&lt;/a&gt; (pdf).&lt;br /&gt;&lt;br /&gt;In general, if you interpolate very small numbers with a spline, you probably are doing something wrong.</description>
    </item>
    <item>
      <title>Adjoint Delta for Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/adjoint-delta-for-monte-carlo/</link>
      <pubDate>Tue, 25 Feb 2014 18:37:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/adjoint-delta-for-monte-carlo/</guid>
      <description>&lt;p&gt;In an earlier post, I have been quickly exploring &lt;a href=&#34;https://chasethedevil.github.io/post/adjoint-algorithmic-differentiation-for-black-scholes/&#34;&gt;adjoint differentiation&lt;/a&gt; in the context of analytical Black-Scholes. Today, I tried to mix it in a simple Black-Scholes Monte-Carlo as described in &lt;a href=&#34;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.luca-capriotti.net%2Fpdfs%2FFinance%2Fjcf_capriotti_press_web.pdf&amp;amp;ei=rNMMU4_wGKjt0gWQpYGIAQ&amp;amp;usg=AFQjCNFovkw47-Y1WrIKkt-m5FQ1lhmqYA&amp;amp;sig2=vmiqHzd6SJuq5Fp2TlPjdA&amp;amp;bvm=bv.61725948,d.d2k&#34;&gt;L. Capriotti paper&lt;/a&gt;, and measured the performance to compute delta compared to a numerical single sided finite difference delta.&lt;/p&gt;&#xA;&lt;p&gt;I was a bit surprised that even on a single underlying, without any real optimization, adjoint delta was faster by a factor of nearly 40%. I suspect this is mostly due to exp evaluations being /2.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SVI on top of SABR</title>
      <link>https://chasethedevil.github.io/post/svi-on-top-of-sabr/</link>
      <pubDate>Thu, 20 Feb 2014 18:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/svi-on-top-of-sabr/</guid>
      <description>Several papers show that the limit for large strikes of &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;ved=0CDUQFjAB&amp;amp;url=http%3A%2F%2Farxiv.org%2Fabs%2F1002.3633&amp;amp;ei=GjUGU5uVIeu00wXEwoCwBw&amp;amp;usg=AFQjCNHvnJ9xYAv60R4GSUbMORRI9_-7Zg&amp;amp;sig2=iqplpcXauJBLJ9DIw71vWA&amp;amp;bvm=bv.61725948,d.d2k&#34;&gt;Heston is SVI&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Interestingly, I stumbled onto a surface where the Hagan SABR fit was perfect as well as the SVI fit, while the Heston fit was not.&lt;br /&gt;&lt;br /&gt;Originally, I knew that, on this data, the SVI fit was perfect. Until today, I just never tried to fit a lognormal SABR on the same data. I did a small test with random values of the SABR parameters alpha, rho, nu, and found out that in deed, the SVI fit is always perfect on SABR.&lt;br /&gt;&lt;br /&gt;Is this just because the Taylor expansion of SVI will match the Taylor expansion of SABR up to the fourth order? It seems that the wings are also not too far off in general so there could be more to it.&lt;br /&gt;&lt;br /&gt;Gatheral actually devised an SVI formula that uses SABR like variables &lt;a href=&#34;http://mfe.baruch.cuny.edu/wp-content/uploads/2013/01/OsakaSVI2012.pdf&#34;&gt;in a talk here&lt;/a&gt;.&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://3.bp.blogspot.com/-QNLwJnVGPUE/UwY9EwCkZ6I/AAAAAAAAHA4/DP6MstmUqg4/s1600/Screenshot+from+2014-02-20+18:36:06.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/-QNLwJnVGPUE/UwY9EwCkZ6I/AAAAAAAAHA4/DP6MstmUqg4/s1600/Screenshot+from+2014-02-20+18:36:06.png&#34; height=&#34;79&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Of course, the reverse is not true. SVI has more parameters and provides in general a better fit than SABR.</description>
    </item>
    <item>
      <title>Smart Initial Guess for Schobel-Zhu</title>
      <link>https://chasethedevil.github.io/post/smart-initial-guess-for-schobel-zhu/</link>
      <pubDate>Wed, 19 Feb 2014 18:57:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/smart-initial-guess-for-schobel-zhu/</guid>
      <description>&lt;p&gt;With a &lt;a href=&#34;https://chasethedevil.github.io/post/a-small-time-schobel-zhu-expansion&#34;&gt;small time expansion&lt;/a&gt;, it is easy to derive a reasonable initial guess, without resorting to some global minimizer.&lt;/p&gt;&#xA;&lt;p&gt;Like &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCgQFjAA&amp;amp;url=http%3A%2F%2Fpage.math.tu-berlin.de%2F~jacquier%2Findex_files%2FJacquier%2520-%2520SmallTimeHeston2.pdf&amp;amp;ei=72D7Ur6NHeqP0AX7soFo&amp;amp;usg=AFQjCNGkx9ifAh3UQQI4UE_pD8osCzH7Rg&amp;amp;sig2=lIcs-s2yrxWZsxidkQlxOA&amp;amp;bvm=bv.61190604,d.d2k&#34;&gt;Forde did for Heston&lt;/a&gt;, one can find the 5 Schobel-Zhu parameters through 5 points at coordinates (0,0), (x0,t1), (-x0,t1), (x0,t2), (-x0,t2), where x0 is a chosen the log-moneyness, for example, 0.1 and t1, t2 relatively short expiries (for example, 0.1, 0.25).&lt;/p&gt;&#xA;&lt;p&gt;We can truncate the small time expansion so that the polynomial in (x,t) is fully captured by those 5 points. In practice, I have noticed that using a more refined expansion with more terms resulted not only in more complex formulas to lookup the original stochastic volatility parameters, but also in an increased error, because of the redundancy of parameters in the polynomial expansion. My previous Schobel-Zhu expansion becomes just:&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Look at Small Time Expansions for Heston</title>
      <link>https://chasethedevil.github.io/post/a-look-at-small-time-expansions-for-heston/</link>
      <pubDate>Wed, 12 Feb 2014 13:13:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/a-look-at-small-time-expansions-for-heston/</guid>
      <description>&lt;p&gt;Small time expansions for Heston can be useful during the calibration of the implied volatility surface, in order to find an initial guess for a local minimizer (for example, Levenberg-Marquardt). Even if they are not so accurate, they capture the dynamic of the model parameters, and that is often enough.&lt;/p&gt;&#xA;&lt;p&gt;In 2011, Forde et al. proposed &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCgQFjAA&amp;amp;url=http%3A%2F%2Fpage.math.tu-berlin.de%2F~jacquier%2Findex_files%2FJacquier%2520-%2520SmallTimeHeston2.pdf&amp;amp;ei=72D7Ur6NHeqP0AX7soFo&amp;amp;usg=AFQjCNGkx9ifAh3UQQI4UE_pD8osCzH7Rg&amp;amp;sig2=lIcs-s2yrxWZsxidkQlxOA&amp;amp;bvm=bv.61190604,d.d2k&#34;&gt;a second order small time expansion&lt;/a&gt; around the money, which I found to work well for calibration. More recently, Lorig et al. proposed &lt;a href=&#34;http://arxiv.org/abs/1306.5447&#34;&gt;different expansions up to order-3&lt;/a&gt; around the money. I already looked at the later in my &lt;a href=&#34;https://chasethedevil.github.io/post/a-small-time-schobel-zhu-expansion&#34;&gt;previous post&lt;/a&gt;, applying the idea to Schobel-Zhu.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Small-Time Schobel-Zhu Expansion</title>
      <link>https://chasethedevil.github.io/post/a-small-time-schobel-zhu-expansion/</link>
      <pubDate>Mon, 10 Feb 2014 18:30:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/a-small-time-schobel-zhu-expansion/</guid>
      <description>&lt;p&gt;The paper &lt;a href=&#34;http://arxiv.org/abs/1306.5447&#34;&gt;implied vol for any local stochastic vol model&lt;/a&gt; from Lorig et al. presents a very generic and simple formula to compute implied volatility expansions up to order-2 (there is actually an order-3 formula available in their Mathematica CDF file).&lt;/p&gt;&#xA;&lt;p&gt;I tried it on the &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;ved=0CDIQFjAB&amp;amp;url=http%3A%2F%2Fssrn.com%2Fabstract%3D100831&amp;amp;ei=3gr5UtzkOYm90QWD7IDwBA&amp;amp;usg=AFQjCNFY9anH_AU0A5pWRX4Qdo6Kp2CjEg&amp;amp;sig2=teGVgsV4uneROlzZCuUFBw&amp;amp;bvm=bv.60983673,d.d2k&#34;&gt;Schobel-Zhu&lt;/a&gt; stochastic volatility model. This model is an interesting alternative to Heston. I found that, in practice, the implied volatility surface &lt;a href=&#34;https://chasethedevil.github.io/post/heston-schobel-zhu-bates-double-heston-fit&#34;&gt;fit was as good&lt;/a&gt;, while the &lt;a href=&#34;https://chasethedevil.github.io/post/brownian-bridge-or-not-with-heston&#34;&gt;simulation under the QE scheme&lt;/a&gt; is quite faster (and simpler) than Heston. Here is the result of applying their technique on Schobel-Zhu:&lt;/p&gt;</description>
    </item>
    <item>
      <title>An SSD instead of a laptop</title>
      <link>https://chasethedevil.github.io/post/an-ssd-instead-of-a-laptop/</link>
      <pubDate>Tue, 04 Feb 2014 15:45:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/an-ssd-instead-of-a-laptop/</guid>
      <description>&lt;p&gt;Last week, my work laptop died after spilling out some water on its keyboard inadvertently. Fortunately, its SSD was intact.&lt;/p&gt;&#xA;&lt;p&gt;As the laptop SSD connector (SATA) and power follow the desktop computers standards, and as I use Linux, I just plugged the SSD to my home desktop and booted off the SSD. I had to change slightly the X configuration but otherwise everything worked. Linux is great for that&lt;/p&gt;&#xA;&lt;p&gt;The same way, I just plugged the SSD to the desktop at work and it worked. Instead of carrying a laptop, I carry now my small and ultra-light SSD.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Brownian Bridge or Not with Heston Quadratic Exponential QMC</title>
      <link>https://chasethedevil.github.io/post/brownian-bridge-or-not-with-heston-quadratic-exponential-qmc/</link>
      <pubDate>Fri, 24 Jan 2014 19:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/brownian-bridge-or-not-with-heston-quadratic-exponential-qmc/</guid>
      <description>At first I did not make use of the Brownian Bridge technique in Heston QMC, because the variance process is not simulated like a Brownian Motion under the &lt;a href=&#34;http://www.google.com/url?q=http://www.javaquant.net/papers/LeifAndersenHeston.pdf&amp;amp;sa=U&amp;amp;ei=p9jjUtPJK8uUhQfb_YGgAw&amp;amp;ved=0CB4QFjAA&amp;amp;sig2=EjKPr39tR0ni1vq5gK9mkA&amp;amp;usg=AFQjCNGQyqSaDu2kl6_KpP-s-KwMvJ6hPg&#34;&gt;Quadratic Exponential algorithm from Andersen&lt;/a&gt;.&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/-kWmb0WWAYzA/UuPX4UMySRI/AAAAAAAAG-4/cBcjRgfTc5s/s1600/Screenshot+from+2014-01-25+16:26:05.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/-kWmb0WWAYzA/UuPX4UMySRI/AAAAAAAAG-4/cBcjRgfTc5s/s1600/Screenshot+from+2014-01-25+16:26:05.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It is, however, perfectly possible to use the Brownian Bridge on the asset process. Does it make a difference? In my small test, it does not seem to make a difference. An additional question would be, is it better to take first N for the asset and next N for the variance or vice versa or intertwined? Intertwined would seem the most natural (this is what I used without Brownian Bridge, but for simplicity I did Brownian bridge on first N).&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/-WN5frRWHix4/UuKyR69BtbI/AAAAAAAAG-g/BTXm5K2XOQo/s1600/heston_bnp_sobol2.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/-WN5frRWHix4/UuKyR69BtbI/AAAAAAAAG-g/BTXm5K2XOQo/s1600/heston_bnp_sobol2.png&#34; height=&#34;222&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;By contrast, Schobel-Zhu QE scheme can make full use of the Brownian Bridge technique, in the asset process as well as in the variance process. Here is a summary of the volatility process under the QE scheme from &lt;a href=&#34;http://www.google.com/url?q=http://arno.uvt.nl/show.cgi%3Ffid%3D99534&amp;amp;sa=U&amp;amp;ei=itjjUo2jD6Wa0AXqzYHgCQ&amp;amp;ved=0CB4QFjAA&amp;amp;sig2=KdYdo3sAFjV6fwPS4Gak0A&amp;amp;usg=AFQjCNEZ8DRGCf4EXOxCXs3oPc_98628hA&#34;&gt;van Haastrecht&lt;/a&gt;:&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/-kYpBO8PfEkw/UuPX_40DnbI/AAAAAAAAG_A/v7QAN_lX9oM/s1600/Screenshot+from+2014-01-25+16:26:23.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/-kYpBO8PfEkw/UuPX_40DnbI/AAAAAAAAG_A/v7QAN_lX9oM/s1600/Screenshot+from+2014-01-25+16:26:23.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Another nice property of Schobel-Zhu is that the QE simulation is as fast as Euler, and therefore 2.5x faster than the Heston QE.&lt;br /&gt;&lt;br /&gt;I calibrated the model to the same surface, and the QMC price of a ATM call option seems to have a similar accuracy as Heston QMC. But we can see that the Brownian Bridge does increase accuracy in this case. I was surprised that accuracy was not much better than Heston, but maybe it is because I did yet not implement the Martingale correction, while I did so in the Heston case.&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://4.bp.blogspot.com/--mK4u1K8nOk/UuKyR2y6FHI/AAAAAAAAG-k/QSOjDwosqLo/s1600/sz_bnp_sobol3.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/--mK4u1K8nOk/UuKyR2y6FHI/AAAAAAAAG-k/QSOjDwosqLo/s1600/sz_bnp_sobol3.png&#34; height=&#34;222&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Adjoint Algorithmic Differentiation for Black-Scholes</title>
      <link>https://chasethedevil.github.io/post/adjoint-algorithmic-differentiation-for-black-scholes/</link>
      <pubDate>Tue, 21 Jan 2014 13:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/adjoint-algorithmic-differentiation-for-black-scholes/</guid>
      <description>&lt;a href=&#34;http://en.wikipedia.org/wiki/Automatic_differentiation&#34;&gt;Adjoint algorithmic differentiation&lt;/a&gt; is particularly interesting in finance as we often encounter the case of a function that takes many input (the market data) and returns one output (the price) and we would like to also compute sensitivities (greeks) to each input.&lt;br /&gt;&lt;br /&gt;As I am just starting around it, to get a better grasp, I first tried to apply the idea to the analytic knock out barrier option formula, by hand, only to find out I was making way too many errors by hand to verify anything. So I tried the simpler vanilla Black-Scholes formula. I also made various errors, but managed to fix all of them relatively easily.&lt;br /&gt;&lt;br /&gt;I decided to compare how much time it took to compute price, delta, vega, theta, rho, rho2 between single sided finite difference and the adjoint approach. Here are the results for 1 million options:&lt;br /&gt;&lt;br /&gt;&lt;blockquote class=&#34;tr_bq&#34;&gt;FD time=2.13s&lt;br /&gt;Adjoint time=0.63s&lt;/blockquote&gt;&lt;br /&gt;&lt;b&gt;It works well&lt;/b&gt;, but doing it by hand is crazy and too error prone. It might be simpler for Monte-Carlo payoffs however.&lt;br /&gt;&lt;br /&gt;There are not many Java tools that can do reverse automatic differentiation, I found &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=5&amp;amp;cad=rja&amp;amp;ved=0CFAQFjAE&amp;amp;url=http%3A%2F%2Fcluster.grid.pub.ro%2Fwiki%2Findex.php%2FADiJaC_-_Automatic_Differentiation_of_Java_Classfiles&amp;amp;ei=SmDeUtDLCYrG0QWrlIHQDw&amp;amp;usg=AFQjCNHLMwobO6u5jSoUifCdHvE2yPZ6oQ&amp;amp;sig2=wFbGRYjgLenCNGRbrQ1gKQ&amp;amp;bvm=bv.59568121,d.d2k&#34;&gt;some thesis&lt;/a&gt; on it, with an interesting byte code oriented approach (one difficulty is that you need to reverse loops, while statements).</description>
    </item>
    <item>
      <title>Placing the Strike on the Grid and Payoff Smoothing in Finite Difference Methods for Vanilla Options</title>
      <link>https://chasethedevil.github.io/post/placing-the-strike-on-the-grid-and-payoff-smoothing-in-finite-difference-methods-for-vanilla-options/</link>
      <pubDate>Sun, 12 Jan 2014 16:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/placing-the-strike-on-the-grid-and-payoff-smoothing-in-finite-difference-methods-for-vanilla-options/</guid>
      <description>Pooley et al., in &lt;a href=&#34;https://cs.uwaterloo.ca/~paforsyt/report.pdf&#34;&gt;Convergence Remedies for non-smooth payoffs in option pricing&lt;/a&gt; suggest that placing the strike on the grid for a Vanilla option is good enough:&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://3.bp.blogspot.com/-CIS-yTdMn7k/UtKy6HtMIhI/AAAAAAAAG-I/Hef_w7gTcJ0/s1600/pooley_vanilla_smooth.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/-CIS-yTdMn7k/UtKy6HtMIhI/AAAAAAAAG-I/Hef_w7gTcJ0/s1600/pooley_vanilla_smooth.png&#34; height=&#34;48&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;At the same time, Tavella and Randall show in their book that numerically, placing the strike in the middle of two nodes leads to a more accurate result. My own numerical experiments confirm Tavella and Randall suggestion.&lt;br /&gt;&lt;br /&gt;In reality, what Pooley et al. really mean, is that quadratic convergence is maintained if the strike is on the grid for vanilla payoffs, contrary to the case of discontinuous payoffs (like digital options) where the convergence decreases to order 1. So it&#39;s ok to place the strike on the grid for a vanilla payoff, but it&#39;s not optimal, it&#39;s still better to place it in the middle of two nodes. Here are absolute errors in a put option price:&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;on grid, no smoothing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04473021824995271&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;on grid, Simpson smoothing&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.003942854282069419&lt;br /&gt;on grid, projection smoothing 0.044730218065351934&lt;br /&gt;middle, no smoothing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.004040359609906119&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As expected (and mentioned in Pooley et al.), the projection does not do anything here. When the grid size is doubled, the convergence ratio of all methods is the same (order 2), but placing the strike in the middle still increases accuracy significantly.&lt;br /&gt;&lt;br /&gt;Here is are the same results, but for a digital put option:&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;on grid, no smoothing &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.03781319921461046&lt;br /&gt;on grid, Simpson smoothing&amp;nbsp;&amp;nbsp;&amp;nbsp; 8.289052335705427E-4&lt;br /&gt;on grid, projection smoothing 1.9698293587372406E-4&lt;br /&gt;middle, no smoothing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3.5122153011418744E-4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here only the 3 last methods are of order-2 convergence, and projection is in deed the most accurate method, but placing the strike in the middle is really not that much worse, and much simpler.&lt;br /&gt;&lt;br /&gt;A disadvantage of Simpson smoothing (or smoothing by averaging), is that it breaks put-call parity (see the paper &#34;&lt;a href=&#34;http://papers.ssrn.com/abstract=2362969&#34;&gt;Exact Forward and Put Call Parity with TR-BDF2&lt;/a&gt;&#34;) &lt;br /&gt;&lt;br /&gt;I think the emphasis in their paper on &#34;no smoothing is required&#34; for vanilla payoffs can be misleading. I hope I have clarified it in this post.</description>
    </item>
    <item>
      <title>Coordinate Transform of the Andreasen Huge SABR PDE &amp; Spline Interpolation</title>
      <link>https://chasethedevil.github.io/post/coordinate-transform-of-the-andreasen-huge-sabr-pde--spline-interpolation/</link>
      <pubDate>Wed, 08 Jan 2014 18:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/coordinate-transform-of-the-andreasen-huge-sabr-pde--spline-interpolation/</guid>
      <description>&lt;p&gt;Recently, I noticed &lt;a href=&#34;https://chasethedevil.github.io/post/arbitrage-free-sabr---another-view-on-hagan-approach&#34;&gt;how close&lt;/a&gt; are the two PDE based approaches from Andreasen-Huge and Hagan for an arbitrage free SABR. Hagan gives a local volatility very close to the one Andreasen-Huge use in the forward PDE in call prices. A multistep Andreasen-Huge (instead of their one step PDE method) gives back prices and densities nearly equal to Hagan density based approach.&lt;/p&gt;&#xA;&lt;p&gt;Hagan proposed in some unpublished paper a coordinate transformation for two reasons: the ideal range of strikes for the PDE can be very large, and concentrating the points where it matters should improve stability and accuracy. The transform itself can be found in the &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CC0QFjAA&amp;amp;url=http%3A%2F%2Fwww.andersen-piterbarg-book.com%2F&amp;amp;ei=dYzNUrG6Eo7n7Aamp4GwAQ&amp;amp;usg=AFQjCNE3sdrH2B8EDg40Gocp8FB-QEtnew&amp;amp;sig2=aoDaRX5-zTolem9mUrEumw&amp;amp;bvm=bv.58187178,d.ZGU&#34;&gt;Andersen-Piterbarg book&lt;/a&gt; &amp;ldquo;Interest Rate Modeling&amp;rdquo;, and is similar to the famous log transform, but for a general local volatility function (phi in the book notation).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Random Hardware Issues</title>
      <link>https://chasethedevil.github.io/post/random-hardware-issues/</link>
      <pubDate>Mon, 06 Jan 2014 18:44:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/random-hardware-issues/</guid>
      <description>&lt;p&gt;Today, after wondering why my desktop computer became so unstable (frequent crashes under Fedora), I found out that the micro usb port of my cell phone has some kind of short circuit. My phone behaves strangely in 2014, it lasted nearly 1 week on battery (I lost it for half of the week), and seems to shutdown for no particular reason once in a while.&lt;/p&gt;&#xA;&lt;p&gt;On the positive side, I also discovered, after owning my monitor for around 5 years, that it has SD card slots on the side, as well as USB ports. I always used the USB ports of my desktop and never really looked at the side of my monitor&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Levenberg Marquardt &amp; Constraints by Domain Transformation</title>
      <link>https://chasethedevil.github.io/post/levenberg-marquardt--constraints-by-domain-transformation/</link>
      <pubDate>Tue, 17 Dec 2013 15:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/levenberg-marquardt--constraints-by-domain-transformation/</guid>
      <description>The Fortran &lt;a href=&#34;http://www.netlib.org/minpack/&#34;&gt;minpack&lt;/a&gt; library has a good &lt;a href=&#34;http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm&#34;&gt;Levenberg-Marquardt&lt;/a&gt; minimizer, so good, that it has been ported to many programming languages. Unfortunately it does not support contraints, even simple bounds.&lt;br /&gt;&lt;br /&gt;One way to achieve this is to transform the domain via a bijective function. For example, \(a+\frac{b-a}{1+e^{-\alpha t}}\) will transform \(]-\infty, +\infty[\) to ]a,b[. Then how should one choose \(\alpha\)?&lt;br /&gt;&lt;br /&gt;A large \(\alpha\) will make tiny changes in \(t\) appear large. A simple rule is to ensure that \(t\) does not create large changes in the original range ]a,b[, for example we can make \(\alpha t \leq 1\), that is \( \alpha t= \frac{t-a}{b-a} \).&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/-TJiFg4K2fS4/UrBNcxg9wLI/AAAAAAAAG6Q/8BD0OHbxGhg/s1600/Screenshot+from+2013-12-17+13:02:22.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;293&#34; src=&#34;http://4.bp.blogspot.com/-TJiFg4K2fS4/UrBNcxg9wLI/AAAAAAAAG6Q/8BD0OHbxGhg/s400/Screenshot+from+2013-12-17+13:02:22.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;In practice, for example in the calibration of the&lt;a href=&#34;http://en.wikipedia.org/wiki/Heston_model&#34;&gt; Double-Heston&lt;/a&gt; model on real data, a naive \( \alpha=1 \) will converge to a RMSE of 0.79%, while our choice will converge to a RMSE of 0.50%. Both will however converge to the same solution if the initial guess is close enough to the real solution. Without any transform, the RMSE is also 0.50%. The difference in error might not seem large but this results in vastly different calibrated parameters. Introducing the transform can significantly change the calibration result, if not done carefully.&lt;br /&gt;&lt;br /&gt;Another simpler way would be to just impose a cap/floor on the inputs, thus ensuring that nothing is evaluated where it does not make sense. In practice, it however will not always converge as well as the unconstrained problem: the gradient is not defined at the boundary. On the same data, the Schobel-Zhu, unconstrained converges with RMSE 1.08% while the transform converges to 1.22% and the cap/floor to 1.26%. The Schobel-Zhu example is more surprising since the initial guess, as well as the results are not so far:&lt;br /&gt;             &lt;style&gt;  &lt;!--    BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:&#34;Liberation Sans&#34;; font-size:x-small }    --&gt; &lt;/style&gt;     &lt;br /&gt;&lt;table border=&#34;0&#34; cellspacing=&#34;0&#34; cols=&#34;2&#34;&gt; &lt;colgroup span=&#34;2&#34; width=&#34;85&#34;&gt;&lt;/colgroup&gt; &lt;tbody&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Initial volatility (v0)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;18.1961174789&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Long run volatility (theta)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;1&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Speed of mean reversion (kappa)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;101.2291161766&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Vol of vol (sigma)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;35.2221829015&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Correlation (rho)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;-73.7995231799&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;17&#34; style=&#34;border-bottom: 3px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;ERROR MEASURE&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 3px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;1.0614889526&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;             &lt;style&gt;  &lt;!--    BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:&#34;Liberation Sans&#34;; font-size:x-small }    --&gt; &lt;/style&gt;     &lt;br /&gt;&lt;table border=&#34;0&#34; cellspacing=&#34;0&#34; cols=&#34;2&#34;&gt; &lt;colgroup span=&#34;2&#34; width=&#34;85&#34;&gt;&lt;/colgroup&gt; &lt;tbody&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Initial volatility (v0)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;17.1295934569&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Long run volatility (theta)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;1&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Speed of mean reversion (kappa)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;67.9818356373&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Vol of vol (sigma)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;30.8491256097&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;16&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;Correlation (rho)&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 1px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;-74.614636128&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt;  &lt;td align=&#34;LEFT&#34; height=&#34;17&#34; style=&#34;border-bottom: 3px solid #000000; border-left: 3px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;ERROR MEASURE&lt;/span&gt;&lt;/td&gt;  &lt;td align=&#34;RIGHT&#34; style=&#34;border-bottom: 3px solid #000000; border-left: 1px solid #000000; border-right: 3px solid #000000; border-top: 1px solid #000000;&#34; valign=&#34;TOP&#34;&gt;&lt;span style=&#34;font-family: Liberation Serif;&#34;&gt;1.2256421987&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The initial guess is kappa=61% theta=11% sigma=26% v0=18% rho=-70%. Only the kappa is different in the two results, and the range on the kappa is (0,2000) (it is expressed in %), much larger than the result. In reality, theta is the issue (in (0,1000)). Forbidding a negative theta has an impact on how kappa is picked. The only way to be closer&lt;br /&gt;&lt;br /&gt;Finally, a third way is to rely on a simple penalty: returning an arbitrary large number away from the boundary. In our examples this was no better than the transform or the cap/floor.&lt;br /&gt;&lt;br /&gt;Trying out the various ways, it seemed that allowing meaningless parameters, as long as they work mathematically produced the best results with Levenberg-Marquardt, particularly, allowing for a negative theta in Schobel-Zhu made a difference.</description>
    </item>
    <item>
      <title>Arbitrage Free SABR - Another View on Hagan Approach</title>
      <link>https://chasethedevil.github.io/post/arbitrage-free-sabr---another-view-on-hagan-approach/</link>
      <pubDate>Sat, 14 Dec 2013 00:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/arbitrage-free-sabr---another-view-on-hagan-approach/</guid>
      <description>&lt;p&gt;Several months ago, I took a look at &lt;a href=&#34;https://chasethedevil.github.io/post/sabr-with-the-new-hagan-pde-approach&#34;&gt;two interesting recent ways&lt;/a&gt; to price under SABR with no arbitrage:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;One way is due to &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CC0QFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fsol3%2Fpapers.cfm%3Fabstract_id%3D1980726&amp;amp;ei=F4yrUoL7Kq2M7AasuIFg&amp;amp;usg=AFQjCNHDopVl4pLOYEqepVK8Odhk9Td3iA&amp;amp;sig2=-fFTrJR1wY1elyXBC1EC0A&amp;amp;bvm=bv.57967247,d.ZGU&#34;&gt;Andreasen and Huge&lt;/a&gt;, where they find an equivalent local volatility expansion, and then use a one-step finite difference technique to price.&lt;/li&gt;&#xA;&lt;li&gt;The other way is due to Hagan himself, where he numerically solves an approximate PDE in the probability density, and then price with options by integrating on this density.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It turns out that the two ways are much closer than I first thought. Hagan PDE in the probability density is actually just the &lt;a href=&#34;http://en.wikipedia.org/wiki/Fokker%E2%80%93Planck_equation&#34;&gt;Fokker-Planck&lt;/a&gt; (forward) equation.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202013-12-13%2023%2026%2043.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;The \(\alpha D(F)\) is just the equivalent local volatility. Andreasen and Huge use nearly the same local volatility formula but without the exponential part (that is often negligible except for long maturities), directly in Dupire forward PDE:&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202013-12-13%2023%2031%2018.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;A common derivation (for example in &lt;a href=&#34;http://www.amazon.com/The-Volatility-Surface-Practitioners-Finance/dp/0471792519/ref=sr_1_1?ie=UTF8&amp;amp;qid=1386974691&amp;amp;sr=8-1&amp;amp;keywords=Gatheral+the+volatility&#34;&gt;Gatheral book&lt;/a&gt; of the Dupire forward PDE is to actually use the Fokker-Planck equation in the probability density integral formula. Out of curiosity, I tried to price direcly with Dupire forward PDE and the Hagan local volatility formula, using just linear boundary conditions. Here are the results on Hagan own example:&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/hagan_dens1.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/hagan_iv.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;The Local Vol direct approach overlaps the Density approach nearly exactly, except at the high strike boundary, when it comes to probability density measure or to implied volatility smile. On Andreasen and Huge data, it gives the following:&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/ah_dens1.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/ah_iv1.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>American Option on Forward/Futures</title>
      <link>https://chasethedevil.github.io/post/american-option-on-forwardfutures/</link>
      <pubDate>Thu, 21 Nov 2013 11:17:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/american-option-on-forwardfutures/</guid>
      <description>&lt;p&gt;Prices of a Future contract and a Forward contract are the same under the Black-Scholes assumptions (deterministic rates) but the price of options on Futures or options on Forwards might still differ. I did not find this obvious at first.&lt;/p&gt;&#xA;&lt;p&gt;For example, when the underlying contract expiration date (Futures, Forward) is different from the option expiration date. For a Future Option, the Black-76 formula can be used, the discounting is done from the option expiry date, because one receives the cash on expiration due to the margin account. For a Forward Option, the discounting need to be done from the Forward contract expiry date.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Spikes in Heston/Schobel-Zhu Local Volatility</title>
      <link>https://chasethedevil.github.io/post/spikes-in-hestonschobel-zhu-local-volatility/</link>
      <pubDate>Wed, 20 Nov 2013 13:33:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/spikes-in-hestonschobel-zhu-local-volatility/</guid>
      <description>&lt;p&gt;Using precise vanilla option pricing engine for Heston or Schobel-Zhu, like the Cos method with enough points and a large enough truncation can still lead to spikes in the Dupire local volatility (using the variance based formula).&lt;/p&gt;&#xA;&lt;p&gt;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202013-11-20%2012%2053%2032.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Local volatility&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA; &lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Screenshot%20from%202013-11-20%2012%2054%2039.png&#34;&gt;&lt;figcaption&gt;&#xA;       &lt;h4&gt;Implied volatility&lt;/h4&gt;&#xA;     &lt;/figcaption&gt;&#xA; &lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;The large spikes in the local volatility 3d surface are due to constant extrapolation, but there are spikes even way before the extrapolation takes place at longer maturities. Even if the Cos method is precise, it seems to be not enough, especially for large strikes so that the second derivative over the strike combined with the first derivative over time can strongly oscillate.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Local Stochastic Volatility with Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/local-stochastic-volatility-with-monte-carlo/</link>
      <pubDate>Wed, 16 Oct 2013 16:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/local-stochastic-volatility-with-monte-carlo/</guid>
      <description>I always imagined local stochastic volatility to be complicated, and thought it would be very slow to calibrate.&lt;br /&gt;&lt;br /&gt;After reading a bit about it, I noticed that the calibration phase could just consist in calibrating independently a Dupire local volatility model and a stochastic volatility model the usual way.&lt;br /&gt;&lt;br /&gt;One can then choose to compute on the fly the local volatility component (not equal the Dupire one, but including the stochastic adjustment) in the Monte-Carlo simulation to price a product. &lt;br /&gt;&lt;br /&gt;There are two relatively simple algorithms that are remarkably similar, one by Guyon and Henry-Labordère in &#34;&lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1885032&#34;&gt;The Smile Calibration Problem Solved&lt;/a&gt;&#34;:&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://4.bp.blogspot.com/-uV792mNz4Xo/Ul6baEs2ktI/AAAAAAAAG1Q/RpvCpcEygXc/s1600/Screenshot+from+2013-10-16+15:51:46.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;157&#34; src=&#34;http://4.bp.blogspot.com/-uV792mNz4Xo/Ul6baEs2ktI/AAAAAAAAG1Q/RpvCpcEygXc/s400/Screenshot+from+2013-10-16+15:51:46.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And one from Van der Stoep, Grzelak &amp;amp; Oosterlee &#34;&lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDIQFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fabstract%3D2278122&amp;amp;ei=255eUqaEDMaxhAfdqoBI&amp;amp;usg=AFQjCNF2KqSTT2ouvAyiA2J77foOFTzMKw&amp;amp;sig2=fzb4vlDPp49Hp1oT5Wja4A&amp;amp;bvm=bv.54176721,d.ZG4&#34;&gt;The Heston Stochastic-Local Volatility Model: Efficient Monte Carlo Simulation&lt;/a&gt;&#34;:&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/-6-0MMofCHVo/Ul6cWo9JtkI/AAAAAAAAG1Y/xBQnqY_J8tM/s1600/Screenshot+from+2013-10-16+16:01:01.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;63&#34; src=&#34;http://1.bp.blogspot.com/-6-0MMofCHVo/Ul6cWo9JtkI/AAAAAAAAG1Y/xBQnqY_J8tM/s400/Screenshot+from+2013-10-16+16:01:01.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&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/-UkLwvQNeeak/Ul6cWrspGxI/AAAAAAAAG1c/S_X907BJur4/s1600/Screenshot+from+2013-10-16+15:59:08.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;256&#34; src=&#34;http://3.bp.blogspot.com/-UkLwvQNeeak/Ul6cWrspGxI/AAAAAAAAG1c/S_X907BJur4/s400/Screenshot+from+2013-10-16+15:59:08.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In the particle method, the delta function is a regularizing kernel approximating the Dirac function. If we use the notation of the second paper, we have a = psi.&lt;br /&gt;&lt;br /&gt;The methods are extremely similar, the evaluation of the expectation is slightly different, but even that is not very different. The disadvantage is that all paths are needed at each time step. As a payoff is evaluated over one full path, this is quite memory intensive.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Heston, Schobel-Zhu, Bates, Double-Heston Fit</title>
      <link>https://chasethedevil.github.io/post/heston-schobel-zhu-bates-double-heston-fit/</link>
      <pubDate>Mon, 07 Oct 2013 19:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/heston-schobel-zhu-bates-double-heston-fit/</guid>
      <description>I did some experiments fitting Heston, Schobel-Zhu, Bates and Double-Heston to a real world equity index implied volatility surface. I used a global optimizer (differential evolution).&lt;br /&gt;&lt;br /&gt;To my surprise, the Heston fit is quite good: the implied volatility error is less than 0.42% on average. Schobel-Zhu fit is also good (0.47% RMSE), but a bit worse than Heston. Bates improves quite a bit on Heston although it has 3 more parameters, we can see the fit is better for short maturities (0.33% RMSE). Double-Heston has the best fit overall but it is not that much better than simple Heston while it has twice the number of parameters, that is 10 (0.24 RMSE). Going beyond, for example Triple-Heston, does not improve anything, and the optimization becomes very challenging. With Double-Heston, I already noticed that kappa is very low (and theta high) for one of the processes, and kappa is very high (and theta low) for the other process: so much that I had to add a penalty to enforce constraints in my local optimizer. The best fit is at the boundary for kappa and theta. So double Heston already feels over-parameterized.&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-C_IidKxPcx4/UlKmCDJFLmI/AAAAAAAAG0o/PxOjIyGqdQQ/s1600/heston_cos3d.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;480&#34; src=&#34;http://3.bp.blogspot.com/-C_IidKxPcx4/UlKmCDJFLmI/AAAAAAAAG0o/PxOjIyGqdQQ/s640/heston_cos3d.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Heston volatility error&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://3.bp.blogspot.com/-rvjEFAbCS_o/UlKmXZc--7I/AAAAAAAAG0s/yomyHTMJU18/s1600/schobelzhu_cos3d.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;480&#34; src=&#34;http://3.bp.blogspot.com/-rvjEFAbCS_o/UlKmXZc--7I/AAAAAAAAG0s/yomyHTMJU18/s640/schobelzhu_cos3d.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Schobel-Zhu  volatility error&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-_628A9dt_nU/UlKmf4oWujI/AAAAAAAAG00/b8fU_hw_oOY/s1600/bates_cos3d.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;480&#34; src=&#34;http://4.bp.blogspot.com/-_628A9dt_nU/UlKmf4oWujI/AAAAAAAAG00/b8fU_hw_oOY/s640/bates_cos3d.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Bates  volatility error&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-ioz8CuCWNmU/UlKmonoZozI/AAAAAAAAG08/eOTk8KiqxD0/s1600/double_heston_cos3d.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;480&#34; src=&#34;http://4.bp.blogspot.com/-ioz8CuCWNmU/UlKmonoZozI/AAAAAAAAG08/eOTk8KiqxD0/s640/double_heston_cos3d.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Double Heston  volatility error&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Another advantage of Heston is that one can find tricks to find a good initial guess for a local optimizer.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update October 7: &lt;/b&gt;My initial fit relied only on differential evolution and was not the most stable as a result. Adding Levenberg-Marquardt at the end stabilizes the fit, and improves the fit a lot, especially for Bates and Double Heston. I updated the graphs and conclusions accordingly. Bates fit is not so bad at all.</description>
    </item>
    <item>
      <title>Second Cumulant of Heston</title>
      <link>https://chasethedevil.github.io/post/second-cumulant-of-heston/</link>
      <pubDate>Thu, 03 Oct 2013 17:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/second-cumulant-of-heston/</guid>
      <description>&lt;p&gt;I recently stumbled upon an error in the various papers related to the Heston &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;cad=rja&amp;amp;ved=0CEEQFjAC&amp;amp;url=http%3A%2F%2Fta.twi.tudelft.nl%2Fmf%2Fusers%2Foosterle%2Foosterlee%2FCOS.pdf&amp;amp;ei=qYxNUqryFqXJ0QW5u4HYDA&amp;amp;usg=AFQjCNGaMK8Lotud1DP5qReeLWgpoCA0aA&amp;amp;sig2=fljLmTq0WhG8SCgzaOxXxA&amp;amp;bvm=bv.53537100,d.d2k&#34;&gt;Cos method&lt;/a&gt; regarding the second cumulant. It is used to define the boundaries of the Cos method. Letting phi be Heston characteristic function, the cumulant generating function is:&#xA;$$g(u) = \log(\phi(-iu))$$&lt;/p&gt;&#xA;&lt;p&gt;And the second cumulant is defined a:&#xA;$$c_2 = g&amp;rsquo;&amp;rsquo;(0)$$&lt;/p&gt;&#xA;&lt;p&gt;Compared to a numerical implementation, the c_2 from the paper is really off in many use cases.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Maxima for Symbolic Calculus</title>
      <link>https://chasethedevil.github.io/post/maxima-for-symbolic-calculus/</link>
      <pubDate>Wed, 02 Oct 2013 15:06:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/maxima-for-symbolic-calculus/</guid>
      <description>&lt;p&gt;A few years ago, I found an interesting open source symbolic calculus software called &lt;a href=&#34;http://www-fourier.ujf-grenoble.fr/~parisse/giac.html%E2%80%8E&#34;&gt;Xcas&lt;/a&gt;. It can however be quickly limited, for example, it does not seem to work well to compute Taylor expansions with several embedded functions. Google pointed me to another popular open source package, &lt;a href=&#34;http://maxima.sourceforge.net/&#34;&gt;Maxima&lt;/a&gt;. It looks a bit rudimentary (command like interface), but formulas can actually be very easily exported to latex with the tex command. Here is a simple example:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Martin Odersky teaches Scala to the Masses</title>
      <link>https://chasethedevil.github.io/post/martin-odersky-teaches-scala-to-the-masses/</link>
      <pubDate>Tue, 17 Sep 2013 20:11:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/martin-odersky-teaches-scala-to-the-masses/</guid>
      <description>&lt;p&gt;I tried today the &lt;a href=&#34;https://www.coursera.org/course/progfun&#34;&gt;Scala courses on coursera&lt;/a&gt; by the Scala creator, Martin Odersky. I was quite impressed by the quality: I somehow believed Scala to be only a better Java, now I think otherwise. Throughout the course, even though it all sounds very basic, you understand the key concepts of Scala and why functional programming + OO concepts are a natural idea. What&amp;rsquo;s nice about Scala is that it avoids the functional vs OO or even the functional vs procedural debate by allowing both, because both can be important, at different scales. Small details can be (and probably should be) procedural for efficiency, because a processor is a processor, but higher level should probably be more functional (immutable) to be clearer, easier to evolve and more easily parallelized.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Setting Values in Java Enum - A Bad Idea</title>
      <link>https://chasethedevil.github.io/post/setting-values-in-java-enum---a-bad-idea/</link>
      <pubDate>Thu, 12 Sep 2013 10:06:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/setting-values-in-java-enum---a-bad-idea/</guid>
      <description>My Scala habits have made me create a stupid bug related to Java enums. In Scala, the concept of &lt;a href=&#34;http://www.scala-lang.org/old/node/107&#34;&gt;case classes&lt;/a&gt; is very neat and recently, I just confused enum in Java with what I sometimes do in Scala case classes.&lt;br /&gt;&lt;br /&gt;I wrote an enum with a setter like:&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp; public static enum BlackVariateType {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZERO_DERIVATIVE;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private double volSquare;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public double getBlackVolatilitySquare() {&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; return volSquare;&lt;br /&gt;&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; public void setBlackVolatilitySquare(double volSquare) {&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; this.volSquare = volSquare;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&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;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here, calling setBlackVolatilitySquare will override any previous value, and thus, if several parts are calling it with different values, it will be a mess as there is only a single instance.&lt;br /&gt;&lt;br /&gt;I am not sure if there is actually one good use case to have a setter on an enum. This sounds like a very dangerous practice in general. Member variables allowed should be only final. &lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Making Classic Heston Integration Faster than the Cos Method</title>
      <link>https://chasethedevil.github.io/post/making-classic-heston-integration-faster-than-the-cos-method/</link>
      <pubDate>Thu, 05 Sep 2013 17:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/making-classic-heston-integration-faster-than-the-cos-method/</guid>
      <description>&lt;p&gt;A coworker pointed to me that Andersen and Piterbarg book &amp;ldquo;Interest Rate Modeling&amp;rdquo; had a chapter on Fourier integration applied to Heston. The authors rely on the Lewis formula to price vanilla call options under Heston.&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/lewis_formula.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Lewis formula&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;&#xA;&lt;p&gt;More importantly, they strongly advise the use of a Black-Scholes control variate. I had read about that idea before, and actually tried it in the Cos method, but it did not improve anything for the Cos method. So I was a bit sceptical. I decided to add the control variate to &lt;a href=&#34;https://chasethedevil.github.io/post/attari-lord-kahl--cos-methods-comparison-on-heston/&#34;&gt;my Attari code&lt;/a&gt;. The results were very encouraging. So I pursued on implementing the Lewis formula and their basic integration scheme (no change of variable).&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/attari_formula.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Attari formula&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/carrmadan_formula.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Carr-Madan formula (used by Lord-Kahl)&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/heston_formula.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Heston formula&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/cos_formula.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Cos formula&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Better Fonts in Fedora than in Ubuntu</title>
      <link>https://chasethedevil.github.io/post/better-fonts-in-fedora-than-in-ubuntu/</link>
      <pubDate>Sat, 31 Aug 2013 13:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/better-fonts-in-fedora-than-in-ubuntu/</guid>
      <description>&lt;div style=&#34;text-align: justify;&#34;&gt;&lt;div class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif; font-size: small;&#34;&gt;By default, text in Fedora 19 looks ok but not great. There are good tips to improve fonts on http://fedorasolved.org/Members/khaytsus/improve-fonts&lt;/span&gt;&lt;/div&gt;&lt;div class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif; font-size: small;&#34;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif; font-size: small;&#34;&gt;As &lt;u&gt;root&lt;/u&gt; user here is what need to be done:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&#34;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;cd /etc/fonts/conf.d&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;ln -s /usr/share/fontconfig/conf.avail/10-autohint.conf&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;ln -s /usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;yum install freetype-freeworl&lt;span class=&#34;highlightedSearchTerm&#34;&gt;d&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style=&#34;text-align: justify;&#34;&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&#34;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&#34;&gt;Reboot, then, in gnome-tweak-tool choose hinting = slight, and antialiasing = rgba. I also choose the liberation sans and liberation mono fonts.&lt;/span&gt;&lt;/div&gt;&lt;div class=&#34;TerminalCommand&#34;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&#34;&gt;I am not sure which one did the trick, but it looks much better (even better than my laptop under Ubuntu, not sure why).&lt;/span&gt;&lt;/div&gt;&lt;pre class=&#34;TerminalCommand&#34;&gt;&lt;span style=&#34;font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;&#34;&gt;&amp;nbsp;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;br /&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-cDwcj_QVjsQ/UiHVKJn7-fI/AAAAAAAAGuo/7seakYSZp7Q/s1600/Screenshot+from+2013-08-31+13:35:40.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/-cDwcj_QVjsQ/UiHVKJn7-fI/AAAAAAAAGuo/7seakYSZp7Q/s1600/Screenshot+from+2013-08-31+13:35:40.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>Attari, Lord-Kahl &amp; Cos Methods Comparison on Heston</title>
      <link>https://chasethedevil.github.io/post/attari-lord-kahl--cos-methods-comparison-on-heston/</link>
      <pubDate>Wed, 28 Aug 2013 17:54:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/attari-lord-kahl--cos-methods-comparison-on-heston/</guid>
      <description>&lt;p&gt;I recently wrote about the &lt;a href=&#34;https://chasethedevil.github.io/post/the-cos-method-for-heston/&#34;&gt;Cos method&lt;/a&gt;. While rereading the various papers on Heston semi-analytical pricing, especially the &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDAQFjAA&amp;amp;url=http%3A%2F%2Fpfadintegral.com%2Fdocs%2FSchmelzle2010%2520Fourier%2520Pricing.pdf&amp;amp;ei=qREeUpO9HuPE0QXfn4DADw&amp;amp;usg=AFQjCNHANjSlqO6-o5ZfWR8xLpoVT7d5XA&amp;amp;sig2=xeon4_iLfpw8HpKz-0PQQA&amp;amp;bvm=bv.51156542,d.d2k&#34;&gt;nice summary by Schmelzle&lt;/a&gt;, it struck me how close were the Attari/Bates methods and the Cos method derivations. I then started wondering if Attari was really much worse than the Cos method or not.&lt;/p&gt;&#xA;&lt;p&gt;I noticed that Attari method accuracy is directly linked to the underlying Gaussian quadrature method accuracy. I found that the doubly adaptive Newton-Cotes quadrature by Espelid (coteda) was the most accurate/fastest on this problem (compared to Gauss-Laguerre/Legendre/Extrapolated Simpson/Lobatto). If the accuracy of the integration is 1e-6, Attari maximum accuracy will also be 1E-6, this means that very out of the money options will be completely mispriced (might even be negative). In a sense it is similar to what I observed on the Cos method.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Giving Fedora Another Chance</title>
      <link>https://chasethedevil.github.io/post/giving-fedora-another-chance/</link>
      <pubDate>Wed, 14 Aug 2013 22:15:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/giving-fedora-another-chance/</guid>
      <description>&lt;p&gt;I have had some stability issues with the Ubuntu 13.04 on my home computer, not on my laptop. It might be related to hard disk encryption (out of curiosity I encrypted my main hard drive in the installer option, resulting in a usable but quite slow system - it&amp;rsquo;s incredible how much the hard drive is still important for performance). I did not have any particular issue on my work laptop with it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Julia and the Cumulative Normal Distribution</title>
      <link>https://chasethedevil.github.io/post/julia-and-the-cumulative-normal-distribution/</link>
      <pubDate>Tue, 13 Aug 2013 15:52:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>The COS method for Heston</title>
      <link>https://chasethedevil.github.io/post/the-cos-method-for-heston/</link>
      <pubDate>Fri, 02 Aug 2013 14:19:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/the-cos-method-for-heston/</guid>
      <description>&lt;p&gt;Fang, in &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CC4QFjAA&amp;amp;url=http%3A%2F%2Frepository.tudelft.nl%2Fassets%2Fuuid%3A9aa17357-af21-4c09-86a2-3904ced4b873%2Fthesis.pdf&amp;amp;ei=Epf7Uam8CYWChQeCroCgCw&amp;amp;usg=AFQjCNGyjjlwi-ylN6cl2xoUp5A32wwePA&amp;amp;sig2=m-qvIkWMgVH-qw4hq_Y5Ow&amp;amp;bvm=bv.50165853,d.ZG4%22&#34;&gt;her thesis&lt;/a&gt;, has the idea of the COS method and applies it to Heston. There are several published papers around it to price options under various models that have a known characteristic function, as well as to price more exotic options like barriers or bermudans.&lt;/p&gt;&#xA;&lt;p&gt;The COS method is very close to the more standard Heston quasi analytic formula (use transform of characteristic function for the density and integrates the payoff with the density, exchanging summation), except that the more simple &lt;a href=&#34;http://en.wikipedia.org/wiki/Fourier_series&#34;&gt;Fourier series&lt;/a&gt; are used instead of the standard Fourier transform. As a consequence there are a few more approximations that are done related to the truncation of the domain of integration and the result is already discrete, so no need for a Gaussian quadrature.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Octave vs Scilab for PDEs in Finance</title>
      <link>https://chasethedevil.github.io/post/octave-vs-scilab-for-pdes-in-finance/</link>
      <pubDate>Tue, 30 Jul 2013 12:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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>Joda LocalDateTime vs DateTime</title>
      <link>https://chasethedevil.github.io/post/joda-localdatetime-vs-datetime/</link>
      <pubDate>Wed, 17 Jul 2013 14:11:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/joda-localdatetime-vs-datetime/</guid>
      <description>&lt;p&gt;Joda has the concept of LocalDate &lt;a href=&#34;http://joda-time.sourceforge.net/api-release/org/joda/time/LocalDateTime.html&#34;&gt;LocalDateTime&lt;/a&gt; and &lt;a href=&#34;http://joda-time.sourceforge.net/api-release/org/joda/time/DateTime.html&#34;&gt;DateTime&lt;/a&gt;. The LocalDate is just a simple date, while DateTime is a date and a time zone.&lt;/p&gt;&#xA;&lt;p&gt;Where I work we have a similar distinction, although not the same: a simple &amp;ldquo;absolute&amp;rdquo; date object without time vs a relative date (a timestamp) like the JDK Date.&lt;/p&gt;&#xA;&lt;p&gt;The standard JDK Date class is a date without a time zone, but Sun deprecated in JDK 1.1 all methods allowing to use it like a LocalDate, forcing to use it through a Calendar (i.e. like a DateTime), that is, with a TimeZone.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The CUDA Performance Myth II</title>
      <link>https://chasethedevil.github.io/post/the-cuda-performance-myth-ii/</link>
      <pubDate>Fri, 12 Jul 2013 15:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Unity vs KDE in Virtualbox</title>
      <link>https://chasethedevil.github.io/post/unity-vs-kde-in-virtualbox/</link>
      <pubDate>Wed, 10 Jul 2013 23:17:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/unity-vs-kde-in-virtualbox/</guid>
      <description>&lt;p&gt;The other day I installed the latest Ubuntu 13.04 under a VirtualBox virtual machine using Windows as host. To my surprise, unity failed to launch properly on the virtual machine reboot, with compiz complaining, something I have sometimes seen on my work laptop. It&amp;rsquo;s more surprising in a VM since it is in a way much more standard (no strange graphic card, no strange driver, the same stuff for every VirtualBox user (maybe I&amp;rsquo;m wrong there?)). I therefore installed KDE as a way to bypass this issue. Not only it worked, but the UI was much faster: there was some very noticeable lag in Unity, slow fade in fade out effects, when it worked before the reboot.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bessel and Harmonic Kinks in the Forward</title>
      <link>https://chasethedevil.github.io/post/bessel-and-harmonic-kinks-in-the-forward/</link>
      <pubDate>Tue, 02 Jul 2013 15:44:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/bessel-and-harmonic-kinks-in-the-forward/</guid>
      <description>As Bessel (sometimes called Hermite) spline interpolation is only &lt;a href=&#34;http://en.wikipedia.org/wiki/Smooth_function#The_space_of_Ck_functions&#34;&gt;C1&lt;/a&gt;, like the Harmonic spline from Fritsch-Butland, the forward presents small kinks compared to a standard cubic spline. Hyman filtering also creates a kink where it fixes the monotonicity. Those are especially visible with a log scale in time. Here is how it looks on the Hagan-West difficult curve.&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://4.bp.blogspot.com/-xsT1uMr-S6c/UdLZE3SjlEI/AAAAAAAAGg0/lESF6PVyLkk/s942/snapshot30.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;369&#34; src=&#34;http://4.bp.blogspot.com/-xsT1uMr-S6c/UdLZE3SjlEI/AAAAAAAAGg0/lESF6PVyLkk/s640/snapshot30.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Godaddy sold my domain name</title>
      <link>https://chasethedevil.github.io/post/godaddy-sold-my-domain-name/</link>
      <pubDate>Mon, 24 Jun 2013 19:11:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/godaddy-sold-my-domain-name/</guid>
      <description>&lt;p&gt;I discovered that suddenly emails sent to me bounced back yesterday. I logged in my godaddy account and to my surprise saw that I did not own any domain name anymore. I looked at my emails to see if I had received a warning as is usually the case when your domain is about to expire. There was none recent, the most recent was from may 2011, the last time I had renewed my domain.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scala Build Tool : SBT</title>
      <link>https://chasethedevil.github.io/post/scala-build-tool--sbt/</link>
      <pubDate>Wed, 19 Jun 2013 18:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/scala-build-tool--sbt/</guid>
      <description>&lt;p&gt;It&amp;rsquo;s been a while since I do a pet project in Scala, and today, after many trials before, I decided to give another go at Jetbrain Idea for Scala development, as Eclipse with the Scala plugin tended to crash a little bit too often for my taste (resulting sometimes in loss of a few lines of code). I could have just probably updated eclipse and the scala plugin, mine were not very old, but not the latest.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Finite Difference Theta Scheme Optimal Theta</title>
      <link>https://chasethedevil.github.io/post/the-finite-difference-theta-scheme-optimal-theta/</link>
      <pubDate>Tue, 18 Jun 2013 15:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/the-finite-difference-theta-scheme-optimal-theta/</guid>
      <description>&lt;p&gt;The theta finite difference scheme is a common generalization of Crank-Nicolson. In finance, the &lt;a href=&#34;http://www.amazon.com/Wilmott-Quantitative-Finance-Volume-Edition/dp/0470018704/ref=sr_1_1?ie=UTF8&amp;amp;qid=1371557569&amp;amp;sr=8-1&amp;amp;keywords=paul+wilmott+on+quantitative+finance&#34;&gt;book from Wilmott&lt;/a&gt;, a &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDEQFjAA&amp;amp;url=http%3A%2F%2Fwww.javaquant.net%2Fpapers%2Ffdpaper.pdf&amp;amp;ei=DE7AUf-XHo24hAfkvICwBg&amp;amp;usg=AFQjCNHD0qmjyMZtzbLfao3YHCFwySYixg&amp;amp;sig2=9DdLJ9FoVCXoeaus5JykQg&amp;amp;bvm=bv.47883778,d.ZG4&#34;&gt;paper from A. Sepp&lt;/a&gt;, &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;sqi=2&amp;amp;ved=0CDcQFjAB&amp;amp;url=http%3A%2F%2Fwww.risk.net%2Fdigital_assets%2F4451%2Fv1n2a1b.pdf&amp;amp;ei=6k7AUZXXFYXLhAeF3YDYDA&amp;amp;usg=AFQjCNFq4dBzQ54M34qd0DMQ4pgSCcjfQg&amp;amp;sig2=AR3zjeDQ3WIvWOvt-1tNeg&amp;amp;bvm=bv.47883778,d.ZG4&#34;&gt;one from Andersen-Ratcliffe&lt;/a&gt; present it. Most of the time, it&amp;rsquo;s just a convenient way to handle implicit \(\theta=1\), explicit \(\theta=0\) and Crank-Nicolson \(\theta=0.5\) with the same algorithm.&lt;/p&gt;&#xA;&lt;p&gt;Wilmott makes an interesting remark: one can choose a theta that will cancel out higher order terms in the local truncation error and therefore should lead to increased accuracy. $$\theta = \frac{1}{2}- \frac{(\Delta x)^2}{12 b \Delta t} $$&#xA;where \(b\) is the diffusion coefficient.&#xA;This leads to \(\theta &amp;lt; \frac{1}{2}\), which means the scheme is not unconditionally stable anymore but needs to obey (see Morton &amp;amp; Mayers p 30):&#xA;$$b \frac{\Delta t}{(\Delta x)^2} \leq \frac{5}{6}$$&#xA;and to ensure that \(\theta \geq 0 \):&#xA;$$b \frac{\Delta t}{(\Delta x)^2} \geq \frac{1}{6}$$&lt;/p&gt;</description>
    </item>
    <item>
      <title>Simple &#39;Can Scala Do This?&#39; Questions</title>
      <link>https://chasethedevil.github.io/post/simple-can-scala-do-this-questions/</link>
      <pubDate>Tue, 11 Jun 2013 00:28:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Akima for Yield Curve Interpolation ?</title>
      <link>https://chasethedevil.github.io/post/akima-for-yield-curve-interpolation-/</link>
      <pubDate>Mon, 03 Jun 2013 00:07:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/akima-for-yield-curve-interpolation-/</guid>
      <description>On my test of &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;ved=0CDgQFjAB&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fsol3%2Fpapers.cfm%3Fabstract_id%3D2175002&amp;amp;ei=d8GrUb70CJCChQeA7IHoCg&amp;amp;usg=AFQjCNHHizgzORef228lnYX3HygLb9okAg&amp;amp;sig2=NYbhD30aD7sD8TS7CYodzw&amp;amp;bvm=bv.47244034,d.ZG4&#34;&gt;yield curve interpolations&lt;/a&gt;, focusing on parallel delta versus sequential delta, &lt;a href=&#34;http://200.17.213.49/lib/exe/fetch.php/wiki:internas:biblioteca:akima.pdf&#34;&gt;Akima&lt;/a&gt; is the worst of the lot. I am not sure why this interpolation is still popular when most alternatives seem much better. Hyman presented some of the issues with Akima in &lt;a href=&#34;http://epubs.siam.org/doi/abs/10.1137/0904045&#34;&gt;his paper&lt;/a&gt; in 1983. &lt;br /&gt;&lt;br /&gt;In the following graph, a higher value is a higher parallel-vs-sequential difference. &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://4.bp.blogspot.com/-y1jkd6Pu4Y8/UavBtMgvLQI/AAAAAAAAGc4/CDRwTqv-suc/s1600/snapshot18.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;272&#34; src=&#34;http://4.bp.blogspot.com/-y1jkd6Pu4Y8/UavBtMgvLQI/AAAAAAAAGc4/CDRwTqv-suc/s400/snapshot18.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;That plus the Hagan-West example of a tricky curve looks a bit convoluted with it (although it does not have any negative forward).&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://4.bp.blogspot.com/-kKk7NEYtUaw/UavB245C8OI/AAAAAAAAGdA/elBq-es3jWY/s1600/snapshot19.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;225&#34; src=&#34;http://4.bp.blogspot.com/-kKk7NEYtUaw/UavB245C8OI/AAAAAAAAGdA/elBq-es3jWY/s400/snapshot19.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;I have used Quantlib implementation, those results make me wonder if there is not something wrong with the boundaries.</description>
    </item>
    <item>
      <title>2 Ways for an Accurate Barrier with Finite Difference </title>
      <link>https://chasethedevil.github.io/post/2-ways-for-an-accurate-barrier-with-finite-difference/</link>
      <pubDate>Sun, 02 Jun 2013 00:46:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/2-ways-for-an-accurate-barrier-with-finite-difference/</guid>
      <description>I had explored the issue of pricing a barrier using finite difference discretization of the Black-Scholes PDE a few years ago. Briefly, for explicit schemes, one just need to place the barrier on the grid and not worry about much else, but for implicit schemes, either the barrier should be placed on the grid and the grid&amp;nbsp; &lt;b&gt;truncated &lt;/b&gt;at the barrier, or a &lt;b&gt;fictitious point&lt;/b&gt; should be introduced to force the correct price at the barrier level (0, typically).&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/-BDNo4x-nxVw/Uap5CCA8BJI/AAAAAAAAGco/SxT1WlDrIbA/s1600/barrier_grid.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;135&#34; src=&#34;http://1.bp.blogspot.com/-BDNo4x-nxVw/Uap5CCA8BJI/AAAAAAAAGco/SxT1WlDrIbA/s400/barrier_grid.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The fictitious point approach is interesting for the case of varying rebates, or when the barrier moves around. I first saw this idea in the book &#34;Paul Wilmott on Quantitative Finance&#34;.&lt;br /&gt;&lt;br /&gt;Recently, I noticed that Hagan made use of the ficitious point approach in its &#34;Arbitrage free SABR&#34; paper, specifically he places the barrier in the middle of 2 grid points. There is very little difference between truncating the grid and the fictitious point for a constant barrier.&lt;br /&gt;&lt;br /&gt;In this specific case there is a difference because there are 2 additional ODE solved on the same grid, at the boundaries. I was especially curious if one could place the barrier exactly at 0 with the fictitious point, because then one would potentially need to evaluate coefficients for negative values. It turns out you can, as values at the fictitious point are actually not used: the mirror point inside is used because of the mirror boundary conditions.&lt;br /&gt;&lt;br /&gt;So the only difference is the evaluation of the first derivative at the barrier (used only for the ODE): the fictitious point uses the value at barrier+h/2 where h is the space between two points at the same timestep, while the truncated barrier uses a value at barrier+h (which can be seen as standard forward/backward first order finite difference discretization at the boundaries). For this specific case, the fictitious point will be a little bit more precise for the ODE.</description>
    </item>
    <item>
      <title>SABR with the new Hagan PDE Approach</title>
      <link>https://chasethedevil.github.io/post/sabr-with-the-new-hagan-pde-approach/</link>
      <pubDate>Tue, 28 May 2013 15:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>SABR with Andreasen-Huge</title>
      <link>https://chasethedevil.github.io/post/sabr-with-andreasen-huge/</link>
      <pubDate>Fri, 24 May 2013 14:17:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/sabr-with-andreasen-huge/</guid>
      <description>I am on holiday today. Unfortunately I am still thinking about work-related matters, and out of curiosity, wanted to do a little experiment. I know it is not very good to spend free time on work related stuff: there is no reward for it, and there is so much more to life. Hopefully it will be over after this post.&lt;br /&gt;&lt;br /&gt;Around 2 years ago, I saw a presentation from &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDAQFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fsol3%2Fpapers.cfm%3Fabstract_id%3D1980726&amp;amp;ei=-VOfUYncL8HB7AbK0YHgBg&amp;amp;usg=AFQjCNHDopVl4pLOYEqepVK8Odhk9Td3iA&amp;amp;sig2=SChIkU-TBR7ECaLdDm1orA&amp;amp;bvm=bv.47008514,d.ZGU&#34;&gt;Andreasen and Huge about how they were able to price/calibrate SABR&lt;/a&gt; by a one-step finite difference technique. At that time, I did not understand much their idea. My mind was too focused on more classical finite differences techniques and not enough on the big picture in their idea. Their idea is quite general and can be applied to much more than SABR. &lt;br /&gt;&lt;br /&gt;Recently there has been some talk and development going on where I work about SABR (a popular way to interpolate the option implied volatility surface for interest rate derivatives), especially regarding the implied volatility wings at low strike, and sometimes on how to price in a negative rates environment. There are actually quite a bit of research papers around this. I am not really working on that part so I just mostly listened. Then a former coworker suggested that the Andreasen Huge method was actually what banks seemed to choose in practice. A few weeks later, the Thalesians (a group for people interested in quantitative finance) announced a presentation by Hagan (one of the inventor of SABR) about a technique that sounded very much like Andreasen-Huge&amp;nbsp; to deal with the initial SABR issues in low rates.&lt;br /&gt;&lt;br /&gt;As the people working on this did not investigate Andreasen-Huge technique, I somehow felt that I had to and that maybe, this time, I would be able to grasp their idea.&lt;br /&gt;&lt;br /&gt;It took me just a few hours to have meaningful results. Here is the price of out of the money vanilla options using alpha = 0.0758194, nu = 0.1, beta = 0.5, rho = -0.1, forward = 0.02, and a maturity of 2 years.&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&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/-DFehlDerd_U/UZ9ZC6WjBPI/AAAAAAAAGag/P0xM8hHgNt0/s1600/Screenshot+from+2013-05-24+13:29:24.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;212&#34; src=&#34;http://3.bp.blogspot.com/-DFehlDerd_U/UZ9ZC6WjBPI/AAAAAAAAGag/P0xM8hHgNt0/s400/Screenshot+from+2013-05-24+13:29:24.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&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/-6gkuKp8sN9o/UZ9ZC2xvT7I/AAAAAAAAGaY/ELh6t9NyOTY/s1600/Screenshot+from+2013-05-24+13:30:09.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;215&#34; src=&#34;http://4.bp.blogspot.com/-6gkuKp8sN9o/UZ9ZC2xvT7I/AAAAAAAAGaY/ELh6t9NyOTY/s400/Screenshot+from+2013-05-24+13:30:09.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;I did not have in my home library a way to find the implied volatility for a given price. I knew of 2 existing methods, &lt;a href=&#34;http://www.pjaeckel.webspace.virginmedia.com/ByImplication.pdf&#34;&gt;Jaeckel &#34;By Implication&#34;&lt;/a&gt;, and &lt;a href=&#34;http://scholar.google.fr/citations?view_op=view_citation&amp;amp;hl=fr&amp;amp;user=3GRhH_IAAAAJ&amp;amp;citation_for_view=3GRhH_IAAAAJ:d1gkVwhDpl0C&#34;&gt;Li rational functions&lt;/a&gt; approach. I discovered that Li wrote &lt;a href=&#34;http://www.tandfonline.com/doi/abs/10.1080/14697680902849361&#34;&gt;a new paper&lt;/a&gt; on the subject where he uses a SOR method to find the implied volatility and claims it&#39;s very accurate, very fast and very robust. Furthermore, the same idea can be applied to normal implied volatility. What attracted me to it is the simplicity of the underlying algorithm. Jaeckel&#39;s way is a nice way to do Newton-Raphson, but there seems to be so many things to &#34;prepare&#34; to make it work in most cases, that I felt it would be too much work for my experiment. It took me a few more hours to code Li SOR solvers, but it worked amazingly well for my experiment.&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://2.bp.blogspot.com/-dsDHXQXC7FQ/UZ9ZDjmJkQI/AAAAAAAAGas/lmclHTb4Fy0/s1600/Screenshot+from+2013-05-24+13%253A31%253A33.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;215&#34; src=&#34;http://2.bp.blogspot.com/-dsDHXQXC7FQ/UZ9ZDjmJkQI/AAAAAAAAGas/lmclHTb4Fy0/s400/Screenshot+from+2013-05-24+13%253A31%253A33.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&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/-2_g6KW3a-Ds/UZ9ZDmAFjiI/AAAAAAAAGa0/g9Ktmp9Dsr8/s1600/Screenshot+from+2013-05-24+13%253A37%253A51.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;211&#34; src=&#34;http://3.bp.blogspot.com/-2_g6KW3a-Ds/UZ9ZDmAFjiI/AAAAAAAAGa0/g9Ktmp9Dsr8/s400/Screenshot+from+2013-05-24+13%253A37%253A51.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;At first I had an error in my boundary condition and had no so good results especially with a long maturity. The traps with Andreasen-Huge technique are very much the same as with classical finite differences: be careful to place the strike on the grid (eventually smooth it), and have good boundaries.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Large Steps in Schobel-Zhu/Heston the Lazy Way</title>
      <link>https://chasethedevil.github.io/post/large-steps-in-schobel-zhuheston-the-lazy-way/</link>
      <pubDate>Fri, 17 May 2013 12:46:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/large-steps-in-schobel-zhuheston-the-lazy-way/</guid>
      <description>&lt;a href=&#34;http://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCoQFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fsol3%2Fpapers.cfm%3Fabstract_id%3D1485403&amp;amp;ei=ODqVUY-8GY2v7AaSsIHgDw&amp;amp;usg=AFQjCNGxk1TqaYu0mxni-OQib6V6lU-M0g&amp;amp;sig2=xzLPCiO5kdF97KN4Tz474A&amp;amp;bvm=bv.46471029,d.ZGU&#34;&gt;Van Haastrecht, Lord and Pelsser&lt;/a&gt; present an effective way to price derivatives by Monte-Carlo under the Schobel-Zhu model (as well as under the Schobel-Zhu-Hull-White model). It&#39;s quite similar to Andersen QE scheme for Heston in spirit.&lt;br /&gt;&lt;br /&gt;In their paper they evolve the (log) asset process together with the volatility process, using the same discretization times. A while ago, when looking at&amp;nbsp; &lt;a href=&#34;http://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCoQFjAA&amp;amp;url=http%3A%2F%2Fwww.risk.net%2Fdigital_assets%2F6415%2Fjcf_chan_web.pdf&amp;amp;ei=MzyVUaHGO6qI7AbxwIDICQ&amp;amp;usg=AFQjCNGKOILWMeH-0GMgfF-xv35Zq0XfLw&amp;amp;sig2=iQ5RuV32i-pokPP5lzal-Q&amp;amp;bvm=bv.46471029,d.ZGU&#34;&gt;Joshi and Chan&lt;/a&gt; large steps for Heston, I noticed that, inspired by Broadie-Kaya exact Heston scheme, they present the idea to evolve the variance process using small steps and the asset process using large steps (depending on the payoff) using the integrated variance value computed by small steps. The asset steps correspond to payoff evaluation dates&amp;nbsp; At that time I had applied this idea to Andersen QE scheme and it worked reasonably well.&lt;br /&gt;&lt;br /&gt;So I tried to apply the same logic to Schobel Zhu, and my first tests show that it works too. Interestingly, the speed gain is about 2x. Here are the results for a vanilla call option of different strikes.&lt;br /&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-mQzBUiL9Sz0/UZYJOvoQApI/AAAAAAAAGaA/1GnmgQQOIfs/s1600/Screenshot+from+2013-05-17+12:33:07.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;276&#34; src=&#34;http://4.bp.blogspot.com/-mQzBUiL9Sz0/UZYJOvoQApI/AAAAAAAAGaA/1GnmgQQOIfs/s400/Screenshot+from+2013-05-17+12:33:07.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Similar Error between long and short asset steps&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://1.bp.blogspot.com/-TtzRz_UvaRw/UZYJh9AHgCI/AAAAAAAAGaI/RBYU33FUdOs/s1600/Screenshot+from+2013-05-17+12:32:50.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;276&#34; src=&#34;http://1.bp.blogspot.com/-TtzRz_UvaRw/UZYJh9AHgCI/AAAAAAAAGaI/RBYU33FUdOs/s400/Screenshot+from+2013-05-17+12:32:50.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;Long steps take around 1/2 the time to compute&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;I would have expected the difference in performance to increase when the step size is decreasing, but it&#39;s not the case on my computer.&lt;br /&gt;&lt;br /&gt;It&#39;s not truly large steps like &lt;a href=&#34;http://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCoQFjAA&amp;amp;url=http%3A%2F%2Fwww.risk.net%2Fdigital_assets%2F6415%2Fjcf_chan_web.pdf&amp;amp;ei=MzyVUaHGO6qI7AbxwIDICQ&amp;amp;usg=AFQjCNGKOILWMeH-0GMgfF-xv35Zq0XfLw&amp;amp;sig2=iQ5RuV32i-pokPP5lzal-Q&amp;amp;bvm=bv.46471029,d.ZGU&#34;&gt;Joshi and Chan&lt;/a&gt; do in their integrated double gamma scheme as the variance is still discretized in relatively small steps in my case, but it seems like a good, relatively simple optimization. A while ago, I did also implement the full Joshi and Chan scheme, but it&#39;s really interesting if one is always looking for long steps: it is horribly slow when the step size is small, which might occur for many exotic payoffs, while Andersen QE scheme perform almost as well as log-Euler in terms of computational cost.</description>
    </item>
    <item>
      <title>Exact Forward in Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/exact-forward-in-monte-carlo/</link>
      <pubDate>Mon, 13 May 2013 17:58:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/exact-forward-in-monte-carlo/</guid>
      <description>&lt;p&gt;Where I work, there used to be quite a bit of a confusion on which rates one should use as input to a Local Volatility Monte-Carlo simulation.&lt;/p&gt;&#xA;&lt;p&gt;In particular there is a paper in the Journal of Computation Finance by Andersen and Ratcliffe &amp;ldquo;The Equity Option Volatility Smile: a Finite Difference Approach&amp;rdquo; which explains one should use specially tailored rates for the finite difference scheme in order to reproduce exact Bond price and exact Forward contract prices&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quasi Monte Carlo in Finance</title>
      <link>https://chasethedevil.github.io/post/quasi-monte-carlo-in-finance/</link>
      <pubDate>Mon, 13 May 2013 13:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/quasi-monte-carlo-in-finance/</guid>
      <description>I have been wondering if there was any better alternative than the standard Sobol (+ Brownian Bridge) quasi random sequence generator for the Monte Carlo simulations of finance derivatives.&lt;br /&gt;&lt;br /&gt;Here is what I found:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Scrambled Sobol. The idea is to rerandomize the quasi random numbers slightly. It can provide better uniformity properties and allows for a real estimate of the standard error. There are many ways to do that. The simple Cranley Patterson rotation consisting in adding a pseudo random number modulo 1, Owen scrambling (permutations of the digits) and simplifications of it to achieve a reasonable speed. This is all very well described in &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=6&amp;amp;cad=rja&amp;amp;ved=0CFwQFjAF&amp;amp;url=http%3A%2F%2Fwww-stat.stanford.edu%2F~owen%2Fcourses%2F362%2Freadings%2Fsiggraph03.pdf&amp;amp;ei=08CQUea-F4jMhAfx5YDgCA&amp;amp;usg=AFQjCNGLnKapkdJ4_caiSE3Ro_kf21NvkQ&amp;amp;sig2=j2b_JqQuO9JNU0ko7yTeOw&amp;amp;bvm=bv.46340616,d.ZG4&#34;&gt;Owen Quasi Monte Carlo document&lt;/a&gt; &lt;/li&gt;&lt;li&gt;Lattice rules. It is another form of quasi random sequences, which so far was not very well adapted to finance problems. A &lt;a href=&#34;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;ved=0CDYQFjAB&amp;amp;url=https%3A%2F%2Fwww.maths.unsw.edu.au%2Fsites%2Fdefault%2Ffiles%2Famr08_9_0.pdf&amp;amp;ei=ysKQUebXO4axO7ungPAN&amp;amp;usg=AFQjCNErqQvM1IyLlUJH2EX5_mVG3f-ZCw&amp;amp;sig2=gYbfQebTwUP4mtj6bteCcQ&amp;amp;bvm=bv.46340616,d.ZWU&#34;&gt;presentation from Giles &amp;amp; Kuo&lt;/a&gt; look like it&#39;s changing.&lt;/li&gt;&lt;li&gt;Fast PCA. An alternative to Brownian Bridge is the standard PCA. The problem with PCA is the performance in O(n^2). A possible speedup is possible in the case of a equidistant time steps. &lt;a href=&#34;http://www.google.com/url?q=http://citeseerx.ist.psu.edu/viewdoc/download%3Fdoi%3D10.1.1.142.5057%26rep%3Drep1%26type%3Dpdf&amp;amp;sa=U&amp;amp;ei=5MWQUaioA8KXhQfDnYCYDQ&amp;amp;ved=0CB0QFjAC&amp;amp;usg=AFQjCNHUhpr6_Ofiqqw2XeU8SY_amnx0pw&#34;&gt;This paper&lt;/a&gt; shows it can be generalized. But the data in it shows it is only advantageous for more than 1024 steps - not so interesting in Finance.&lt;/li&gt;&lt;/ol&gt;</description>
    </item>
    <item>
      <title>Time Estimates in Software Development</title>
      <link>https://chasethedevil.github.io/post/time-estimates-in-software-development/</link>
      <pubDate>Tue, 07 May 2013 21:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/time-estimates-in-software-development/</guid>
      <description>&lt;p&gt;Recently, that I completed a project that I had initially estimated to around 2 months,  in nearly 4 hours. This morning I fixed the few remaining bugs. I looked at the clock, surprised it was still so early and I still had so many hours left in the day.&lt;/p&gt;&#xA;&lt;p&gt;Now I have more time to polish the details and go beyond the initial goal (I think this scares my manager a bit), but I could (and I believe some people do this often) stop now and all the management would be satisfied.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Upper Bounds in American Monte-Carlo</title>
      <link>https://chasethedevil.github.io/post/upper-bounds-in-american-monte-carlo/</link>
      <pubDate>Tue, 30 Apr 2013 17:05:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/upper-bounds-in-american-monte-carlo/</guid>
      <description>&lt;a href=&#34;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.159.2367&amp;amp;rep=rep1&amp;amp;type=pdf&#34;&gt;Glasserman and Yu&lt;/a&gt; (GY) give a relatively simple algorithm to compute lower and upper bounds of a the price of a Bermudan Option through Monte-Carlo.&lt;br /&gt;&lt;br /&gt;I always thought it was very computer intensive to produce an upper bound, and that the standard &lt;a href=&#34;http://escholarship.org/uc/item/43n1k4jb.pdf&#34;&gt;Longstaff Schwartz algorithm&lt;/a&gt; was quite precise already. GY algorithm is not much slower than the Longstaff-Schwartz algorithm, but what&#39;s a bit tricky is the choice of basis functions: they have to be Martingales. This is the detail I overlooked at first and I, then, could not understand why my results were so bad. I looked for a coding mistake for several hours before I figured out that my basis functions were not Martingales. Still it is possible to find good Martingales for the simple Bermudan Put option case and GY actually propose some &lt;a href=&#34;http://arxiv.org/pdf/math.PR/0503556&#34;&gt;in another paper&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here are some preliminary results where I compare the random number generator influence and the different methods. I include results for GY using In-the-money paths only for the regression (-In suffix) or all (no suffix). &lt;br /&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-c7Jhn_s05Ak/UYACCpfoRjI/AAAAAAAAGXQ/LoQscl4b4yM/s1600/gy_train16k_sim_value.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;238&#34; src=&#34;http://2.bp.blogspot.com/-c7Jhn_s05Ak/UYACCpfoRjI/AAAAAAAAGXQ/LoQscl4b4yM/s400/gy_train16k_sim_value.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;value using 16k training path and Sobol - GY-Low-In is very close to LS.&lt;/td&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-Jx0NPC1QvAs/UYACisXbFiI/AAAAAAAAGXY/mvsHmNhENcE/s1600/gy_tr16k_sim.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;300&#34; src=&#34;http://4.bp.blogspot.com/-Jx0NPC1QvAs/UYACisXbFiI/AAAAAAAAGXY/mvsHmNhENcE/s640/gy_tr16k_sim.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;error using 16k training path - a high number of simulations not that useful&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;table align=&#34;center&#34; cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;tr-caption-container&#34; style=&#34;margin-left: auto; margin-right: auto; text-align: center;&#34;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&#34;text-align: center;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-w6Mp3BDNp-w/UYADEhUQx4I/AAAAAAAAGXg/ESRJyLUybNk/s1600/gy_sim1m_training.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: auto; margin-right: auto;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;282&#34; src=&#34;http://2.bp.blogspot.com/-w6Mp3BDNp-w/UYADEhUQx4I/AAAAAAAAGXg/ESRJyLUybNk/s640/gy_sim1m_training.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&#34;tr-caption&#34; style=&#34;text-align: center;&#34;&gt;error using 1m simulation paths - GY basis functions require less training than LS&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;One can see the the upper bound is not that precise compared to the lower bound estimate, and that using only in the money paths makes a big difference. GY regression is good with only 1k paths, LS requires 10x more.&lt;br /&gt;&lt;br /&gt;Surprisingly, I noticed that the Brownian bridge variance reduction applied to Sobol was&amp;nbsp; increasing the GY low estimate, so as to make it sometimes slightly higher than Longstaff-Schwartz price.</description>
    </item>
    <item>
      <title>The Wonderful UN</title>
      <link>https://chasethedevil.github.io/post/the-wonderful-un/</link>
      <pubDate>Wed, 24 Apr 2013 21:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/the-wonderful-un/</guid>
      <description>&lt;p&gt;Already the name United Nations should be suspicious, but now &lt;a href=&#34;http://boingboing.net/2013/04/24/more-evidence-that-haitis-ch.html&#34;&gt;they are shown to have spread Cholera&lt;/a&gt; to Haiti, as if the country did not have enough suffering. They have a nice building in New-York, and used to have a popular representative, but unfortunately, for poor countries, they never really achieved much. In Haiti, there were many stories of rapes and corruption by U.N. members more than 10 years ago. The movie &lt;a href=&#34;http://www.imdb.com/title/tt0896872/&#34;&gt;The Whistleblower&lt;/a&gt; suggests it was the same in the Balkans. I am sure it did not change much since.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Moved From Dropbox to Ubuntu One</title>
      <link>https://chasethedevil.github.io/post/moved-from-dropbox-to-ubuntu-one/</link>
      <pubDate>Tue, 23 Apr 2013 20:44:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/moved-from-dropbox-to-ubuntu-one/</guid>
      <description>&lt;p&gt;Dropbox worked well, but the company decided to blacklist it. I suppose some people abused it. While looking for an alternative, I found &lt;a href=&#34;https://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDMQFjAA&amp;amp;url=https%3A%2F%2Fone.ubuntu.com%2F&amp;amp;ei=QtZ2UY3NO83GPePRgOgF&amp;amp;usg=AFQjCNFS8gIGpHCkBTGRPbT7qLVFzb584g&amp;amp;sig2=z3LX3TTwx8lLoS41AJCgaA&amp;amp;bvm=bv.45580626,d.ZWU&#34;&gt;Ubuntu One&lt;/a&gt;. It&amp;rsquo;s funny I never tried it before even though I use Ubuntu. I did not think it was a dropbox replacement, but it is. And you get 5GB instead of Dropbox 2GB limit, which is enough for me (I was a bit above the 2GB limit). It works well under Linux but as well on Android and there is an iOS app I have not yet tried. It also works on Windows and Mac.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quasi Monte-Carlo &amp; Longstaff-Schwartz American Option price</title>
      <link>https://chasethedevil.github.io/post/quasi-monte-carlo--longstaff-schwartz-american-option-price/</link>
      <pubDate>Mon, 22 Apr 2013 18:00:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/quasi-monte-carlo--longstaff-schwartz-american-option-price/</guid>
      <description>In the book &lt;i&gt;&lt;a href=&#34;http://books.google.fr/books?id=e9GWUsQkPNMC&amp;amp;lpg=PA461&amp;amp;vq=longstaff&amp;amp;hl=fr&amp;amp;pg=PA459#v=snippet&amp;amp;q=longstaff&amp;amp;f=false&#34;&gt;Monte Carlo Methods in Financial Engineering&lt;/a&gt;&lt;/i&gt;, Glasserman explains that if one reuses the paths used in the optimization procedure for the parameters of the exercise boundary (in this case the result of the regression in Longstaff-Schwartz method) to compute the Monte-Carlo mean value, we will introduce a bias: the estimate will be biased high because it will include knowledge about future paths.&lt;br /&gt;&lt;br /&gt;However Longstaff and Schwartz seem to just reuse the paths in &lt;a href=&#34;http://rfs.oxfordjournals.org/content/14/1/113.short&#34;&gt;their paper&lt;/a&gt;, and Glasserman himself, when presenting Longstaff-Schwartz method later in the book just use the same paths for the regression and to compute the Monte-Carlo mean value.&lt;br /&gt;&lt;br /&gt;How large is this bias? What is the correct methodology?&lt;br /&gt;&lt;br /&gt;I have tried with Sobol quasi random numbers to evaluate that bias on a simple Bermudan put option of maturity 180 days, exercisable at 30 days, 60 days, 120 days and 180 days using a Black Scholes volatility of 20% and a dividend yield of 6%. As a reference I use &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDcQFjAA&amp;amp;url=http%3A%2F%2Fpapers.ssrn.com%2Fsol3%2Fpapers.cfm%3Fabstract_id%3D1648878&amp;amp;ei=9151UZ3pM4LZPZ-ugeAF&amp;amp;usg=AFQjCNFS9fdRJt9RoerSnb87YDIZmLcCtw&amp;amp;sig2=k8lHjhUe14ep4giVM5Mr5Q&amp;amp;bvm=bv.45512109,d.ZWU&#34;&gt;a finite difference solver based on TR-BDF2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I found it particularly difficult to evaluate it: should we use the same number of paths for the 2 methods or should we use the same number of paths for the monte carlo mean computation only? Should we use the same number of paths for regression and for monte carlo mean computation or should the monte carlo mean computation use much more paths?&lt;br /&gt;&lt;br /&gt;I have tried those combinations and was able to clearly see the bias only in one case: a large number of paths for the Monte-Carlo mean computation compared to the number of paths used for the regression using a fixed total number of paths of 256*1024+1, and 32*1024+1 paths for the regression.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;FDM price=2.83858387194312&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;Longstaff discarded paths price=2.8385854695510426&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;Longstaff reused paths price=2.8386108892756847&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Those numbers are too good to be a real. If one reduces too much the total number of paths or the number of paths for the regression, the result is not precise enough to see the bias. For example, using 4K paths for the regression leads to 2.83770 vs 2.83767. Using 4K paths for regression and only 16K paths in total leads to 2.8383 vs 2.8387. Using 32K paths for regressions and increasing to 1M paths in total leads to 2.838539 vs 2.838546.&lt;br /&gt;&lt;br /&gt;For this example the Longstaff-Schwartz price is biased low, the slight increase due to path reuse is not very visible and most of the time does not deteriorate the overall accuracy. But as a result of reusing the paths, the Longstaff-Schwartz price might be higher than the real value.</description>
    </item>
    <item>
      <title>A Fast Exponential Function in Java</title>
      <link>https://chasethedevil.github.io/post/a-fast-exponential-function-in-java/</link>
      <pubDate>Fri, 19 Apr 2013 16:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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 III)</title>
      <link>https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-iii/</link>
      <pubDate>Fri, 12 Apr 2013 13:41:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-iii/</guid>
      <description>&lt;p&gt;I forgot two important points in my &lt;a href=&#34;https://chasethedevil.github.io/post/root-finding-in-lord-kahl-method-to-compute-heston-call-price-part-ii/&#34;&gt;previous post&lt;/a&gt; about &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 Heston call price:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Scaling: scaling the call price appropriately allows to increase the maximum precision significantly, because the &lt;a href=&#34;http://portal.tugraz.at/portal/page/portal/Files/i5060/files/staff/mueller/FinanzSeminar2012/CarrMadan_OptionValuationUsingtheFastFourierTransform_1999.pdf&#34;&gt;Carr-Madan&lt;/a&gt; formula operates on log(Forward) and log(Strike) directly, but not the ratio, and alpha is multiplied by the log(Forward). I simply scale by the spot, the call price is (S_0*max(S/S_0-K/S0)). Here are the results for &lt;a href=&#34;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=921336&#34;&gt;Lord-Kahl&lt;/a&gt;, &lt;a href=&#34;http://pjaeckel.webspace.virginmedia.com/NotSoComplexLogarithmsInTheHestonModel.pdf&#34;&gt;Kahl-Jaeckel&lt;/a&gt; (the more usual way limited to machine epsilon accuracy), &lt;a href=&#34;http://epubs.siam.org/doi/abs/10.1137/110830241&#34;&gt;Forde-Jacquier-Lee&lt;/a&gt; ATM implied volatility without scaling for a maturity of 1 day:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;table&gt;&#xA;  &lt;thead&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;th&gt;Strike&lt;/th&gt;&#xA;          &lt;th&gt;Lord-Kahl&lt;/th&gt;&#xA;          &lt;th&gt;Kahl-Jaeckel&lt;/th&gt;&#xA;          &lt;th&gt;Forde-Jacquier-Lee&lt;/th&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/thead&gt;&#xA;  &lt;tbody&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;62.5&lt;/td&gt;&#xA;          &lt;td&gt;2.919316809400033E-34&lt;/td&gt;&#xA;          &lt;td&gt;8.405720564041985E-12&lt;/td&gt;&#xA;          &lt;td&gt;0.0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;68.75&lt;/td&gt;&#xA;          &lt;td&gt;-8.923683388191852E-28&lt;/td&gt;&#xA;          &lt;td&gt;1.000266536266281E-11&lt;/td&gt;&#xA;          &lt;td&gt;0.0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;75.0&lt;/td&gt;&#xA;          &lt;td&gt;-3.2319611910032E-22&lt;/td&gt;&#xA;          &lt;td&gt;2.454925152051146E-12&lt;/td&gt;&#xA;          &lt;td&gt;0.0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;81.25&lt;/td&gt;&#xA;          &lt;td&gt;1.9401743410877718E-16&lt;/td&gt;&#xA;          &lt;td&gt;2.104982854689297E-12&lt;/td&gt;&#xA;          &lt;td&gt;0.0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;87.5&lt;/td&gt;&#xA;          &lt;td&gt;-Infinity&lt;/td&gt;&#xA;          &lt;td&gt;-1.6480150577535824E-11&lt;/td&gt;&#xA;          &lt;td&gt;0.0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;93.75&lt;/td&gt;&#xA;          &lt;td&gt;Infinity&lt;/td&gt;&#xA;          &lt;td&gt;1.8277663826893331E-9&lt;/td&gt;&#xA;          &lt;td&gt;1.948392142070432E-9&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;100.0&lt;/td&gt;&#xA;          &lt;td&gt;0.4174318393886519&lt;/td&gt;&#xA;          &lt;td&gt;0.41743183938679845&lt;/td&gt;&#xA;          &lt;td&gt;0.4174314959743768&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;106.25&lt;/td&gt;&#xA;          &lt;td&gt;1.326968012594355E-11&lt;/td&gt;&#xA;          &lt;td&gt;7.575717830832218E-11&lt;/td&gt;&#xA;          &lt;td&gt;1.1186618909114702E-11&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;112.5&lt;/td&gt;&#xA;          &lt;td&gt;-5.205783145942609E-21&lt;/td&gt;&#xA;          &lt;td&gt;2.5307755890935368E-11&lt;/td&gt;&#xA;          &lt;td&gt;6.719872683111381E-45&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;118.75&lt;/td&gt;&#xA;          &lt;td&gt;4.537094156599318E-25&lt;/td&gt;&#xA;          &lt;td&gt;1.8911094912255066E-11&lt;/td&gt;&#xA;          &lt;td&gt;3.615356241778357E-114&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;125.0&lt;/td&gt;&#xA;          &lt;td&gt;1.006555799739525E-27&lt;/td&gt;&#xA;          &lt;td&gt;3.2365221613872563E-12&lt;/td&gt;&#xA;          &lt;td&gt;2.3126009701775733E-240&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;      &lt;tr&gt;&#xA;          &lt;td&gt;131.25&lt;/td&gt;&#xA;          &lt;td&gt;4.4339539263484925E-31&lt;/td&gt;&#xA;          &lt;td&gt;2.4794388764348696E-11&lt;/td&gt;&#xA;          &lt;td&gt;0.0&lt;/td&gt;&#xA;      &lt;/tr&gt;&#xA;  &lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;One can see negative prices and meaningless prices outside ATM. With scaling it changes to:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Root finding in Lord Kahl Method to Compute Heston Call Price (Part II)</title>
      <link>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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>Cracking the Double Precision Gaussian Puzzle</title>
      <link>https://chasethedevil.github.io/post/cracking-the-double-precision-gaussian-puzzle/</link>
      <pubDate>Fri, 22 Mar 2013 12:20:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/cracking-the-double-precision-gaussian-puzzle/</guid>
      <description>&lt;p&gt;In my &lt;a href=&#34;https://chasethedevil.github.io/post/a-double-precision-puzzle-with-the-gaussian/&#34;&gt;previous post&lt;/a&gt;, I stated that some library (SPECFUN by W.D. Cody) computes \(e^{-\frac{x^2}{2}}\) the following way:&#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-C&#34; data-lang=&#34;C&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;xsq &lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#06287e&#34;&gt;fint&lt;/span&gt;(x &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#40a070&#34;&gt;1.6&lt;/span&gt;) &lt;span style=&#34;color:#666&#34;&gt;/&lt;/span&gt; &lt;span style=&#34;color:#40a070&#34;&gt;1.6&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;del &lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt; (x &lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt; xsq) &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; (x &lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt; xsq);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;result &lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#06287e&#34;&gt;exp&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt;xsq &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; xsq &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#40a070&#34;&gt;0.5&lt;/span&gt;) &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#06287e&#34;&gt;exp&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt;del &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#40a070&#34;&gt;0.5&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code class=&#34;code-inline language-C&#34;&gt;&lt;span style=&#34;color:#06287e&#34;&gt;fint&lt;/span&gt;(z)&lt;/code&gt; computes the floor of z.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why 1.6?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;An integer divided by 1.6 will be an exact representation of the corresponding number in double: 1.6 because of 16 (dividing by 1.6 is equivalent to multiplying by 10 and dividing by 16 which is an exact operation). It also allows to have something very close to a rounding function: x=2.6 will make xsq=2.5, x=2.4 will make xsq=1.875, x=2.5 will make xsq=2.5. The maximum difference between x and xsq will be 0.625.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Double Precision Puzzle with the Gaussian</title>
      <link>https://chasethedevil.github.io/post/a-double-precision-puzzle-with-the-gaussian/</link>
      <pubDate>Wed, 20 Mar 2013 17:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/a-double-precision-puzzle-with-the-gaussian/</guid>
      <description>&lt;p&gt;Some library computes the Gaussian density function $$e^{-\frac{x^2}{2}}$$ the following way:&#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-C&#34; data-lang=&#34;C&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;xsq &lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#06287e&#34;&gt;fint&lt;/span&gt;(x &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#40a070&#34;&gt;1.6&lt;/span&gt;) &lt;span style=&#34;color:#666&#34;&gt;/&lt;/span&gt; &lt;span style=&#34;color:#40a070&#34;&gt;1.6&lt;/span&gt;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;del &lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt; (x &lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt; xsq) &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; (x &lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt; xsq);&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;result &lt;span style=&#34;color:#666&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#06287e&#34;&gt;exp&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt;xsq &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; xsq &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#40a070&#34;&gt;0.5&lt;/span&gt;) &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt; &lt;span style=&#34;color:#06287e&#34;&gt;exp&lt;/span&gt;(&lt;span style=&#34;color:#666&#34;&gt;-&lt;/span&gt;del &lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt;&lt;span style=&#34;color:#40a070&#34;&gt;0.5&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;code class=&#34;code-inline language-C&#34;&gt;&lt;span style=&#34;color:#06287e&#34;&gt;fint&lt;/span&gt;(z)&lt;/code&gt; computes the floor of z.&lt;/p&gt;&#xA;&lt;p&gt;Basically, &lt;code class=&#34;code-inline language-C&#34;&gt;x&lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt;x&lt;/code&gt; is rewritten as &lt;code class=&#34;code-inline language-C&#34;&gt;xsq&lt;span style=&#34;color:#666&#34;&gt;*&lt;/span&gt;xsq&lt;span style=&#34;color:#666&#34;&gt;+&lt;/span&gt;del&lt;/code&gt;. I have seen that trick once before, but I just can&amp;rsquo;t figure out where and why (except that it is probably related to high accuracy issues).&lt;/p&gt;&#xA;&lt;p&gt;The answer is in the &lt;a href=&#34;https://chasethedevil.github.io/post/cracking-the-double-precision-gaussian-puzzle/&#34;&gt;next post&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Seasoned Volatility Swap</title>
      <link>https://chasethedevil.github.io/post/a-seasoned-volatility-swap/</link>
      <pubDate>Thu, 14 Mar 2013 19:55:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/a-seasoned-volatility-swap/</guid>
      <description>This is very much what&#39;s in the Carr-Lee paper &#34;Robust Replication of Volatility Derivatives&#34;, but it wasn&#39;t so easy to obtain in practice:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The formulas as written in the paper are not usable as is: they can be simplified (not too difficult, but intimidating at first)&lt;/li&gt;&lt;li&gt;The numerical integration is not trivial: a simple Gauss-Laguerre is not precise enough (maybe if I had an implementation with more points), a Gauss-Kronrod is not either (maybe if we split it in different regions). Funnily a simple adaptive Simpson works ok (but my boundaries are very basic: 1e-5 to 1e5).&lt;/li&gt;&lt;/ul&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/-UbYc6dfh8Yw/UUIc6V2Mg8I/AAAAAAAAGSI/25Rdvjzk-xk/s1600/Screenshot+from+2013-03-14+19:33:04.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;254&#34; src=&#34;http://4.bp.blogspot.com/-UbYc6dfh8Yw/UUIc6V2Mg8I/AAAAAAAAGSI/25Rdvjzk-xk/s320/Screenshot+from+2013-03-14+19:33:04.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>A Volatility Swap and a Straddle</title>
      <link>https://chasethedevil.github.io/post/a-volatility-swap-and-a-straddle/</link>
      <pubDate>Tue, 12 Mar 2013 21:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/a-volatility-swap-and-a-straddle/</guid>
      <description>&lt;p&gt;A &lt;a href=&#34;https://en.wikipedia.org/wiki/Volatility_swap&#34;&gt;Volatility swap&lt;/a&gt; is a forward contract on future realized volatility. The pricing of such a contract used to be particularly challenging, often either using an unprecise popular expansion in the variance, or a model specific way (like Heston or local volatility with Jumps). Carr and Lee have recently proposed a way to price those contracts in a model independent way in their paper &amp;ldquo;&lt;em&gt;robust replication of volatility derivatives&lt;/em&gt;&amp;rdquo;. Here is the difference between the value of a synthetic volatility swap payoff at maturity (a newly issued one, with no accumulated variance) and a straddle.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Parallel Can Be Slower</title>
      <link>https://chasethedevil.github.io/post/parallel-can-be-slower/</link>
      <pubDate>Wed, 13 Feb 2013 17:05:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/parallel-can-be-slower/</guid>
      <description>&lt;p&gt;I found a nice finite difference scheme, where the solving part can be parallelized on 2 processors at each time-step&lt;/p&gt;&#xA;&lt;p&gt;I was a bit surprised to notice that the parallelized algorithm ran in some cases twice slower than the same algorithm not parallelized. I tried ForkJoinPool, ThreadPoolExecutor, my one notify/wait based parallelization. All resulted in similar performance compared to just calling thread1.run() and thread2.run() directly.&lt;/p&gt;&#xA;&lt;p&gt;I am still a bit puzzled by the results. Increasing the time of the task by increasing the number of discretization points does not really improve the parallelization. The task is relatively fast to perform and is repeated many (around of 1000) times, so synchronized around 1000 times, which is likely why parallelization is not great on it: synchronization overhead reaps any benefit of the parallelization. But I expected better. Using a Thread pool of 1 thread is also much slower than calling run() twice (and fortunately slower than the pool of 2 threads).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scala is Mad (part 2)</title>
      <link>https://chasethedevil.github.io/post/scala-is-mad-part-2/</link>
      <pubDate>Wed, 13 Feb 2013 16:20:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>From OpenSuse to Ubuntu 13.04</title>
      <link>https://chasethedevil.github.io/post/from-opensuse-to-ubuntu-13.04/</link>
      <pubDate>Fri, 01 Feb 2013 18:22:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/from-opensuse-to-ubuntu-13.04/</guid>
      <description>&lt;p&gt;In my Linux quest, I changed distribution again on my home desktop, from OpenSuse 11.1 with KDE to Ubuntu 13.04 (not yet released - so alpha) with Unity. Why?&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;KDE was crashing a bit too often for my taste (more than once a week). Although I enjoyed the KDE environment.&lt;/li&gt;&#xA;&lt;li&gt;Not easy to transfer files to my Android 4.2 phone. Ubuntu 13.04 is not fully there yet, but is on its way.&lt;/li&gt;&#xA;&lt;li&gt;zypper is a bit too specific for my taste. I would be ok with yum+rpm or apt-get, but another tool just for a single distribution, not really.&lt;/li&gt;&#xA;&lt;li&gt;Plus I&amp;rsquo;m just curious what&amp;rsquo;s next for Ubuntu, and Linux makes it very simple to change distributions, and reinstall applications with the same settings. So it&amp;rsquo;s never a big task to change distribution.&lt;/li&gt;&#xA;&lt;li&gt;I somehow like how Ubuntu feels, not sure what it is exactly, maybe the Debian roots.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;When people say OpenSuse is rock solid, I don&amp;rsquo;t have that impression, at least on the desktop. It might have been true in the past. But in the past, most distros were very stable. I never remember having big stability issues until, maybe, late 2010. In the early 2000s, a laptop would work very well with Linux, suspend included. I remember that my Dell Inspiron 8200 was working perfectly with Mandrake and WindowMaker. Nowadays, it never seem to work that well, but is just ok: Optimus comes to mind (especially with external screen), suspend problems, wifi (not anymore).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Productivity Zero</title>
      <link>https://chasethedevil.github.io/post/productivity-zero/</link>
      <pubDate>Thu, 24 Jan 2013 22:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/productivity-zero/</guid>
      <description>&lt;p&gt;Sometimes it feels like big companies try to enforce the Productivity Zero rule.&lt;/p&gt;&#xA;&lt;p&gt;Here is a guide:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;involve as many team as possible. It will help ensuring endless discussions about who is doing what, and then how do I interface with them. This is most (in)efficient when team managers interact and are not very technically competent. One consequence is that nobody is fully responsible/accountable, which helps reinforce the productivity zero.&lt;/li&gt;&#xA;&lt;li&gt;meetings, meetings and meetings. FUD (Fear Uncertainty and Doubt) is king here. By spreading FUD, there will be more and more meetings. Even if the &amp;ldquo;project&amp;rdquo; is actually not a real project, but amounts to 10 lines of code, it is possible to have many meetings around it, over the span of several months (because everybody is always busy with other tasks). Another strategy is to use vocabulary, talk about technical or functional parts the others don&amp;rsquo;t understand. Some people are masters are talking technical to functional people and vice versa.&lt;/li&gt;&#xA;&lt;li&gt;multiply by 20, not 2. It is surprisingly easy to tell upper management something is going to take 3 months, when, in fact, it can be done in 3 days. This is a bit like bargaining in South East Asia: it&amp;rsquo;s always amazing to find out how much you can push the price down (or how much they push it up).&lt;/li&gt;&#xA;&lt;li&gt;hire as many well paid managers and product specialists as you can, and make sure they know nothing about the product or the functional parts but are very good at playing the political game without any content. Those people often manage to stay a long time, a real talent.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Better Finite Difference Boundaries with a Tridiagonal Solver</title>
      <link>https://chasethedevil.github.io/post/better-finite-difference-boundaries-with-a-tridiagonal-solver/</link>
      <pubDate>Thu, 10 Jan 2013 19:19:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/better-finite-difference-boundaries-with-a-tridiagonal-solver/</guid>
      <description>&lt;p&gt;In &lt;a href=&#34;http://www.amazon.com/Pricing-Financial-Instruments-Finite-Difference/dp/0471197602/ref=sr_1_1?ie=UTF8&amp;amp;qid=1357840985&amp;amp;sr=8-1&amp;amp;keywords=tavella+randall&#34;&gt;Pricing Financial Instruments - The Finite Difference Method&lt;/a&gt;, Tavella and Randall explain that boundary conditions using a higher order discretization (for example their &amp;ldquo;BC2&amp;rdquo; boundary condition) can not be solved in one pass with a simple tridiagonal solver, and suggest the use of SOR or some conjugate gradient based solver.&lt;/p&gt;&#xA;&lt;p&gt;It is actually very simple to reduce the system to a tridiagonal system. The more advanced boundary conditions only use 3 adjacent values, just 1 value makes it non tridiagonal, the one in &lt;strong&gt;bold&lt;/strong&gt; is the following matrix representation&lt;/p&gt;</description>
    </item>
    <item>
      <title>Non Central Chi Squared Distribution in Java or Scala</title>
      <link>https://chasethedevil.github.io/post/non-central-chi-squared-distribution-in-java-or-scala/</link>
      <pubDate>Thu, 03 Jan 2013 17:21:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/non-central-chi-squared-distribution-in-java-or-scala/</guid>
      <description>I was looking for an implementation of the non central chi squared distribution function in Java, in order to price bond options under the Cox Ingersoll Ross (CIR) model and compare to a finite difference implementation. It turned out it was not so easy to find existing code for that in a library. I would have imagined that Apache common maths would do this but it does not.&lt;br /&gt;&lt;br /&gt;OpenGamma has a not too bad &lt;a href=&#34;http://docs-static.opengamma.com/1.2.0/java/javadocs/com/opengamma/analytics/math/statistics/distribution/NonCentralChiSquaredDistribution.html&#34;&gt;implementation&lt;/a&gt;. It relies on Apache commons maths for the Gamma function implementation. I looked at what was there in C/C++. There is some old fortran based ports with plenty of goto statements. There is also a nice &lt;a href=&#34;http://www.boost.org/doc/libs/1_36_0/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html&#34;&gt;implementation in the Boost library&lt;/a&gt;. It turns out it is quite easy to port it to Java. One still needs a Gamma function implementation, I looked at Boost implementation of it and it turns out to be very similar to the Apache commons maths one (which is surprisingly not too object oriented and therefore quite fast - maybe they ported it from Boost or from a common source).&lt;br /&gt;&lt;br /&gt;The Boost implementation seems much more robust in general thanks to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The use of complimentary distribution function when the value is over 0.5. One drawback is that there is only one implementation of this, the Benton and Krishnamoorthy one, which is a bit slower than Ding&#39;s method.&lt;/li&gt;&lt;li&gt;Reverts to &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDEQFjAA&amp;amp;url=http%3A%2F%2Fwww.ucs.louisiana.edu%2F~kxk4695%2FCSDA-03.pdf&amp;amp;ei=LKzlUKWvL_K00QX_t4CYBA&amp;amp;usg=AFQjCNFgkeariqMPXVH4LLrO5RRi3nIc0Q&#34;&gt;Benton and Krishnamoorthy&lt;/a&gt; method in high non-centrality cases. Benton and Krishnamoorthy is always very accurate, while Fraser (used by OpenGamma) is &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;ved=0CEIQFjAC&amp;amp;url=http%3A%2F%2Fdspace.uevora.pt%2Frdpc%2Fbitstream%2F10174%2F4635%2F1%2FSpeedAccuracyCEV_FFM%255B1%255D.pdf&amp;amp;ei=Ea3lULLsBaPL0QXKuoHYAw&amp;amp;usg=AFQjCNGkqkA5e_-0n_DATE9BTQVoL9NTkg&amp;amp;cad=rja&#34;&gt;not very precise in general&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;It is interesting to note that both implementations of Ding method are wildly different, Boost implementation has better performance and is simpler (I measured that my Java port is around 50% faster than OpenGamma implementation).&lt;br /&gt;&lt;br /&gt;If only it was simple to commit to open-source projects while working for a software company...</description>
    </item>
    <item>
      <title>Finite Difference Approximation of Derivatives</title>
      <link>https://chasethedevil.github.io/post/finite-difference-approximation-of-derivatives/</link>
      <pubDate>Fri, 21 Dec 2012 12:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/finite-difference-approximation-of-derivatives/</guid>
      <description>&lt;p&gt;A while ago, someone asked me to reference him in a paper of mine because I used formulas of a finite difference approximation of a derivative on a non uniform grid. I was shocked as those formula are very widespread (in countless papers, courses and books) and not far off elementary mathematics.&lt;/p&gt;&#xA;&lt;p&gt;There are however some interesting old papers on the technique. Usually people approximate the first derivative by the central approximation of second order:&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Discontinuity</title>
      <link>https://chasethedevil.github.io/post/a-discontinuity/</link>
      <pubDate>Wed, 12 Dec 2012 20:59:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/a-discontinuity/</guid>
      <description>I am comparing various finite difference schemes on simple problems and am currently stumbling upon a strange discontinuity at the boundary for some of the schemes (Crank-Nicolson, Rannacher, and TR-BDF2) when I plot an American Put Option Gamma using a log grid. It actually is more pronounced with some values of the strike, not all. The amplitude oscillates with the strike. And it does not happen on a European Put, so it&#39;s not a boundary approximation error in the code. It might well be due to the nature of the scheme as schemes based on implicit Euler work (maybe monotonicity preservation is important). This appears on this graph around S=350.&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/-ugmThxi_c_g/UMjh4M8JKAI/AAAAAAAAGKg/Oj-p9_AaNzM/s1600/gamma_american_boundary.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;160&#34; src=&#34;http://1.bp.blogspot.com/-ugmThxi_c_g/UMjh4M8JKAI/AAAAAAAAGKg/Oj-p9_AaNzM/s640/gamma_american_boundary.png&#34; width=&#34;640&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Update December 13, 2012&lt;/b&gt;: after a close look at what was happening. It was after all a boundary issue. It&#39;s more visible on the American because the Gamma is more spread out. But I reproduced it on a European as well.</description>
    </item>
    <item>
      <title>Scala is Mad</title>
      <link>https://chasethedevil.github.io/post/scala-is-mad/</link>
      <pubDate>Wed, 12 Dec 2012 16:07:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/scala-is-mad/</guid>
      <description>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;br /&gt;&lt;br /&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;br /&gt;&lt;br /&gt;And then the quickSort method somehow does not work if invoked on a generic... 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;br /&gt;&lt;br /&gt;In contrast I did not even have to think much to write the Java equivalent. Generics in Scala, while having a nice syntax, are just crazy. This is something that goes beyond generics. Some of the Scala library and syntax is nice, but overall, the IDE integration is still very buggy, and productivity is not higher.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update Dec 12 2012&lt;/b&gt;: here is the actual code (this is kept close to the Java equivalent on purpose):&lt;br /&gt;&lt;pre&gt;object Point {&lt;br /&gt;  def sortAndRemoveIdenticalPoints[T &lt;: Point : ClassManifest](points : Array[T]) : Array[T] = {&lt;br /&gt;      Sorting.quickSort(points.asInstanceOf[Array[Point]])&lt;br /&gt;      val l = new ArrayBuffer[T](points.length)&lt;br /&gt;      var previous = points(0)&lt;br /&gt;      l += points(0)&lt;br /&gt;      for (i &lt;- 1 until points.length) {&lt;br /&gt;        if(math.abs(points(i).value - previous.value)&lt; Epsilon.MACHINE_EPSILON_SQRT) {&lt;br /&gt;          l += points(i)&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      return l.toArray&lt;br /&gt;    }&lt;br /&gt;    return points&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class Point(val value: Double, val isMiddle: Boolean) extends Ordered[Point] {&lt;br /&gt;  def compare(that: Point): Int = {&lt;br /&gt;    return math.signum(this.value - that.value).toInt&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;!-----&gt;&lt;!--:--&gt;&lt;/-&gt;&lt;/:&gt;&lt;/pre&gt;In Java one can just use Arrays.sort(points) if points is a T[]. And the method can work with a subclass of Point.</description>
    </item>
    <item>
      <title>Local Volatility Delta &amp; Dynamic</title>
      <link>https://chasethedevil.github.io/post/local-volatility-delta--dynamic/</link>
      <pubDate>Thu, 29 Nov 2012 12:30:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/local-volatility-delta--dynamic/</guid>
      <description>This will be a very technical post, I am not sure that it will be very understandable by people not familiar with the implied volatility surface.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Something one notices when computing an option price under local volatility using a PDE solver, is how different is the Delta from the standard Black-Scholes Delta, even though the price will be very close for a Vanilla option. In deed, the Finite difference grid will have a different local volatility at each point and the Delta will take into account a change in local volatility as well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But this finite-difference grid Delta is also different from a standard numerical Delta where one just move the initial spot up and down, and takes the difference of computed prices. The numerical Delta will eventually include a change in implied volatility, depending if the surface is sticky-strike (vol will stay constant) or sticky-delta (vol will change). So the numerical Delta produced with a sticky-strike surface will be the same as the standard Black-Scholes Delta. In reality, what happens is that the local volatility is different when the spot moves up, if we recompute it: it is not static. The finite difference solver computes Delta with a static local volatility. If we call twice the finite difference solver with a different initial spot, we will reproduce the correct Delta, that takes into account the dynamic of the implied volatility surface.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here how different it can be if the delta is computed from the grid (static local volatility) or numerically (dynamic local volatility) on an exotic trade:&lt;/div&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/-WW8ZE7urDGE/ULdHKNe_VXI/AAAAAAAAGKQ/JQ5Rd7wQYkk/s1600/static_localvol.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;235&#34; src=&#34;http://3.bp.blogspot.com/-WW8ZE7urDGE/ULdHKNe_VXI/AAAAAAAAGKQ/JQ5Rd7wQYkk/s320/static_localvol.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;This is often why people assume the local volatility model is wrong, not consistent. It is wrong if we consider the local volatility surface as static to compute hedges.&lt;/div&gt;</description>
    </item>
    <item>
      <title>OpenSuse 12.2</title>
      <link>https://chasethedevil.github.io/post/opensuse-12.2/</link>
      <pubDate>Wed, 14 Nov 2012 10:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/opensuse-12.2/</guid>
      <description>&lt;p&gt;After too many upgrades of Ubuntu, and switching from Gnome to KDE and back, my Ubuntu system became behaving strangely in KDE: authorization issues, frequent crashes, pulseaudio and ardour problems. I decided to give another try to OpenSuse, as Linux makes it easy to switch system without losing too much time reinstalling the useful applications.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s been only a few days, but I am pleasantly surprised with OpenSuse. It feels more polished than Kubuntu. I could not point out to a specific feature, but so far I have not had to fiddle with any configuration file, everything works well out of the box. Somehow Kubuntu always felt flaky, read to break at any moment, while OpenSuse feels solid. But they should consider changing the default font settings in KDE to take advantage properly of antialiasing and pretty fonts (it&amp;rsquo;s only a few clicks away, but still the default is not the prettiest).&lt;/p&gt;</description>
    </item>
    <item>
      <title>GPU computing in Finance</title>
      <link>https://chasethedevil.github.io/post/gpu-computing-in-finance/</link>
      <pubDate>Mon, 15 Oct 2012 16:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/gpu-computing-in-finance/</guid>
      <description>&lt;p&gt;Very interesting presentation from Murex about their GPU computing. Some points were:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GPU demand for mostly exotics pricing and greeks&lt;/li&gt;&#xA;&lt;li&gt;Local vol main model for EQD exotics. Local vol calibrated via PDE approach.&lt;/li&gt;&#xA;&lt;li&gt;Markov functional model becoming main model for IRD.&lt;/li&gt;&#xA;&lt;li&gt;Use of local regression instead of Longstaff Schwartz (or worse CVA like sim of sim).&lt;/li&gt;&#xA;&lt;li&gt;philox RNG from DE Shaw. But the presenter does not seem to know RNGs  very well (recommended Brownian Bridge for Mersenne Twister!).&lt;/li&gt;&#xA;&lt;li&gt;An important advantage of GPU is latency. Grid computing only improves throughput but not latency. GPU improves both.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://nvidia.fullviewmedia.com/gtc2010/0923-a7-2032.html&#34;&gt;http://nvidia.fullviewmedia.com/gtc2010/0923-a7-2032.html&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pretty Fonts in Chrome with Linux</title>
      <link>https://chasethedevil.github.io/post/pretty-fonts-in-chrome-with-linux/</link>
      <pubDate>Wed, 12 Sep 2012 18:06:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/pretty-fonts-in-chrome-with-linux/</guid>
      <description>It&#39;s a bit incredible, but in 2012, some linux distros (like Fedora, or Kubuntu) still have trouble to have pretty fonts everywhere. I found a nice tip initially for Google Chrome but that seems to improve more than Chrome: create ~/.fonts.conf with the following:&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;[match target=&#34;font&#34;]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; [edit name=&#34;autohint&#34; mode=&#34;assign&#34;]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [bool]true[/bool]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; [/edit]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; [edit name=&#34;hinting&#34; mode=&#34;assign&#34;]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [bool]true[/bool]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; [/edit]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; [edit mode=&#34;assign&#34; name=&#34;hintstyle&#34;]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; [const]hintslight[/const]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;&amp;nbsp; &amp;nbsp; [/edit]&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: x-small;&#34;&gt;[/match]&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;replace [ and ] with brackets &amp;lt; and &amp;gt;&lt;br /&gt;&lt;br /&gt;Update from 2013 - This can be done system wide, see &lt;a href=&#34;http://chasethedevil.blogspot.com/2013/08/better-fonts-in-fedora-than-in-ubuntu.html&#34;&gt;http://chasethedevil.blogspot.com/2013/08/better-fonts-in-fedora-than-in-ubuntu.html&lt;/a&gt; &lt;/div&gt;&lt;pre&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Fedora 17 vs Ubuntu 12.04</title>
      <link>https://chasethedevil.github.io/post/fedora-17-vs-ubuntu-12.04/</link>
      <pubDate>Wed, 12 Sep 2012 18:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/fedora-17-vs-ubuntu-12.04/</guid>
      <description>I had the bad idea to upgrade to the beta Ubuntu 12.10. Something awfully broke in the upgrade. After too much struggling with apt-get &amp;amp; dpkg, I decided to install Fedora 17.&lt;br /&gt;&lt;br /&gt;Strangely Fedora feels much faster than Ubuntu 12.04 (the boot time especially). Yum seems also faster than apt-get, especially the update part. Also while the Unity dock is not bad (better than gnome shell dock), the Unity dash thing just makes me crazy, the gnome shell activities, while close, are much easier to use.&lt;br /&gt;&lt;br /&gt;But it needs a bit more steps to install, although I had no problem to install &lt;a href=&#34;http://www.if-not-true-then-false.com/2012/fedora-17-nvidia-guide/&#34;&gt;nvidia drivers&lt;/a&gt;,&amp;nbsp;&lt;a href=&#34;http://obiee2go.blogspot.fr/2012/06/oracle-11g-oracle-database-11g.html&#34;&gt;Oracle 11g xe&lt;/a&gt;, Java, MP3, nice fonts, nice icons thanks to the guides &lt;a href=&#34;http://www.mjmwired.net/resources/mjm-fedora-f17.html&#34;&gt;here&lt;/a&gt; and &lt;a href=&#34;http://smashingweb.info/fedora-17-post-installation-guide-things-to-do-after-installing-fedora-17/&#34;&gt;there&lt;/a&gt;. SSD Trim instructions are the same (basically use &#34;discard&#34; instead of &#34;default&#34; in /etc/fstab). I have the most troubles with Oracle: somehow the start script does not work and I currently log in as &#34;oracle&#34; and start&amp;nbsp;/u01/app/oracle/product/11.2.0/xe/config/scripts/startdb.sh from there (after having added the proper .bashrc for this user)&lt;br /&gt;&lt;br /&gt;I even managed the peculiarities of my laptop a similar way as ubuntu: I want Nvidia card when plugged in to a monitor (to be able to use it) and Intel card when not (to be able to use the LCD screen). My solution is to use the boot screen (in reality one just need to restart X11): this amounted to add a &#34;hdmi&#34; in &#34;/etc/grub.d/40_custom&#34; and creating a link to &#34;/etc/rc3.d/S10DriverSelect&#34; the following script (a dirty hack):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;if grep -q hdmi /proc/cmdline&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; if [ -d /usr/lib64/xorg/modules.bak/extensions/nvidia ];&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; then&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; &amp;nbsp; cp -f /etc/X11/xorg.conf.hdmi /etc/X11/xorg.conf&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; &amp;nbsp; mv /usr/lib64/xorg/modules.bak/extensions/nvidia /usr/lib64/xorg/modules/extensions/&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; fi&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; if [ -d /usr/lib64/xorg/modules/extensions/nvidia ];&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; then&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; &amp;nbsp; cp -f /etc/X11/xorg.conf.intel /etc/X11/xorg.conf&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; &amp;nbsp; mv /usr/lib64/xorg/modules/extensions/nvidia /usr/lib64/xorg/modules.bak/extensions/&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;&amp;nbsp; fi&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: Courier New, Courier, monospace; font-size: xx-small;&#34;&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Linux distros are really becoming closer in terms of configuration, LSB has made great progress.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Edit from November 29: After a few weeks, I noticed that the system was quite unstable unfortunately. As a result, I moved back to Ubuntu on my laptop. I am running OpenSuse on my home computer. 1 year later, I am back to Fedora 19, 20 on my desktop - no stability issue, I prefer Gnome over KDE. &lt;/div&gt;</description>
    </item>
    <item>
      <title>Binary Voting</title>
      <link>https://chasethedevil.github.io/post/binary-voting/</link>
      <pubDate>Fri, 07 Sep 2012 17:21:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/binary-voting/</guid>
      <description>How many reports have you had to fill up with a number of stars to choose? How much useless time is spent on figuring the this number just because it is always very ambiguous?&lt;br /&gt;&lt;br /&gt;Some blogger wrote an interesting entry on &lt;a href=&#34;http://davidcelis.com/blog/2012/02/01/why-i-hate-five-star-ratings/&#34;&gt;Why I Hate Five Stars Reviews&lt;/a&gt;. Basically he advocates binary voting instead via like/dislike. Maybe a ternary system via like/dislike/don&#39;t care would be ok too.&lt;br /&gt;&lt;br /&gt;One coworker used to advocate the same for a similar reason: people reading those reports only pay attention to the extremes: the 5 stars or the 0 stars. So if you want to have a voice, you need to express it via 5 or 0, nothing in between.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>Moving The Needle</title>
      <link>https://chasethedevil.github.io/post/moving-the-needle/</link>
      <pubDate>Tue, 21 Aug 2012 21:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/moving-the-needle/</guid>
      <description>&lt;p&gt;These days the expression &amp;ldquo;move the needle&amp;rdquo; is popular where I work. I did not know it was an expression of Steve Jobs.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;“The company starts valuing the great salesmen, because they’re the  ones who can move the needle on revenues, not the product engineers and  designers. So the salespeople end up running the company&amp;hellip; Then the  product guys don’t matter so much, and a lot of them just turn off. It  happened at Apple when John Sculley came in, which was my fault, and  it happened when Ballmer took over at Microsoft. Apple was lucky and it  rebounded, but I don’t think anything will change at Microsoft as long  as Ballmer is running it.”&lt;/p&gt;</description>
    </item>
    <item>
      <title>When solar panels don&#39;t work</title>
      <link>https://chasethedevil.github.io/post/when-solar-panels-dont-work/</link>
      <pubDate>Tue, 21 Aug 2012 21:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/when-solar-panels-dont-work/</guid>
      <description>&lt;p&gt;I thought I would add another word about &lt;a href=&#34;https://chasethedevil.github.io/post/keyboard-porn&#34;&gt;keyboard trends&lt;/a&gt;. A coworker has bought the &lt;a href=&#34;http://search.yahoo.com/r/_ylt=A0oG7hB23TNQAF0AE8FXNyoA;_ylu=X3oDMTE1N201OTNsBHNlYwNzcgRwb3MDMQRjb2xvA2FjMgR2dGlkA1ZJUDEzNF8xOTc-/SIG=12jtgdin3/EXP=1345605110/**http%3a//www.logitech.com/en-us/keyboards/keyboards/k750-keyboard&#34;&gt;Logitech K750&lt;/a&gt;, the one with solar panels to recharge the battery. This keyboard has excellent reviews on many websites, or even on Amazon. I somehow always found the idea a bit strange, it looked like the old solar panel calculators that used to be trendy when I was in primary school.&lt;/p&gt;&#xA;&lt;figure&gt;&lt;img src=&#34;https://www.logitech.com/assets/33482/4/logitech-wireless-solar-keyboard-k750-feature-image.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Well after maybe 6 months of use, he needs to change the battery! It sounds like the solar panels were just a marketing plot after all.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Excel Bulk Entry of Jira using Apache HttpClient &amp; POI</title>
      <link>https://chasethedevil.github.io/post/excel-bulk-entry-of-jira-using-apache-httpclient--poi/</link>
      <pubDate>Tue, 31 Jul 2012 15:40:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/excel-bulk-entry-of-jira-using-apache-httpclient--poi/</guid>
      <description>Where I work, I have to regularly enter my time in JIRA using their crappy portlet interface. Because of French regulations and bad design, one can enter time for at most 1 day at a time. This is very annoying especially to enter vacation days. I decided to spend some time (took me around 2 hours - I thought it would be much more) to enter the time from a local Excel spreadsheet (via with OpenOffice), and use Java to populate JIRA.&lt;br /&gt;&lt;br /&gt;First I had to find out what where the relevant requests. Firefox has several extensions for that, but I found &lt;a href=&#34;https://addons.mozilla.org/en-us/firefox/addon/tamper-data/&#34;&gt;Tamper Data&lt;/a&gt; to be the easiest to work with (&lt;i&gt;hint: use copy/paste in the Tamper Data window to get the full request in a nice format&lt;/i&gt;).&lt;br /&gt;&lt;br /&gt;&lt;a href=&#34;http://hc.apache.org/httpcomponents-client-ga/&#34;&gt;Apache HttpClient&lt;/a&gt; provides an easy way to do HTTP requests and handles cookies almost automatically in Java. Here is the login phase:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&#34;background-color: white; color: #1f1c1b;&#34;&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;List&lt;/span&gt;&lt;/b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;NameValuePair&lt;/span&gt;&lt;/b&gt;&amp;gt; formparams = &lt;b&gt;new&lt;/b&gt; &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;ArrayList&lt;/span&gt;&lt;/b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;&lt;b&gt;&amp;lt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;NameValuePair&lt;/span&gt;&lt;/b&gt;&amp;gt;();&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;os_username&#34;&lt;/span&gt;, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;mouse@thecat&#34;&lt;/span&gt;));&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;os_password&#34;&lt;/span&gt;, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;DEADDEAD&#34;&lt;/span&gt;));&lt;br /&gt;UrlEncodedFormEntity entity = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;UrlEncodedFormEntity&lt;/span&gt;(formparams, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;UTF-8&#34;&lt;/span&gt;);&lt;br /&gt;HttpPost httppost = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;HttpPost&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;https://jira.calypso.com/rest/gadget/1.0/login&#34;&lt;/span&gt;);&lt;br /&gt;httppost.&lt;span style=&#34;color: #644a9b;&#34;&gt;setEntity&lt;/span&gt;(entity);&lt;br /&gt;DefaultHttpClient httpclient = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;DefaultHttpClient&lt;/span&gt;();&lt;br /&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;CookieStore&lt;/span&gt;&lt;/b&gt; cookieStore = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicCookieStore&lt;/span&gt;();&lt;br /&gt;httpclient.&lt;span style=&#34;color: #644a9b;&#34;&gt;setCookieStore&lt;/span&gt;(cookieStore);&lt;br /&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;ResponseHandler&lt;/span&gt;&lt;/b&gt;&amp;lt;&lt;span style=&#34;color: #0057ae;&#34;&gt;byte&lt;/span&gt;[]&amp;gt; handler = &lt;b&gt;new&lt;/b&gt; &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;ResponseHandler&lt;/span&gt;&lt;/b&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;byte&lt; font=&#34;&#34;&gt;[]&amp;gt;() {&lt;br /&gt;&#x9;&lt;b&gt;public&lt;/b&gt; &lt;span style=&#34;color: #0057ae;&#34;&gt;byte&lt;/span&gt;[] &lt;span style=&#34;color: #644a9b;&#34;&gt;handleResponse&lt;/span&gt;(HttpResponse response)&lt;br /&gt;&#x9;&#x9;&#x9;&lt;b&gt;throws&lt;/b&gt; ClientProtocolException, &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;IOException&lt;/span&gt;&lt;/b&gt; {&lt;br /&gt;&#x9;&#x9;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;System&lt;/span&gt;&lt;/b&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;&amp;lt;-&#34;&lt;/span&gt; + response.&lt;span style=&#34;color: #644a9b;&#34;&gt;getStatusLine&lt;/span&gt;());&lt;br /&gt;&#x9;&#x9;HttpEntity entity = response.&lt;span style=&#34;color: #644a9b;&#34;&gt;getEntity&lt;/span&gt;();&lt;br /&gt;&#x9;&#x9;&lt;b&gt;if&lt;/b&gt; (entity != &lt;b&gt;null&lt;/b&gt;) {&lt;br /&gt;&#x9;&#x9;&#x9;&lt;b&gt;return&lt;/b&gt; EntityUtils.&lt;span style=&#34;color: #644a9b;&#34;&gt;toByteArray&lt;/span&gt;(entity);&lt;br /&gt;&#x9;&#x9;} &lt;b&gt;else&lt;/b&gt; {&lt;br /&gt;&#x9;&#x9;&#x9;&lt;b&gt;return&lt;/b&gt; &lt;b&gt;null&lt;/b&gt;;&lt;br /&gt;&#x9;&#x9;}&lt;br /&gt;&#x9;}&lt;br /&gt;};&lt;br /&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;System&lt;/span&gt;&lt;/b&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;-&amp;gt;&#34;&lt;/span&gt; + httppost.&lt;span style=&#34;color: #644a9b;&#34;&gt;getURI&lt;/span&gt;());&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;byte&lt;/span&gt;[] response = httpclient.&lt;span style=&#34;color: #644a9b;&#34;&gt;execute&lt;/span&gt;(httppost, handler); &lt;/byte&lt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;Then a request to our JIRA portlet looks like:&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style=&#34;background-color: white; color: #1f1c1b;&#34;&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;formparams = &lt;b&gt;new&lt;/b&gt; &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;ArrayList&amp;lt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;NameValuePair&lt;/span&gt;&lt;/b&gt;&amp;gt;();&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;inline&#34;&lt;/span&gt;, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;true&#34;&lt;/span&gt;));&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;decorator&#34;&lt;/span&gt;, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;dialog&#34;&lt;/span&gt;));&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;startDate&#34;&lt;/span&gt;, startDate));&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;timeLogged&#34;&lt;/span&gt;, timeLogged));&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;id&#34;&lt;/span&gt;, id));&lt;br /&gt;formparams.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;BasicNameValuePair&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;adjustEstimate&#34;&lt;/span&gt;, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;auto&#34;&lt;/span&gt;));&lt;br /&gt;entity = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;UrlEncodedFormEntity&lt;/span&gt;(formparams, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;UTF-8&#34;&lt;/span&gt;);&lt;br /&gt;httppost = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;HttpPost&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;https://jira.calypso.com/secure/CreateWorklog.jspa&#34;&lt;/span&gt;);&lt;br /&gt;httppost.&lt;span style=&#34;color: #644a9b;&#34;&gt;addHeader&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;Referer&#34;&lt;/span&gt;, &lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;https://jira.calypso.com/browse/&#34;&lt;/span&gt;+ jiraCAL);&lt;br /&gt;httppost.&lt;span style=&#34;color: #644a9b;&#34;&gt;setEntity&lt;/span&gt;(entity);&lt;br /&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;System&lt;/span&gt;&lt;/b&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;out&lt;/span&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;println&lt;/span&gt;(&lt;span style=&#34;color: #bf0303;&#34;&gt;&#34;-&amp;gt;&#34;&lt;/span&gt; + httppost.&lt;span style=&#34;color: #644a9b;&#34;&gt;getURI&lt;/span&gt;());&lt;br /&gt;response = httpclient.&lt;span style=&#34;color: #644a9b;&#34;&gt;execute&lt;/span&gt;(httppost, handler);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;Parsing Excel with Apache POI is a bit annoying, but I kept fixed conventions to make things simple:&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre style=&#34;background-color: white; color: #1f1c1b;&#34;&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;InputStream&lt;/span&gt;&lt;/b&gt; inp = &lt;b&gt;new&lt;/b&gt; &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;FileInputStream&lt;/span&gt;&lt;/b&gt;(file);&lt;br /&gt;HSSFWorkbook wb = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;HSSFWorkbook&lt;/span&gt;(&lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;POIFSFileSystem&lt;/span&gt;(inp));&lt;br /&gt;&lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;List&lt;/span&gt;&lt;/b&gt;&lt;timeline&gt; list = &lt;b&gt;new&lt;/b&gt; &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;ArrayList&lt;/span&gt;&lt;/b&gt;&lt;timeline&gt;();&lt;br /&gt;HSSFSheet sheet = wb.&lt;span style=&#34;color: #644a9b;&#34;&gt;getSheetAt&lt;/span&gt;(&lt;span style=&#34;color: #b08000;&#34;&gt;0&lt;/span&gt;);&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;boolean&lt;/span&gt; isEmpty = &lt;b&gt;false&lt;/b&gt;;&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;int&lt;/span&gt; i = &lt;span style=&#34;color: #b08000;&#34;&gt;0&lt;/span&gt;;&lt;br /&gt;&lt;b&gt;while&lt;/b&gt; (!isEmpty) {&lt;br /&gt;&#x9;HSSFRow row = sheet.&lt;span style=&#34;color: #644a9b;&#34;&gt;getRow&lt;/span&gt;(i);&lt;br /&gt;&#x9;&lt;b&gt;if&lt;/b&gt; (row == &lt;b&gt;null&lt;/b&gt;) { isEmpty=&lt;b&gt;true&lt;/b&gt;; &lt;b&gt;break&lt;/b&gt;;}&lt;br /&gt;&#x9;&lt;br /&gt;&#x9;HSSFCell dateCell = row.&lt;span style=&#34;color: #644a9b;&#34;&gt;getCell&lt;/span&gt;(&lt;span style=&#34;color: #b08000;&#34;&gt;0&lt;/span&gt;);&lt;br /&gt;&#x9;HSSFCell calCell = row.&lt;span style=&#34;color: #644a9b;&#34;&gt;getCell&lt;/span&gt;(&lt;span style=&#34;color: #b08000;&#34;&gt;1&lt;/span&gt;);&lt;br /&gt;&#x9;HSSFCell idCell = row.&lt;span style=&#34;color: #644a9b;&#34;&gt;getCell&lt;/span&gt;(&lt;span style=&#34;color: #b08000;&#34;&gt;2&lt;/span&gt;);&lt;br /&gt;&#x9;HSSFCell percentCell = row.&lt;span style=&#34;color: #644a9b;&#34;&gt;getCell&lt;/span&gt;(&lt;span style=&#34;color: #b08000;&#34;&gt;3&lt;/span&gt;);&lt;br /&gt;&#x9;&lt;b&gt;if&lt;/b&gt; (dateCell == &lt;b&gt;null&lt;/b&gt;) {&lt;br /&gt;&#x9;&#x9;isEmpty = &lt;b&gt;true&lt;/b&gt;;&lt;br /&gt;&#x9;} &lt;b&gt;else&lt;/b&gt; &lt;b&gt;if&lt;/b&gt; (dateCell.&lt;span style=&#34;color: #644a9b;&#34;&gt;getCellType&lt;/span&gt;() == HSSFCell.&lt;span style=&#34;color: #644a9b;&#34;&gt;CELL_TYPE_NUMERIC&lt;/span&gt; &amp;amp;&amp;amp; calCell != &lt;b&gt;null&lt;/b&gt;){&lt;br /&gt;&#x9;&#x9;TimeLine timeLine = &lt;b&gt;new&lt;/b&gt; &lt;span style=&#34;color: #644a9b;&#34;&gt;TimeLine&lt;/span&gt;();&lt;br /&gt;&#x9;&#x9;timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;date&lt;/span&gt; = HSSFDateUtil.&lt;span style=&#34;color: #644a9b;&#34;&gt;getJavaDate&lt;/span&gt;(dateCell.&lt;span style=&#34;color: #644a9b;&#34;&gt;getNumericCellValue&lt;/span&gt;());&lt;br /&gt;&#x9;&#x9;&lt;b&gt;if&lt;/b&gt; (timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;date&lt;/span&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;after&lt;/span&gt;(startDate)&lt;br /&gt;&#x9;&#x9;&#x9;&#x9;&amp;amp;&amp;amp; timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;date&lt;/span&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;before&lt;/span&gt;(endDate)) {&lt;br /&gt;&#x9;&#x9;&#x9;timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;jiraCAL&lt;/span&gt; = calCell.&lt;span style=&#34;color: #644a9b;&#34;&gt;getStringCellValue&lt;/span&gt;();&lt;br /&gt;&#x9;&#x9;&#x9;&lt;b&gt;if&lt;/b&gt; (timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;jiraCAL&lt;/span&gt; != &lt;b&gt;null&lt;/b&gt; &amp;amp;&amp;amp; timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;jiraCAL&lt;/span&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;length&lt;/span&gt;() &amp;gt; &lt;span style=&#34;color: #b08000;&#34;&gt;0&lt;/span&gt;) {&lt;br /&gt;&#x9;&#x9;&#x9;&#x9;timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;id&lt;/span&gt; = &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;Integer&lt;/span&gt;&lt;/b&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;toString&lt;/span&gt;((&lt;span style=&#34;color: #0057ae;&#34;&gt;int&lt;/span&gt;)idCell.&lt;span style=&#34;color: #644a9b;&#34;&gt;getNumericCellValue&lt;/span&gt;());&lt;br /&gt;&#x9;&#x9;&#x9;&#x9;timeLine.&lt;span style=&#34;color: #644a9b;&#34;&gt;percent&lt;/span&gt; =  &lt;b&gt;&lt;span style=&#34;color: #0095ff;&#34;&gt;Integer&lt;/span&gt;&lt;/b&gt;.&lt;span style=&#34;color: #644a9b;&#34;&gt;toString&lt;/span&gt;((&lt;span style=&#34;color: #0057ae;&#34;&gt;int&lt;/span&gt;)percentCell.&lt;span style=&#34;color: #644a9b;&#34;&gt;getNumericCellValue&lt;/span&gt;());&lt;br /&gt;&#x9;&#x9;&#x9;&#x9;list.&lt;span style=&#34;color: #644a9b;&#34;&gt;add&lt;/span&gt;(timeLine);&lt;br /&gt;&#x9;&#x9;&#x9;}&lt;br /&gt;&#x9;&#x9;}&lt;br /&gt;&#x9;}&lt;br /&gt;&#x9;i++;&lt;br /&gt;}&lt;br /&gt;&lt;/timeline&gt;&lt;/timeline&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;color: #0057ae;&#34;&gt;Obviously, this is not clean code, the goal was only to do something quick and dirty to solve my immediate problem.&lt;/span&gt;</description>
    </item>
    <item>
      <title>Keyboard Porn</title>
      <link>https://chasethedevil.github.io/post/keyboard-porn/</link>
      <pubDate>Mon, 30 Jul 2012 10:49:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/keyboard-porn/</guid>
      <description>&lt;p&gt;I have been browsing the web, looking for a nice computer keyboard. Programming is a big part of my job, a comfortable keyboard is therefore important to my daily life.&lt;/p&gt;&#xA;&lt;p&gt;&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/mskeybd.jpg&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;MS Natural keyboard&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;I have some nostalgia for the original Microsoft natural keyboard, the white one with standard home and end keys. When it came out it looked revolutionary. I remember really improving my typing speed on it. The only minor annoyance was the heavy and loud space bar. It&amp;rsquo;s sad that MS does not make those in azerty anymore (I know qwerty is better for programming - I used it while I was working in the US, but it&amp;rsquo;s just too annoying to have a different layout from 95% of the people around). The new MS ergonomic model just looks ugly and scary with all those extra keys.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adaptive Quadrature for Pricing European Option with Heston</title>
      <link>https://chasethedevil.github.io/post/adaptive-quadrature-for-pricing-european-option-with-heston/</link>
      <pubDate>Mon, 25 Jun 2012 12:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/adaptive-quadrature-for-pricing-european-option-with-heston/</guid>
      <description>The Quantlib code to evaluate the Heston integral for European options is quite nice. It proposes &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CGoQFjAD&amp;amp;url=http%3A%2F%2Fwww.math.uni-wuppertal.de%2F%7Ekahl%2Fpublications%2FNotSoComplexLogarithmsInTheHestonModel.pdf&amp;amp;ei=MkDoT8HHOaO_0QXS_6SeCQ&amp;amp;usg=AFQjCNFbAMQBLoKRd0BR_-HC0CkP4zrMtg&#34;&gt;Kahl &amp;amp; Jaeckel&lt;/a&gt; method as well as Gatheral method for the complex logarithm. It also contains expansions where it matters so that the resulting code is very robust. One minor issue is that it does not integrate both parts at the same time, and also does not propose Attari method for the Heston integral that is supposed to be more stable.&lt;br /&gt;&lt;br /&gt;I was surprised to find out that out of the money, short expiry options seemed badly mispriced. In the end I discovered it was just that it required sometimes more than 3500 function evaluations to have an accuracy of 1e-6.&lt;br /&gt;&lt;br /&gt;As this sounds a bit crazy, I thought that Jaeckel log transform was the culprit. In reality, it turned out that it was &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CFMQFjAA&amp;amp;url=http%3A%2F%2Fusers.wpi.edu%2F%7Ewalker%2FMA510%2FHANDOUTS%2Fw.gander%2Cw.gautschi%2CAdaptive_Quadrature%2CBIT_40%2C2000%2C84-101.pdf&amp;amp;ei=U0HoT_HWBeXP0QW23O3xBw&amp;amp;usg=AFQjCNH4KRWMprUvL8yBPKRxO_sVNyc2Pg&#34;&gt;Gauss Lobatto Gander &amp;amp; Gautschi implementation&lt;/a&gt;. I tried the simplest algorithm in &lt;a href=&#34;http://www.ii.uib.no/%7Eterje/Papers/bit2003.pdf&#34;&gt;Espelid improved algorithms&lt;/a&gt;: modsim, an adaptive extrapolated Simpson method, and it was 4x faster for the same accuracy. That plus the fact that it worked out of the box (translated to Java) on my problem was impressive.&lt;br /&gt;&lt;br /&gt;Jaeckel log transform (to change the interval from 0,+inf to 0,1) works well, and seems to offer a slight speedup (10% to 15%) for around ATM options, mid to long term for the same accuracy. Unfortunately, it can also slow down by up to 50% the convergence for more OTM options or shorter expiries. So I am not so sure about its interest vs just cutting off the integration at phi=200.</description>
    </item>
    <item>
      <title>Gnome Shell more stable than Unity on Ubuntu 12.04</title>
      <link>https://chasethedevil.github.io/post/gnome-shell-more-stable-than-unity-on-ubuntu-12.04/</link>
      <pubDate>Thu, 14 Jun 2012 12:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/gnome-shell-more-stable-than-unity-on-ubuntu-12.04/</guid>
      <description>Regularly, the unity dock made some applications inaccessible: clicking on the app icon did not show or start the app anymore, a very annoying bug. This is quite incredible given that this version of Ubuntu is supposed to be long term support.  So I decided to give one more chance to Gnome Shell. Installing it on Ubuntu 12.04 is simple with &lt;a href=&#34;http://www.filiwiese.com/installing-gnome-on-ubuntu-12-04-precise-pangolin/&#34;&gt;this guide&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;To my surprise it is very stable so far. Earlier Gnome Shell versions were not as stable. After installing various extensions (dock especially) it is as usable as Unity for my needs. It seems more responsive as well. I am not really into the Unity new features like HUD. It sounds to me like Ubuntu is making a mistake with Unity compared to Gnome Shell.&lt;br /&gt;&lt;br /&gt;To make an old extension support latest Gnome Shell version, it is sometimes necessary&amp;nbsp; to update&amp;nbsp; the extension metadata with what&#39;s given by &lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;gnome-shell --version&lt;/span&gt;. For the weather extension you can just edit using gedit:&lt;br /&gt;&lt;br /&gt;&lt;blockquote class=&#34;tr_bq&#34;&gt;sudo gedit /usr/share/gnome-shell/extensions/weather@gnome-shell-extensions.gnome.org/metadata.json &lt;/blockquote&gt;</description>
    </item>
    <item>
      <title>John Carmack on Parallelism</title>
      <link>https://chasethedevil.github.io/post/john-carmack-on-parallelism/</link>
      <pubDate>Fri, 27 Apr 2012 06:40:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/john-carmack-on-parallelism/</guid>
      <description>&lt;p&gt;This is the interesting bit&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;Modify some of your utility object code to return new copies instead of  self-mutating, and try throwing const in front of practically every  non-iterator variable you use&amp;rdquo;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/&#34;&gt;http://www.altdevblogaday.com/2012/04/26/functional-programming-in-c/&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Google Galaxy Nexus Sound Quality Is Great</title>
      <link>https://chasethedevil.github.io/post/google-galaxy-nexus-sound-quality-is-great/</link>
      <pubDate>Tue, 27 Mar 2012 00:38:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/google-galaxy-nexus-sound-quality-is-great/</guid>
      <description>&lt;p&gt;Many people are not enthusiastic of this phone sound if you read silly forums. They are wrong! the sound coming out of this thin phone is amazing, at least with high quality headphones. I find the akg q601 incredible with it: much much better than with the old ipod nano or the cowon i7.&lt;/p&gt;&#xA;&lt;p&gt;In general most complaints i have read about the phone were wrong. The battery is ok, the size is great.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Why primitive arrays matter in Java</title>
      <link>https://chasethedevil.github.io/post/why-primitive-arrays-matter-in-java/</link>
      <pubDate>Wed, 29 Feb 2012 10:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/why-primitive-arrays-matter-in-java/</guid>
      <description>&lt;p&gt;In the past, I have seen that one could greatly improve performance of some Monte-Carlo simulation by using as much as possible &lt;code&gt;double[][]&lt;/code&gt; instead of arrays of objects.&lt;/p&gt;&#xA;&lt;p&gt;It was interesting to read &lt;a href=&#34;http://flavor8.com/index.php/2012/02/25/java-performance-autoboxing-and-data-structure-choice-obviously-matter-but-by-how-much/&#34;&gt;this blog post explaining why that happens&lt;/a&gt;: it is all about memory access.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scala Again</title>
      <link>https://chasethedevil.github.io/post/scala-again/</link>
      <pubDate>Mon, 06 Feb 2012 17:52:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>KDE 4.8 finally has a dock</title>
      <link>https://chasethedevil.github.io/post/kde-4.8-finally-has-a-dock/</link>
      <pubDate>Fri, 27 Jan 2012 13:38:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/kde-4.8-finally-has-a-dock/</guid>
      <description>KDE 4.8 finally has a dock: you just have to add the plasma icon tasks. Also the flexibility around ALT+TAB is welcome. With Krusader as file manager, Thunderbird and Firefox for email and web, it is becoming a real nice desktop, but it took a while since the very bad KDE 4.0 release.&lt;br /&gt;&lt;br /&gt;It is easy to install under ubuntu 11.10 through the backports and seems very stable so far.&lt;br /&gt;&lt;br /&gt;Something quite important is to tweak the fonts: use Déjà Vu Sans instead of Ubuntu fonts, use RGB subpixel rendering, use Crisp desktop effects. With those settings, KDE looks very nice. It&#39;s sad that they are not default in Kubuntu.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Update March 2013&lt;/b&gt;:&lt;i&gt; It&#39;s been a while now that it is in the standard Ubuntu repositories and I believe installed by default, one has just to remove the task manager widget add the icon task widget:&lt;/i&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/-_LWYVO4CCKQ/UUry_yhXmQI/AAAAAAAAGSw/JPGByZuWsdw/s1600/snapshot3.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;60&#34; src=&#34;http://1.bp.blogspot.com/-_LWYVO4CCKQ/UUry_yhXmQI/AAAAAAAAGSw/JPGByZuWsdw/s400/snapshot3.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;i&gt;One can also change the settings using a right click (I find useful not to highlight the windows) and it can look like:&lt;/i&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;/div&gt;&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/-VqpLb8rULAQ/UUrz8cPYleI/AAAAAAAAGTA/fs3b8ytQID8/s1600/snapshot4.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;60&#34; src=&#34;http://3.bp.blogspot.com/-VqpLb8rULAQ/UUrz8cPYleI/AAAAAAAAGTA/fs3b8ytQID8/s400/snapshot4.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;</description>
    </item>
    <item>
      <title>List of companies where I have been an employee</title>
      <link>https://chasethedevil.github.io/post/list-of-companies-where-i-have-been-an-employee/</link>
      <pubDate>Wed, 11 Jan 2012 02:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/list-of-companies-where-i-have-been-an-employee/</guid>
      <description>&lt;p&gt;Intern:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Siemens (Berlin)&lt;/li&gt;&#xA;&lt;li&gt;IBM (Boeblingen)&lt;/li&gt;&#xA;&lt;li&gt;Osram Sylvania (Beverly, MA)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Employee:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Cap Gemini (Paris) working for Alcatel&lt;/li&gt;&#xA;&lt;li&gt;Silicomp (Paris) working for Alcatel Nextenso&lt;/li&gt;&#xA;&lt;li&gt;C2labs / one 0 development (San Francisco, CA) working for Whenmobile, Sony Pictures, GoPix, Technorati.&lt;/li&gt;&#xA;&lt;li&gt;Credit Agricole alternative (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Prima solutions (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Esearchvision (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Ulink (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Edifixio (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Horizon (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Darty (Paris)&lt;/li&gt;&#xA;&lt;li&gt;Calypso (Paris)&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Generating random numbers following a given discrete probability distribution</title>
      <link>https://chasethedevil.github.io/post/generating-random-numbers-following-a-given-discrete-probability-distribution/</link>
      <pubDate>Mon, 09 Jan 2012 00:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/generating-random-numbers-following-a-given-discrete-probability-distribution/</guid>
      <description>&lt;p&gt;I have never really thought very much about generating random numbers according to a precise discrete distribution, for example to simulate an unfair dice.&lt;/p&gt;&#xA;&lt;p&gt;In finance, we are generally interested in continuous distributions, where there is typically 2 ways:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the &lt;a href=&#34;http://en.wikipedia.org/wiki/Inverse_transform_sampling&#34;&gt;inverse transform&lt;/a&gt; (usually computed in a numerical way),&lt;/li&gt;&#xA;&lt;li&gt;and the &lt;a href=&#34;http://en.wikipedia.org/wiki/Rejection_sampling&#34;&gt;acceptance-rejection&lt;/a&gt; method, typically the &lt;a href=&#34;http://en.wikipedia.org/wiki/Ziggurat_algorithm&#34;&gt;ziggurat&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The inverse transform is often preferred, because it&amp;rsquo;s usable method for Quasi Monte-Carlo simulations while the acceptance rejection is not.&lt;!-- raw HTML omitted --&gt;&lt;!-- raw HTML omitted --&gt;I would have thought about the simple way to generate random numbers according to a discrete distribution as first described &lt;a href=&#34;http://www.delicious.com/redirect?url=http%3A//blog.sigfpe.com/2012/01/lossless-decompression-and-generation.html&#34;&gt;here&lt;/a&gt;. But establishing a link with &lt;a href=&#34;http://en.wikipedia.org/wiki/Huffman_coding&#34;&gt;Huffman encoding&lt;/a&gt; is brilliant. Some better performing alternative (unrelated to Huffman) is offered &lt;a href=&#34;http://www.keithschwarz.com/darts-dice-coins/&#34;&gt;there&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Quant Interview &amp; Education</title>
      <link>https://chasethedevil.github.io/post/quant-interview--education/</link>
      <pubDate>Wed, 21 Dec 2011 17:37:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/quant-interview--education/</guid>
      <description>Recently, I interviewed someone for a quant position. I was very surprised to find out that someone who did one of the best master in probabilities and finance in France could not solve a very basic probability problem:&lt;br /&gt;&lt;br /&gt;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: left;&#34;&gt;&lt;a href=&#34;http://2.bp.blogspot.com/-64ejCSg9Y8o/TvIHEF4PgwI/AAAAAAAAFio/uxVwdwVnQ54/s1600/Screenshot+at+2011-12-21+17%253A18%253A28.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;43&#34; src=&#34;http://2.bp.blogspot.com/-64ejCSg9Y8o/TvIHEF4PgwI/AAAAAAAAFio/uxVwdwVnQ54/s400/Screenshot+at+2011-12-21+17%253A18%253A28.png&#34; width=&#34;400&#34; /&gt;&lt;/a&gt;&lt;/div&gt;This is accessible to someone with very little knowledge of probabilities &lt;br /&gt;&lt;br /&gt;When I asked this problem around to co-workers (who have all at least a master in a scientific subject), very few could actually answer it properly. Most of the time, I suspect it is because they did not dedicate enough time to do it properly, and wanted to answer it too quickly.&lt;br /&gt;&lt;br /&gt;It was more shocking that someone just out of school, with a major in probabilities could not answer that properly. It raises the question: what is all this education worth?&lt;br /&gt;&lt;br /&gt;The results were not better as soon as the question was not exactly like what students in those masters are used to, like for example, this simple stochastic calculus question:&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/-K9mO8qrp1Ow/TvIKO_MTOSI/AAAAAAAAFiw/igPGRdnFNEo/s1600/Screenshot+at+2011-12-21+17%253A19%253A11.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/-K9mO8qrp1Ow/TvIKO_MTOSI/AAAAAAAAFiw/igPGRdnFNEo/s1600/Screenshot+at+2011-12-21+17%253A19%253A11.png&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;My opinion is that, today in our society, people study for too long. The ideal system for me would be one where people learn a lot in math/physics the first 2 years of university, and then have more freedom in their education, much like a doctorate.&lt;br /&gt;&lt;br /&gt;We still offered the job to this person, because live problem solving is not the most important criteria. Other qualities like seriousness and motivation are much more valuable.</description>
    </item>
    <item>
      <title>Gnome 3 not so crap after all</title>
      <link>https://chasethedevil.github.io/post/gnome-3-not-so-crap-after-all/</link>
      <pubDate>Wed, 30 Nov 2011 18:11:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/gnome-3-not-so-crap-after-all/</guid>
      <description>&lt;p&gt;In a previous post, I was complaining how &lt;a href=&#34;https://chasethedevil.github.io/posts/gnome-3-unity-crap&#34;&gt;bad Gnome 3&lt;/a&gt; was. Since I have installed a real dock: docky, it is now much more usable. I can easily switch / launch applications without an annoying full screen change.&lt;/p&gt;&#xA;&lt;p&gt;In addition I found out that it had a good desktop search (tracker). The ALT+F2 also does some sort of completion, too bad it can not use tracker here as well.&lt;/p&gt;&#xA;&lt;p&gt;So it looks like Gnome 3 + gnome-tweak-tool + docky makes a reasonably good desktop. XFCE does not really fit the bill for me: bad handling of sound, bad default applications, not so good integration with gnome application notifications.&#xA; &#xA;&#xA;&lt;div class=&#34;separator&#34; style=&#34;clear: both; text-align: center;&#34;&gt;&lt;a href=&#34;http://4.bp.blogspot.com/-2DF1jycI5ZU/TtZmvdt2k-I/AAAAAAAAFic/ej8a7g1Gswg/s1600/Screenshot+at+2011-11-30+18%253A20%253A29.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;200&#34; src=&#34;http://4.bp.blogspot.com/-2DF1jycI5ZU/TtZmvdt2k-I/AAAAAAAAFic/ej8a7g1Gswg/s320/Screenshot+at+2011-11-30+18%253A20%253A29.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&#xA;&#xA;&#xA;Now if only I found a way to change this ugly big white scrollbar&amp;hellip;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Good &amp; Popular Algorithms are Simple</title>
      <link>https://chasethedevil.github.io/post/good--popular-algorithms-are-simple/</link>
      <pubDate>Thu, 17 Nov 2011 12:28:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/good--popular-algorithms-are-simple/</guid>
      <description>I recently tried to minimise a function according to some constraints. One popular method to minimise a function in several dimensions is &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CB0QFjAA&amp;amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FNelder%25E2%2580%2593Mead_method&amp;amp;ei=PfHETsKYDdG9sAb_q935Cw&amp;amp;usg=AFQjCNEVD7lMV4buMbVCJ3fuiyupPA6B1w&#34;&gt;Nelder-Mead Simplex&lt;/a&gt;. It is quite simple, so simple that I programmed it in Java in 1h30, including a small design and a test. It helped that the original paper from Nelder-Mead is very clear:&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/-glZ52IB0SkA/TsTxF4VmyFI/AAAAAAAAFhw/zSDQ0Het9MU/s1600/neldermeadalgo.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;184&#34; src=&#34;http://3.bp.blogspot.com/-glZ52IB0SkA/TsTxF4VmyFI/AAAAAAAAFhw/zSDQ0Het9MU/s320/neldermeadalgo.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;However the main issue is that it works only for unconstrained problems. Nelder and Mead suggested to add a penalty, but in practice this does not work so well. For constrained problems, there is an adaptation of the original idea by Box (incredible name for a constrained method) that he called &lt;a href=&#34;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CB4QFjAA&amp;amp;url=http%3A%2F%2Fcomjnl.oxfordjournals.org%2Fcontent%2F8%2F1%2F42.full.pdf&amp;amp;ei=EvLETqz6LcTvsgbN4I2ADA&amp;amp;usg=AFQjCNHq6JD1ik4rTLO4a1v4G9adbGMRzQ&#34;&gt;the Complex method&lt;/a&gt;, a deliberate pun to the Nelder-Mead Simplex method. The basic idea is to reset the trial point near the fixed boundary if it goes outside. Now this took me much longer to program, as the paper is not as clear, even if the method is still relatively simple. But worst, after a day of deciphering the paper and programming the complex method, I find out that it does not works so well: it does not manage to minimise a simple multidimensional quadratic with a simple bound constraint: f(X)=sum(X)^2 with X &amp;gt;= 0 where X is an N-dimensional vector. In the end, I don&#39;t want to work with such a simple function, but it is a good simple test to see if the method is really working or not. Here is how the function looks with N=2:&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/-ncMKzKcYdtA/TsT_TEyNHDI/AAAAAAAAFiA/er1pQWNcHXc/s1600/quadfull.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;320&#34; src=&#34;http://2.bp.blogspot.com/-ncMKzKcYdtA/TsT_TEyNHDI/AAAAAAAAFiA/er1pQWNcHXc/s320/quadfull.png&#34; width=&#34;302&#34; /&gt;&lt;/a&gt;&lt;/div&gt;And if we restrict to x,y &amp;gt;= 0 it becomes:&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/-msyZ9eQ7GnM/TsT_d36SD7I/AAAAAAAAFiI/Kt4QBwjsAE8/s1600/quadpart.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;304&#34; src=&#34;http://1.bp.blogspot.com/-msyZ9eQ7GnM/TsT_d36SD7I/AAAAAAAAFiI/Kt4QBwjsAE8/s320/quadpart.png&#34; width=&#34;320&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I suspected an error in my program, so I decided to try with scilab, that has also the Box method as part of their &lt;a href=&#34;http://help.scilab.org/docs/5.3.3/en_US/neldermead.html&#34;&gt;neldermead_search&lt;/a&gt; functionality. Scilab also failed to compute the minimum in 8 dimensions of my simple quadratic. &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/-vO6JhSwv3MU/TsT1ge1H96I/AAAAAAAAFh4/DTnsYjnMeHE/s1600/neldermeadalgo1.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;320&#34; src=&#34;http://4.bp.blogspot.com/-vO6JhSwv3MU/TsT1ge1H96I/AAAAAAAAFh4/DTnsYjnMeHE/s320/neldermeadalgo1.png&#34; width=&#34;265&#34; /&gt;&lt;/a&gt;&lt;/div&gt;I tried various settings, without ever obtaining a decent result (I expect to find a value near 0).&lt;br /&gt;&lt;br /&gt;There is another algorithm that can find a global minimum, also very popular: the &lt;a href=&#34;http://www.icsi.berkeley.edu/%7Estorn/TR-95-012.pdf&#34;&gt;Differential Evolution&lt;/a&gt;. At first, being a genetic algorithm, you would think it would be complicated to write. But no, the main loop is around 20 lines.&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/-cNeeYo8EQeQ/TsUB7Ek6rQI/AAAAAAAAFiQ/PTc4qwwAa7E/s1600/dealgo.png&#34; imageanchor=&#34;1&#34; style=&#34;margin-left: 1em; margin-right: 1em;&#34;&gt;&lt;img border=&#34;0&#34; height=&#34;320&#34; src=&#34;http://4.bp.blogspot.com/-cNeeYo8EQeQ/TsUB7Ek6rQI/AAAAAAAAFiQ/PTc4qwwAa7E/s320/dealgo.png&#34; width=&#34;297&#34; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Those 20 lines are a bit more difficult than Nelder-Mead, but still, when I saw that, I understood that &#34;this is a classic algorithm&#34;. And it does work with constraints easily. How to do this is explained well in K. Price book &#34;Differential Evolution&#34;, and takes only a few lines of code. Here is the result I got in dimension 29:&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; font-size: x-small;&#34;&gt;dim=29 min=1.2601854176573729E-12 genMax=412 x=[3.340096901536317E-8, 8.889252404343621E-8, 7.163904251807348E-10, 9.71847877381699E-9, 2.7423324674150668E-8, 2.4022269439114537E-9, 1.7336434478718816E-11, 7.244238163901778E-9, 1.0013136274729337E-8, 7.412154679865083E-9, 5.4694460144807974E-9, 2.3682413086417524E-9, 4.241739250073559E-7, 4.821920889534676E-10, 2.115396281722523E-9, 8.750883007882899E-8, 2.512011485133975E-9, 4.811507109129279E-9, 1.0752997894113096E-7, 5.120475258343548E-9, 8.404448964497456E-9, 4.1062290228305595E-9, 1.7030766521603753E-8, 5.589430643552073E-9, 8.237098544820173E-10, 3.5796523161196554E-9, 5.186299547466997E-9, 2.430326342762937E-7, 5.493850433494286E-9]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It works well, although there is quite a bit of parameters. I noticed that the strategy was especially important.</description>
    </item>
    <item>
      <title>Gnome 3, Unity, Crap</title>
      <link>https://chasethedevil.github.io/post/gnome-3-unity-crap/</link>
      <pubDate>Wed, 17 Aug 2011 19:09:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/gnome-3-unity-crap/</guid>
      <description>&lt;p&gt;After the upgrate to Ubuntu 11.04 I was directly on Unity. Having a dock on the left side is nice, but unfortunately, it has various bugs which makes it sometimes annoying. Also the menu on top like Mac Os X is not a bad idea, but it breaks many apps (for example Picasa). Then there is the scrollbar insanity, it&amp;rsquo;s almost impossible to click on to scroll, and again breaks in some apps (for example Eclipse). Fortunately one can disable all of that and go back to the old Gnome 2.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Carmack &amp; GPGPU programming</title>
      <link>https://chasethedevil.github.io/post/carmack--gpgpu-programming/</link>
      <pubDate>Sun, 14 Aug 2011 10:20:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/carmack--gpgpu-programming/</guid>
      <description>&lt;p&gt;Finally someone who shares the same opinion on the current state of GPGPU programming.&lt;/p&gt;&#xA;&lt;p&gt;John Carmack: On the other hand, we have converted all of our offline processing stuff to ray tracing. For years, the back-end MegaTexture generation for Rage was done with&amp;hellip; we had a GPGPU cluster with NVIDIA cards and it was such a huge pain to keep. It was an amazing pain where one system would be having heat problems and would be behaving weird even though we thought they had identical drivers. Something would always be wrong with render farm 12, and whenever we wanted to put in new features it was like “Okay, writing new fragment programs to go into this.” Now, granted I did this just when CUDA was in its infancy. If I did re-implement it with OpenCL or CUDA we wouldn’t have some of these problems, but when I converted all these over to ray tracing there was a number of things that got a lot better. Things that we deal with, for example shadows and reflections that have to be approximated, and were so used to doing with rasterization&amp;hellip; we sometimes forget how big of hacks these are. To be able to say I really just want that ray, and tell me what it hit; not do a projection with feathering shadowed edges and whatever the heck else we’re doing there, so much of the code got so much easier. If it’s a choice of&amp;hellip; now that we have these awesome multi-core x86 CPUs where we can get 24 threads in commodity boxes&amp;hellip; it’s true that one GPU card can do more ray tracing than one 24 thread x86 box, but it’s not multiples more and if it’s just a matter of buying more $2000 boxes, it makes the development, maintenance, and upkeep much better. While everyone in high performance computing is all “rah-rah” GPUs right now, I’ve come full circle back around to saying the fact that we can get massive amounts of x86 cores and threads&amp;hellip; it wont win on FLOPS/watt or FLOPS/volume, but in terms of results per developer hour it is much, much better.&lt;/p&gt;</description>
    </item>
    <item>
      <title>exp(y*log(x)) Much Faster than Math.pow(x,y)</title>
      <link>https://chasethedevil.github.io/post/expylogx-much-faster-than-math.powxy/</link>
      <pubDate>Fri, 08 Apr 2011 23:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Best Headphones Ever?</title>
      <link>https://chasethedevil.github.io/post/best-headphones-ever/</link>
      <pubDate>Wed, 06 Apr 2011 13:08:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/best-headphones-ever/</guid>
      <description>&lt;p&gt;I just miraculously received some AKG Q701 headphones. I never tried really high end headphones before those. I was used to my Sennheiser HD555, which I thought were quite good already.&lt;/p&gt;&#xA;&lt;p&gt;I always thought there was not much difference between let&amp;rsquo;s say a $100 headphone and a $500 one, and that only real audiophiles would be able notice the difference: people like Jake who can distinguish artefacts in 320kbps mp3, but not people like me. I was wrong. Those headphones make a real difference, everything seems very clear, and it doesn&amp;rsquo;t feel like listening music through headphones at all, it is much closer to a good hi-fi stereo sound on the ear.&lt;/p&gt;</description>
    </item>
    <item>
      <title>SIMD and Mersenne-Twister</title>
      <link>https://chasethedevil.github.io/post/simd-and-mersenne-twister/</link>
      <pubDate>Sat, 05 Feb 2011 13:18:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>XORWOW L&#39;ecuyer TestU01 Results</title>
      <link>https://chasethedevil.github.io/post/xorwow-lecuyer-testu01-results/</link>
      <pubDate>Wed, 12 Jan 2011 20:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/xorwow-lecuyer-testu01-results/</guid>
      <description>&lt;div style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&lt;div style=&#34;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&#34;&gt;Nvidia uses XorWow random number generator in its CURAND library. It is a simple and fast random number generator with a reasonably long period. It can also be parallelized relatively easily. Nvidia suggests it passes L&#39;Ecuyer TestU01, but is not very explicit about it. So I&#39;ve decided to see how it performed on TestU01.&lt;/div&gt;&lt;div style=&#34;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&#34;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&#34;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&#34;&gt;I found very simple to test a new random number generator on TestU01, the documentation is great and the examples helpful. Basically there is just a simple C file to create &amp;amp; compile &amp;amp; run.&lt;/div&gt;&lt;div style=&#34;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&#34;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&#34;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&#34;&gt;XORWOW passes the SmallCrush battery, and according to Marsaglia, it also passes DieHard. But it fails on 1 test in Crush and 3 in BigCrush. By comparison, Mersenne-Twister fails on 2 tests in Crush and 2 in BigCrush. Here are the results of the failures:&lt;/div&gt;&lt;div style=&#34;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&#34;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&#34;font-family: inherit;&#34;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;========= Summary results of Crush =========&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestU01 1.2.3&lt;br /&gt;&amp;nbsp;Generator:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Xorwow&lt;br /&gt;&amp;nbsp;Number of statistics:&amp;nbsp; 144&lt;br /&gt;&amp;nbsp;Total CPU time:&amp;nbsp;&amp;nbsp; 00:50:15.92&lt;br /&gt;&amp;nbsp;The following tests gave p-values outside [0.001, 0.9990]:&lt;br /&gt;&amp;nbsp;(eps&amp;nbsp; means a value &amp;lt; 1.0e-300):&lt;br /&gt;&amp;nbsp;(eps1 means a value &amp;lt; 1.0e-15):&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p-value&lt;br /&gt;&amp;nbsp;----------------------------------------------&lt;br /&gt;&amp;nbsp;72&amp;nbsp; LinearComp, r = 29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 - eps1&lt;br /&gt;&amp;nbsp;----------------------------------------------&lt;br /&gt;&amp;nbsp;All other tests were passed&lt;/div&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;========= Summary results of BigCrush =========&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;Version:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TestU01 1.2.3&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;Generator:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Xorwow&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;Number of statistics:&amp;nbsp; 160&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;Total CPU time:&amp;nbsp;&amp;nbsp; 06:12:38.79&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;The following tests gave p-values outside [0.001, 0.9990]:&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;(eps&amp;nbsp; means a value &amp;lt; 1.0e-300):&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;(eps1 means a value &amp;lt; 1.0e-15):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Test&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p-value&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;----------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp; 7&amp;nbsp; CollisionOver, t = 7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.6e-6&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;27&amp;nbsp; SimpPoker, r = 27&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; eps&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;81&amp;nbsp; LinearComp, r = 29&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 - eps1&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;----------------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&#34;&gt;&amp;nbsp;All other tests were passed&lt;/span&gt;</description>
    </item>
    <item>
      <title>The CUDA Performance Myth</title>
      <link>https://chasethedevil.github.io/post/the-cuda-performance-myth/</link>
      <pubDate>Mon, 03 Jan 2011 16:07:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Firefox 4 Is Great</title>
      <link>https://chasethedevil.github.io/post/firefox-4-is-great/</link>
      <pubDate>Wed, 22 Dec 2010 16:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/firefox-4-is-great/</guid>
      <description>&lt;p&gt;I temporarily &lt;a href=&#34;https://chasethedevil.github.io/posts/bye-bye-firefox&#34;&gt;abandonned Firefox&lt;/a&gt; for Chrome/Chromium. I am now back at using Firefox as Firefox 4 is as fast or faster than Chrome and seems more stable, especially under linux. Also it does not send anything to Google and there is bookmark sync independently of Google.&lt;/p&gt;&#xA;&lt;p&gt;I am impressed that Mozilla managed to improve Firefox that much.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Another Look at Java Matrix Libraries</title>
      <link>https://chasethedevil.github.io/post/another-look-at-java-matrix-libraries/</link>
      <pubDate>Mon, 29 Nov 2010 12:45:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/another-look-at-java-matrix-libraries/</guid>
      <description>&lt;p&gt;A while ago, &lt;a href=&#34;https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-enum-is-evil/</link>
      <pubDate>Thu, 12 Aug 2010 17:32:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/a-very-interesting-feature-of-scala/</link>
      <pubDate>Sat, 07 Aug 2010 12:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Street Fighting Mathematics Book</title>
      <link>https://chasethedevil.github.io/post/street-fighting-mathematics-book/</link>
      <pubDate>Wed, 28 Jul 2010 14:25:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/street-fighting-mathematics-book/</guid>
      <description>&lt;p&gt;The MIT has a downloadable book on basic mathematics: &lt;a href=&#34;http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&amp;amp;tid=12156&#34;&gt;Street Fighting Mathematics&lt;/a&gt;. I liked the part focused on the geometrical approach. It reminded me of the early greek mathematics.&lt;/p&gt;&#xA;&lt;p&gt;Overall it does look like a very American approach to Maths: answering a multiple choices questions test by elimination. But it is still an interesting book.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Bye Bye Firefox</title>
      <link>https://chasethedevil.github.io/post/bye-bye-firefox/</link>
      <pubDate>Wed, 21 Jul 2010 15:30:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/bye-bye-firefox/</guid>
      <description>&lt;p&gt;I have been a long user of Firefox, mostly thanks to the adblock extension. But recently, Firefox decided to change the way arrows work on the web pages, they don&amp;rsquo;t make the page scroll anymore. Meanwhile Chrome has now a good adblock plugin (that filters ads on load, not after load like it use to be) and is really much much faster than Firefox. So there is no more reason not to use it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Diffusion Limited Aggregation Applet</title>
      <link>https://chasethedevil.github.io/post/diffusion-limited-aggregation-applet/</link>
      <pubDate>Wed, 09 Jun 2010 14:05:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java--3d-surface/</link>
      <pubDate>Fri, 18 Dec 2009 16:07:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/double-is-fine/</link>
      <pubDate>Thu, 26 Nov 2009 14:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>The Pain of Java Matrix Libraries</title>
      <link>https://chasethedevil.github.io/post/the-pain-of-java-matrix-libraries/</link>
      <pubDate>Thu, 26 Nov 2009 09:17:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/the-pain-of-java-matrix-libraries/</guid>
      <description>&lt;p&gt;Looking for a good Java Matrix (and actually also math) library, I was a bit surprised to find out there does not seem to be any really serious one still maintained.&lt;/p&gt;&#xA;&lt;p&gt;Sure, there is &lt;a href=&#34;%22http://commons.apache.org/math/&#34;&gt;Apache Commons Math&lt;/a&gt;, but it is still changing a lot, and it is not very performance optimized yet, while it has been active for several years already. There is also Java3D, it does Matrix through GMatrix, but not much linear algebra and if you look at their implementation, it is very basic, not performance oriented.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Java Calendar Is Broken On JVM Upgrade</title>
      <link>https://chasethedevil.github.io/post/java-calendar-is-broken-on-jvm-upgrade/</link>
      <pubDate>Wed, 19 Aug 2009 13:47:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Implicit Finite Differences Method For Pricing Barrier Option</title>
      <link>https://chasethedevil.github.io/post/implicit-finite-differences-method-for-pricing-barrier-option/</link>
      <pubDate>Mon, 17 Aug 2009 12:04:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/implicit-finite-differences-method-for-pricing-barrier-option/</guid>
      <description>&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://3.bp.blogspot.com/_9RyqGT46Fbk/Sokrd-84xhI/AAAAAAAAERE/-gs3_MMw0oo/s1600-h/implicit_method_barrier_option_html_m531cf9ea.jpg&#34;&gt;&lt;img style=&#34;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 74px;&#34; src=&#34;http://3.bp.blogspot.com/_9RyqGT46Fbk/Sokrd-84xhI/AAAAAAAAERE/-gs3_MMw0oo/s320/implicit_method_barrier_option_html_m531cf9ea.jpg&#34; border=&#34;0&#34; alt=&#34;&#34;id=&#34;BLOGGER_PHOTO_ID_5370871824730605074&#34; /&gt;&lt;/a&gt;&lt;br /&gt;While trying to price a simple knock down and out barrier option, I encountered several difficulties I did not expect with the implicit finite differences method. The explicit method has less issues with barrier options pricing. I will show here what the tricky parts are and why explicit seems simpler in this case.&lt;br /&gt;&lt;br /&gt;The full article is &lt;a href=&#34;http://www.31416.org/static/implicitbarrier/implicit_method_barrier_option.pdf&#34;&gt;here (pdf)&lt;/a&gt; or &lt;a href=&#34;http://www.31416.org/static/implicitbarrier/implicit_method_barrier_option.html&#34;&gt;here (html)&lt;/a&gt; (the later is not very well formatted).&lt;br /&gt;&lt;br /&gt;Algorithms used in this article can be found at &lt;a href=&#34;http://code.google.com/p/javamc/&#34;&gt;http://code.google.com/p/javamc/&lt;/a&gt;</description>
    </item>
    <item>
      <title>Pulseaudio Nightmares - Pure ALSA to the Rescue</title>
      <link>https://chasethedevil.github.io/post/pulseaudio-nightmares---pure-alsa-to-the-rescue/</link>
      <pubDate>Sat, 27 Jun 2009 18:19:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/pulseaudio-nightmares---pure-alsa-to-the-rescue/</guid>
      <description>In the latest stable Ubuntu (9.04), pulseaudio still does not work reliably on my hardware (intel HDA with digital SPDIF out). I upgraded to 9.10 and had even more problems. Sound always worked on boot, but often broke down after a while. And I could not find easy ways to make it work other than rebooting... Killing/restarting pulseaudio, looking at the processes using snd did not work.&lt;br /&gt;&lt;br /&gt;One thing works wonderfully, pure ALSA. To have multilple apps sharing ALSA, I just use dmix. As I use digital out, there is no mixer, but ALSA can provide one through softvol. It works really well. ALSA is already not that simple to configure/setup properly, but with pulseaudio on top, welcome to your worst configuration nightmares.&lt;br /&gt;&lt;br /&gt;Here is the .asoundrc I use:&lt;br /&gt;&lt;pre&gt; &lt;br /&gt;pcm.amix {&lt;br /&gt;   type dmix&lt;br /&gt;   ipc_key 50557&lt;br /&gt;   slave {&lt;br /&gt;       pcm &#34;hw:0,1&#34;&lt;br /&gt;       period_time 0&lt;br /&gt;       period_size 1024&lt;br /&gt;       buffer_size 8192&lt;br /&gt;   }&lt;br /&gt;   bindings {&lt;br /&gt;       0 0&lt;br /&gt;       1 1&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;pcm.softvol {&lt;br /&gt;    type            softvol&lt;br /&gt;    slave {&lt;br /&gt;        pcm         &#34;amix&#34;      #redirect the output to dmix (instead of &#34;hw:0,0&#34;)&lt;br /&gt;    }&lt;br /&gt;    control {&lt;br /&gt;        name        &#34;PCM&#34;       #override the PCM slider to set the softvol volume level globally&lt;br /&gt;        card        0&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;pcm.!default {&lt;br /&gt;    type            plug&lt;br /&gt;    slave.pcm       &#34;softvol&#34;   #make use of softvol&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description>
    </item>
    <item>
      <title>Java int Overflow Behavior</title>
      <link>https://chasethedevil.github.io/post/java-int-overflow-behavior/</link>
      <pubDate>Mon, 15 Jun 2009 16:15:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/static-fields-and-inheritance/</link>
      <pubDate>Mon, 15 Jun 2009 16:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/benchmarking-languages-is-difficult/</link>
      <pubDate>Wed, 03 Jun 2009 16:53:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/cholesky--jakarta-commons-math/</link>
      <pubDate>Fri, 15 May 2009 19:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Hull American Option Price Fallacies</title>
      <link>https://chasethedevil.github.io/post/hull-american-option-price-fallacies/</link>
      <pubDate>Fri, 15 May 2009 16:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/hull-american-option-price-fallacies/</guid>
      <description>&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/Sg13q_LZDrI/AAAAAAAADNE/WHy0J8iNZoY/s1600-h/hull_american_r04_v20_q02_p49.png&#34;&gt;&lt;img style=&#34;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 240px;&#34; src=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/Sg13q_LZDrI/AAAAAAAADNE/WHy0J8iNZoY/s320/hull_american_r04_v20_q02_p49.png&#34; alt=&#34;&#34; id=&#34;BLOGGER_PHOTO_ID_5336052713901330098&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;&lt;br /&gt;Hull says American put is best exercised immediately and american call is optimal at expiry like a european. Is this really true?&lt;br /&gt;&lt;br /&gt;At first it seems really clever and model show clearly this. But if we change the market assumptions only a tiny bit, everything falls down.&lt;br /&gt;&lt;br /&gt;I could not detail everything in a blog post so I created a &lt;a href=&#34;http://31416.appspot.com/static/hullamerican/hull_american_price.html&#34;&gt;static web page about it&lt;/a&gt;. Everything was produced in Java using algorithm found in popular books and graphs through JFreeChart.</description>
    </item>
    <item>
      <title>On Quasi Random Numbers - MersenneTwister vs Sobol precision in Asian Option Pricing</title>
      <link>https://chasethedevil.github.io/post/on-quasi-random-numbers---mersennetwister-vs-sobol-precision-in-asian-option-pricing/</link>
      <pubDate>Tue, 05 May 2009 15:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/on-quasi-random-numbers---mersennetwister-vs-sobol-precision-in-asian-option-pricing/</guid>
      <description>While starting a side project that does Monte Carlo pricing in Java (&lt;a href=&#34;http://code.google.com/p/javamc/&#34;&gt;http://code.google.com/p/javamc/&lt;/a&gt; - nothing yet there I am waiting for Mercurial repository support), I wondered what was the importance of quasi random numbers versus more regular pseudo random numbers in Monte Carlo simulations.&lt;br /&gt;&lt;br /&gt;This brought me to read more carefully several books about Monte Carlo and Finance (&lt;a href=&#34;http://www.amazon.com/Complete-Guide-Option-Pricing-Formulas/dp/0786312408&#34;&gt;Haug Option Pricing&lt;/a&gt;, &lt;a href=&#34;http://www.amazon.com/Primer-Monte-Carlo-Method/dp/084938673X&#34;&gt;Sobol Primer on Monte Carlo&lt;/a&gt;, and &lt;a href=&#34;http://www.amazon.com/Financial-Engineering-Stochastic-Modelling-Probability/dp/0387004513&#34;&gt;Glasserman Monte Carlo Methods in Finance Engineering&lt;/a&gt;). I had quite a hard time to understand why the dimension of the quasi random generator was so important to price an asian option. Intuitively I thought the averaging points of an asian option were all on the same path, so they should be using the same random generator. This is very wrong as one does not care about the path in the first place but just in simulating each point in the average (using the regular black and scholes hypothesis). Finding the estimation for the average on the given points forces to use independent random generators for each point, because we want to approximate the estimation by the sum over those random points for each point.&lt;br /&gt;&lt;br /&gt;There is another simple argument to explain why independence of the random generators is so important. If we use the same generator for each point, then each point will move exactly the same way at each simulation. The average of those point will therefore behave exactly the same way as if there was only 1 point using the same generator. And we don&#39;t price an asian anymore but just a regular vanilla option.&lt;br /&gt;&lt;br /&gt;Using a pseudo random generator, one does not see the problem of dimension, because we can create N independent dimensions by just taking numbers N by N on a pseudo random generator. So effectively having 1 or N dimensions is the same on a pseudo random generator.&lt;br /&gt;&lt;br /&gt;Still I wrote a small test to see if a 1D quasi random generator was so bad when simulating N dimensions (taking values N by N on the quasi random generator). Here are the results:&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;MersenneTwister vs MersenneTwister on 10D asian:&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:43:51,111  INFO MonteCarloSimulationTest:114 - 867970000 -- expPrice=0.978958644504466&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:43:51,428  INFO MonteCarloSimulationTest:120 - 314619000 -- expPrice=0.9733220318545934&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:43:51,430  INFO MonteCarloSimulationTest:122 - relative difference=-0.005757763804951897&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new; font-weight: bold;&#34;&gt;can be as high as 2%&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;Sobol vs MersenneTwister on 10D asian:&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:48:46,909  INFO MonteCarloSimulationTest:115 - 980209000 -- expPrice=0.9895032774079221&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:48:47,345  INFO MonteCarloSimulationTest:121 - 433685000 -- expPrice=0.9790264042895171&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:48:47,348  INFO MonteCarloSimulationTest:123 - relative difference=-0.010588012548932534&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new; font-weight: bold;&#34;&gt;about 1% it is actually bounded by MersenneTwister precision.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;Sobol vs Sobol1D on 10D asian:&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:47:08,614  INFO MonteCarloSimulationTest:115 - 717444000 -- expPrice=0.8810736428068913&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:47:08,925  INFO MonteCarloSimulationTest:121 - 308499000 -- expPrice=0.9791449305055208&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new;&#34;&gt;14:47:08,927  INFO MonteCarloSimulationTest:123 - relative difference=0.11130884290920073&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family: courier new; font-weight: bold;&#34;&gt;about 10% and stays that way even when increasing number of simulations.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using an asian rate with 10 points, we see that Sobol1D will always give a very bad estimate, no matter the number of simulations. While Sobol used properly will give (much) better precision for less iterations. So even though there is the word random in quasi random, the numbers are very far from being random or even behaving like random numbers. It helped me to read about Van der Corput and Halton numbers to really understand quasi random numbers.</description>
    </item>
    <item>
      <title>Java Logging Still Crap in 2009</title>
      <link>https://chasethedevil.github.io/post/java-logging-still-crap-in-2009/</link>
      <pubDate>Fri, 24 Apr 2009 15:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/bachelier-vs.-black/</link>
      <pubDate>Mon, 23 Mar 2009 17:58:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Linux Audio State = Miserable</title>
      <link>https://chasethedevil.github.io/post/linux-audio-state--miserable/</link>
      <pubDate>Thu, 19 Mar 2009 12:39:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/linux-audio-state--miserable/</guid>
      <description>&lt;p&gt;There are lots of programs for playing MP3 under linux, a few dealing decently with big libraries. But when you start looking for a program that does crossfade well and manage big libraries easily - there is nothing.&lt;/p&gt;&#xA;&lt;p&gt;Rhythmbox does some crossfade, but crashes when you move manually in the song. Audacious does some crossfade but regularly crashes with crossfade plugin.&lt;/p&gt;&#xA;&lt;p&gt;The real alternative are AIMP2 or Foobar2000 in Wine. It is quite incredible that you can have good solid crossfade in wine and not natively in Linux.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Senior Developers Team Productivity X4 (from MS Research Paper)</title>
      <link>https://chasethedevil.github.io/post/senior-developers-team-productivity-x4-from-ms-research-paper/</link>
      <pubDate>Tue, 10 Feb 2009 10:44:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/the-end-of-rings-around-plain-java---a-better-concurrency-test/</guid>
      <description>&lt;p&gt;In my &lt;a href=&#34;https://chasethedevil.github.io/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>Object Oriented Analysis And Design with Applications Book Review</title>
      <link>https://chasethedevil.github.io/post/object-oriented-analysis-and-design-with-applications-book-review/</link>
      <pubDate>Thu, 08 Jan 2009 17:24:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/object-oriented-analysis-and-design-with-applications-book-review/</guid>
      <description>&lt;p&gt;A while ago, I had a comment from someone implying I knew nothing about OO programming because I had not mentioned (and therefore read) &lt;em&gt;Object Oriented Analysis And Design with Applications&lt;/em&gt; from G. Booch. I was intrigued by such a silly comment and decided to look at this book that was considered as the bible of OOP.&lt;/p&gt;&#xA;&lt;p&gt;Well, I don&amp;rsquo;t find it that good! But I don&amp;rsquo;t find the bible particularly good either. I like &lt;a href=&#34;http://archive.eiffel.com/doc/oosc/&#34;&gt;B. Meyer Object Oriented Software Construction&lt;/a&gt; book much more, because it is more practical, more in touch with realities while pointing at the real important problems like:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Running Rings Around Plain Java - The Killer Code</title>
      <link>https://chasethedevil.github.io/post/running-rings-around-plain-java---the-killer-code/</link>
      <pubDate>Thu, 08 Jan 2009 13:21:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/running-rings-around-plain-java---the-killer-code/</guid>
      <description>&lt;p&gt;I wrote my &lt;a href=&#34;https://chasethedevil.github.io/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://chasethedevil.github.io/post/running-rings-around-plain-java/</link>
      <pubDate>Thu, 08 Jan 2009 12:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/more-double-troubles/</link>
      <pubDate>Tue, 06 Jan 2009 12:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-programmers-are-idiots/</link>
      <pubDate>Wed, 17 Dec 2008 20:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/double.nan-is-evil/</link>
      <pubDate>Tue, 09 Dec 2008 16:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/grails-spring-union-not-surprising/</link>
      <pubDate>Thu, 27 Nov 2008 17:18:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/grails-spring-union-not-surprising/</guid>
      <description>&lt;p&gt;Looking out at some &lt;a href=&#34;https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/java-is-dead/</link>
      <pubDate>Fri, 21 Nov 2008 20:24:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Why ArchLinux Is Better Than Ubuntu</title>
      <link>https://chasethedevil.github.io/post/why-archlinux-is-better-than-ubuntu/</link>
      <pubDate>Fri, 14 Nov 2008 10:41:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/why-archlinux-is-better-than-ubuntu/</guid>
      <description>&lt;p&gt;It has been now a week since I have installed &lt;a href=&#34;http://www.archlinux.org&#34;&gt;ArchLinux&lt;/a&gt; on my home computer. I daily use Ubuntu 8.10 at work.&lt;/p&gt;&#xA;&lt;p&gt;Since the Ubuntu upgrade from 8.04 to 8.10 I have had problems with my Xorg settings. I just found out the nvidia-settings utility does not manage to save the configuration anymore. So I have to &lt;a href=&#34;https://bugs.launchpad.net/ubuntu/+source/nvidia-settings/+bug/286424/&#34;&gt;lookup on google&lt;/a&gt; and try to fix it. And that annoys me. That annoys me because the promess of Ubuntu is that everything works out of the box. In reality, you have to mess with the configuration as much as with ArchLinux.&lt;/p&gt;</description>
    </item>
    <item>
      <title>KDE 4.1.3 (again) on ArchLinux</title>
      <link>https://chasethedevil.github.io/post/kde-4.1.3-again-on-archlinux/</link>
      <pubDate>Sat, 08 Nov 2008 15:54:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/kde-4.1.3-again-on-archlinux/</guid>
      <description>&lt;p&gt;I tried another silly thing with Linux, &lt;a href=&#34;http://www.archlinux.org&#34;&gt;ArchLinux&lt;/a&gt;. The setup is quite rough as you have to edit many config files manually. But if you know a bit your way around it takes only a few hours to have everything running well. The installation manual on the wiki is detailed enough to correct all eventual mistakes humans do.&lt;/p&gt;&#xA;&lt;p&gt;I decided to try once more KDE 4 on it, as at first it was just a silly experiment: I was really not sure ArchLinux would be workable. In the end I am pleasantly surprised, KDE 4.1.3 is way way better than any other versions of KDE I have tried before. It is stable and quite pretty. It took the team a lot of time to get there but now I think KDE 4 is a very good window manager, pleasant to use.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stupid Programmer Interviews</title>
      <link>https://chasethedevil.github.io/post/stupid-programmer-interviews/</link>
      <pubDate>Wed, 17 Sep 2008 10:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/stupid-programmer-interviews/</guid>
      <description>&lt;p&gt;I have read a blog post a few days ago about someone thinking a good programmer interview question was:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;How does a hash table work?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;While it is a very interesting question, I doubt many programmers (even relatively good ones) can answer that question. If I look back and think of all the employees in all the companies I have known, I can count on one hand people that can answer that question. I can think of 3 or 4 I met in one company, and maybe another 1 or 2 in different companies. And I don&amp;rsquo;t think anyone would have been able to go deeper in the details like mentioning &lt;a href=&#34;http://www.dcs.gla.ac.uk/%7Epat/52219/l04.html&#34;&gt;closed-addressed vs open-addressed&lt;/a&gt; possible implementations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Art of Multiprocessor Programming Book Review</title>
      <link>https://chasethedevil.github.io/post/the-art-of-multiprocessor-programming-book-review/</link>
      <pubDate>Thu, 11 Sep 2008 19:32:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/the-art-of-multiprocessor-programming-book-review/</guid>
      <description>&lt;p&gt;I don&amp;rsquo;t remember why I started to subscribe to the Java concurrency-interest list. I find that overall, it is an excellent mailing list.&lt;/p&gt;&#xA;&lt;p&gt;There was &lt;a href=&#34;http://cs.oswego.edu/pipermail/concurrency-interest/2008-June/005329.html&#34;&gt;a post&lt;/a&gt; at one point about the Dante Inferno&amp;rsquo;s problem. It triggered my attention, so I decided to buy the book the post was referring to, &lt;em&gt;The Art of Multiprocessor Programming&lt;/em&gt; by M Herlihy and N. Shavit.&lt;/p&gt;&#xA;&lt;p&gt;The books starts with the basics, and is very didactic in its approach. I enjoyed to learn how locks work and how to build them almost out of nothing. The progression is good, starting with a half broken but simple lock and evolving to the more standard algorithm, like the &lt;a href=&#34;http://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm&#34;&gt;Bakery Lock&lt;/a&gt; algorithm. The algorithms are extremely well explained. Later it explains the differences between spin locks (Bakery for example) and blocking locks, while presenting new algorithms for blocking locks.&lt;/p&gt;</description>
    </item>
    <item>
      <title>OO Desillusion</title>
      <link>https://chasethedevil.github.io/post/oo-desillusion/</link>
      <pubDate>Thu, 28 Aug 2008 17:00:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Linus vs OpenBSD</title>
      <link>https://chasethedevil.github.io/post/linus-vs-openbsd/</link>
      <pubDate>Thu, 17 Jul 2008 11:38:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/linus-vs-openbsd/</guid>
      <description>&lt;p&gt;Today&amp;rsquo;s popular story is &lt;a href=&#34;http://article.gmane.org/gmane.linux.kernel/706950&#34;&gt;Linus Torvalds message&lt;/a&gt; to OpenBSD where he writes:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I think the OpenBSD crowd is a bunch of masturbating monkeys&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Beside that provoking sentence he has a valid point. Security bugs should not be more important than other bugs. Too often, management and psychology encourage making security bugs a very important issue and security people VIPs. I have seen this over and over.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Suse 11 with KDE4</title>
      <link>https://chasethedevil.github.io/post/suse-11-with-kde4/</link>
      <pubDate>Thu, 17 Jul 2008 11:38:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/suse-11-with-kde4/</guid>
      <description>&lt;p&gt;I was very &lt;a href=&#34;https://chasethedevil.github.io/post/kde4-still-not-ready&#34;&gt;disappointed by KDE 4.0&lt;/a&gt; when I first tried it on an ubuntu machine. It was just unusable. I would not have even considered it as a beta.&lt;/p&gt;&#xA;&lt;p&gt;I changed the system on my home laptop because Ubuntu with KDE 4 was there. I decided to go for something more roots. I had good memories of Gentoo when I tried it some years ago. Maybe I just became too old to appreciate it anymore. But after spending several hours on a Grub error 2 problem, seeing the live CD does not even use grub so you can&amp;rsquo;t use the CD to boot from hard drive and fix the problem easily, wondering if the problem was a problematic Grub version with my drive or not (I never had problems with Grub and other distros on that same machine before), I decided to install OpenSuse 11.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Java Compilation Performance / Processor Speed</title>
      <link>https://chasethedevil.github.io/post/java-compilation-performance--processor-speed/</link>
      <pubDate>Tue, 01 Jul 2008 19:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Firefox 3</title>
      <link>https://chasethedevil.github.io/post/firefox-3/</link>
      <pubDate>Wed, 18 Jun 2008 11:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/firefox-3/</guid>
      <description>I tried &lt;a href=&#34;http://www.mozilla.com/en-US/firefox/&#34;&gt;Firefox 3&lt;/a&gt; twice before, while it was in alpha and beta. I was not impressed at all, it seemed buggy (normal for alpha) and I found the new location bar behavior unintuitive. It did not seem that much faster either. So I always quickly went back to Firefox 2.&lt;br /&gt;&lt;br /&gt;I tried again recently, funnily, because of a bad Kernel update. One day, after a kernel update, my laptop started to run only at a max of 800Mhz, I did not notice it immediately. I thought wow Firefox 2.0 is really slow with gmail, maybe I should try Firefox 3 again. I did and worked a few days without noticing the processor speed difference that much. Firefox 3 at 800Mhz is as fast as Firefox 2.0 at 2Ghz. It is only after struggling with very long compilation time related to my work that I thought something was wrong.&lt;br /&gt;&lt;br /&gt;As usual with Linux troubles, solution are strange but not too hard to find out. I just had to add a &lt;span style=&#34;font-family: Courier; color: rgb(0, 153, 0);&#34;&gt;processor.ignore_ppc=1&lt;/span&gt; kernel parameter for the kernel to behave properly again.&lt;br /&gt;&lt;br /&gt;Yesterday I installed Firefox 3 on a MacBook, and I was really impressed by its speed. I felt faster than Safari. And now I got used to the new location bar behavior, I would not go back (I think the behavior improved after the betas as well).&lt;br /&gt;&lt;br /&gt;Another interesting browser these days, especially for bloggers, is Flock 2 (based on Firefox 3).</description>
    </item>
    <item>
      <title>Trying Google AppEngine</title>
      <link>https://chasethedevil.github.io/post/trying-google-appengine/</link>
      <pubDate>Tue, 17 Jun 2008 19:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/trying-google-appengine/</guid>
      <description>&lt;p&gt;I finally took some time to try &lt;a href=&#34;http://code.google.com/appengine/&#34;&gt;Google AppEngine&lt;/a&gt;. It used to be easy to find free PHP hosting around 2000. It became a rarity. So writing small experiments for free on the web was difficult. Experiments are back thanks to Google with their AppEngine. Many aspects of it are quite interesting and show where they focus.&lt;/p&gt;&#xA;&lt;p&gt;First it is all Python. It makes sense as I believe Guido v Rossum, Python creator, works for Google. Some people believe in a future Java application hosting. I don&amp;rsquo;t see any reason why it could not become a reality. Making something like AppEngine is a big task, changing implementation language is not. In the meantime, it is not an excuse not to try it, as the Python standard library is fairly rich and Google provides additional libraries on top of it.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Option, Futures and Other Derivatives Book Review</title>
      <link>https://chasethedevil.github.io/post/option-futures-and-other-derivatives-book-review/</link>
      <pubDate>Mon, 16 Jun 2008 17:06:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/option-futures-and-other-derivatives-book-review/</guid>
      <description>&lt;p&gt;&lt;em&gt;Option, Futures and Other Derivatives&lt;/em&gt; is by far the most popular book in finance. You will find it in every finance company, on many desks.&lt;/p&gt;&#xA;&lt;p&gt;It is a very good introduction for people not familiar with standard financial products. This kind of book is unavoidable to understand the basis. It goes also beyond with the chapters on pricing and hedging. These 2 chapters make one understand many other book. If one understands the Black and Scholze formula, one can easily approach many other pricing formula, as in a way, there are all similar in their approach.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Structured Equity Derivatives Book Review</title>
      <link>https://chasethedevil.github.io/post/structured-equity-derivatives-book-review/</link>
      <pubDate>Mon, 16 Jun 2008 16:55:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/structured-equity-derivatives-book-review/</guid>
      <description>&lt;p&gt;If one has to learn about equity derivatives, beside the classic &lt;a href=&#34;https://chasethedevil.github.io/post/option-futures-and-other-derivatives-book-review&#34;&gt;Option, Futures and Other Derivatives&lt;/a&gt; from Hull, &lt;em&gt;Structured Equity Derivatives&lt;/em&gt; by Harry M Kat is a must read.&lt;/p&gt;&#xA;&lt;p&gt;His ideas are presented in a software developer friendly way, as his goal is to show how different equity derivatives products are behind the scenes, very similar.&lt;/p&gt;&#xA;&lt;p&gt;I enjoyed the variety of exotic products presented and the very detailed way in which they are explained&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fedora Linux &amp; Apple Bluetooth Keyboard</title>
      <link>https://chasethedevil.github.io/post/fedora-linux--apple-bluetooth-keyboard/</link>
      <pubDate>Thu, 05 Jun 2008 20:05:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/fedora-linux--apple-bluetooth-keyboard/</guid>
      <description>It took me a long time to have the Apple Bluetooth Keyboard (slim aluminium model) working well with Fedora 9. Thanks to the Ubuntu documentation, it is quite easy to establish a connection manually through hidd commands. It was unfortunately much more difficult to have it automatically recognized and not disconnected after a few minutes without use.&lt;br /&gt;&lt;br /&gt;The following configuration should work with any other distro and probably other bluetooth keyboards as well.&lt;br /&gt;&lt;br /&gt;2 configurations files need to be updated to make it work:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;/etc/default/bluetooth should contain the following, with the mac address replaced by the one from your keyboard (hidd --search to see it).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;BLUETOOTH_ENABLED=1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;HIDD_ENABLED=1&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;HIDD_OPTIONS=&#34;--timeout 8 --connect 00:1D:4F:A7:15:CC --server&#34;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;/etc/bluetooth/hcid.conf should be appended with&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=&#34;font-size:85%;&#34;&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;device 00:1D:4F:A7:15:CC {&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;        name &#34;Apple Wireless Keyboard&#34;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;        auth enable;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;        encrypt enable;&lt;/span&gt;&lt;br /&gt;&lt;span style=&#34;font-family:courier new;&#34;&gt;        lm master;&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;&lt;br /&gt;The 2 tricky parameters are &#34;lm master&#34; (makes it connect automatically), and &#34;--timeout 8&#34; that makes it not disconnect contrary to what the option tells. Without the option the timeout of the keyboard is about 11 minutes. If the computer timeout is lower, the connection will be reestablished automatically, thus the value of 8.&lt;br /&gt;&lt;br /&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Jun 16th update&lt;/span&gt;: I still had disconnections, the only way I found to get rid of them was to &lt;a href=&#34;http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-hardy.git;a=blobdiff;f=net/bluetooth/hidp/core.c;h=dfaef02ba7b49f9503b6ae796090b39f6cc59a08;hp=42dd2b972cbe630acbedfefc334263b07aeac60b;hb=3923c54f44b4e8d31118b8a8b096cc85013d859f;hpb=97ea54575ec58a5bcf13ccf20556f4e68d961bf1&#34;&gt;patch the kernel&lt;/a&gt;. I find surprising it was needed, I thought there would have been enough people complaining that the patch would have already been applied in Fedora kernel.</description>
    </item>
    <item>
      <title>DecimalFormat Is Broken</title>
      <link>https://chasethedevil.github.io/post/decimalformat-is-broken/</link>
      <pubDate>Wed, 14 May 2008 18:19:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/using-mig-layout-for-better-swing-development/</link>
      <pubDate>Tue, 29 Apr 2008 18:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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>_the_ Google 1998 paper</title>
      <link>https://chasethedevil.github.io/post/_the_-google-1998-paper/</link>
      <pubDate>Fri, 25 Apr 2008 14:22:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/_the_-google-1998-paper/</guid>
      <description>&lt;p&gt;I have just read &lt;a href=&#34;http://infolab.stanford.edu/%7Ebackrub/google.html&#34;&gt;the anatomy of a search engine&lt;/a&gt; from S. Brin and L. Page. For those who don&amp;rsquo;t know, it is &lt;em&gt;the&lt;/em&gt; Google paper. I have read other google labs papers in the past. What I like in this one is that you can follow how they came into having the Google ideas, how they assembled their ideas.&lt;/p&gt;&#xA;&lt;p&gt;I should have read that a long time ago.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fedora 9 Already Stable</title>
      <link>https://chasethedevil.github.io/post/fedora-9-already-stable/</link>
      <pubDate>Fri, 25 Apr 2008 11:33:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/fedora-9-already-stable/</guid>
      <description>&lt;figure&gt;&lt;img src=&#34;https://chasethedevil.github.io/post/Fedora9.png&#34;&gt;&lt;figcaption&gt;&#xA;      &lt;h4&gt;Fedora 9&lt;/h4&gt;&#xA;    &lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;I &amp;ldquo;upgraded&amp;rdquo; my home computer to Fedora 9. &amp;ldquo;upgraded&amp;rdquo; because I reinstalled the OS instead of using the upgrade procedure. I have had so many issues with &amp;ldquo;partial&amp;rdquo; upgrades in the past (with any distro).&lt;/p&gt;&#xA;&lt;p&gt;Although it is the preview/RC1 version, Fedora 9 is already as stable as a release IMHO. No issues so far, it feels more polished than Fedora 8. OpenJDK 1.6 is there. Firefox 3 is there. Not a single problem with kernel 2.6.25 (while I had plenty with the 2.6.24 ones).&lt;/p&gt;</description>
    </item>
    <item>
      <title>SwiXml Review</title>
      <link>https://chasethedevil.github.io/post/swixml-review/</link>
      <pubDate>Thu, 24 Apr 2008 12:19:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/better-java-swing-development/</link>
      <pubDate>Thu, 17 Apr 2008 20:55:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Fedora 8 vs. Ubuntu 8</title>
      <link>https://chasethedevil.github.io/post/fedora-8-vs.-ubuntu-8/</link>
      <pubDate>Thu, 28 Feb 2008 14:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/fedora-8-vs.-ubuntu-8/</guid>
      <description>&lt;p&gt;I had the bad idea of trying (K)ubuntu 8.04 on my home computer. It worked for a few days, but as Ubuntu 8 is still in alpha, changes tend to break everything easily. At one point Wine stopped working, then the DVD, then the sound. I had crashes with USB plug/unplug. It was time to go back to a stable distro. I went back to Fedora 8.&lt;/p&gt;&#xA;&lt;p&gt;I found out that I had missed some positive sides of Fedora 8 before. It compares quite well with the future Ubuntu 8. Both include pulseaudio. Pulseaudio in Fedora 8 is very well integrated, works well by default. I had to manually tweak things with Ubuntu, probably because it is an alpha.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Windows Vista Is Crap!</title>
      <link>https://chasethedevil.github.io/post/windows-vista-is-crap/</link>
      <pubDate>Fri, 08 Feb 2008 17:59:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/windows-vista-is-crap/</guid>
      <description>&lt;p&gt;It has been already 1 year since Windows Vista is out. In my new company, I had a new computer with Vista on it. I quickly installed Ubuntu in dual boot. I was happy with Ubuntu for my work, until I received many Excel files OpenOffice was not able to read properly. I decided to give a try to Vista. My first impression of it when I had the computer was quite negative. I was not able to find things that used to be easy to find. It seemed slow and not very interesting.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The 2008 Java Web Framework</title>
      <link>https://chasethedevil.github.io/post/the-2008-java-web-framework/</link>
      <pubDate>Tue, 22 Jan 2008 11:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>KDE4 Still Not Ready</title>
      <link>https://chasethedevil.github.io/post/kde4-still-not-ready/</link>
      <pubDate>Fri, 18 Jan 2008 19:08:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/kde4-still-not-ready/</guid>
      <description>&lt;p&gt;I tried KDE4.0 last week, when it was everywhere in the news. I was very disappointed.&lt;/p&gt;&#xA;&lt;p&gt;I have a long experience of trying beta software, not well known software. I have used Linux since 1998 (partly). I have even used windows beta at one point. And I have seen nothing as crappy as  KDE4.0 release.&lt;/p&gt;&#xA;&lt;p&gt;It is not usable at all.&lt;/p&gt;&#xA;&lt;p&gt;Now I can understand what are KDE motivations to do such a bad release. It is to gain momentum in their project. KDE4.0 is in development at least &lt;a href=&#34;http://www.advogato.org/person/tjansen/diary.html?start=13&#34;&gt;since 2002&lt;/a&gt; - 6 years! By creating a .0 release now even if it is an alpha, they have at least something officially out and hope to have developers starting to improve it. It is especially important for them because Gnome has, in the mean time, made regularly lots of improvements.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Fedora 8 - The Comeback</title>
      <link>https://chasethedevil.github.io/post/fedora-8---the-comeback/</link>
      <pubDate>Sun, 23 Dec 2007 02:28:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/fedora-8---the-comeback/</guid>
      <description>&lt;p&gt;My previous post about &lt;a href=&#34;https://chasethedevil.github.io/posts/ubuntu-7.10-vs-fedora-core-8---gutsy-vs-werewolf&#34;&gt;Ubuntu Gutsy vs Fedora 8&lt;/a&gt; was weak. It is difficult to find a very good distro. Depending on the computer, I have had different experiences. On some computers, Ubuntu really shines and work with minimal tweaking. On some others, Ubuntu is unstable/does not handle wireless correctly and Fedora is much more stable.&lt;/p&gt;&#xA;&lt;p&gt;The main issues I can see with Fedora 8 are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;LVM by default. I don&amp;rsquo;t think it is a good idea to go LVM by default since lots of basic tools are still not handling it properly. And if you want to read your disk by something else than a distro with LVM you are screwed. Ext3 straight is imho a much wiser choice. Plus it is rarely a problem to resize partitions as it is not something one does often.&lt;/li&gt;&#xA;&lt;li&gt;Fewer programs in the repositories available. Under ubuntu, I was using gtkguitune to tune my guitar, it was in the default repositories. It does not exist for Fedora and I did not manage to compile it due to too old dependencies (GTK 1.2). I found accordeur on sourceforge which is a better program and is available as RPM, so in the end I found something. But while searching I saw the choice was not as wide as with Ubuntu.&lt;/li&gt;&#xA;&lt;li&gt;Packages too small: it is not exactly clear what packages you need to start compiling programs with Fedora. If you look in the default categorization, way too many things are silly to enable by default. Also generally package management seems less stable/less easy to use than with Ubuntu.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;What I like:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Haskell Fibonacci Revisited</title>
      <link>https://chasethedevil.github.io/post/haskell-fibonacci-revisited/</link>
      <pubDate>Wed, 12 Dec 2007 17:08:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/haskell-fibonacci-revisited/</guid>
      <description>Recently, there was an &lt;a href=&#34;http://cgi.cse.unsw.edu.au/~dons/blog/2007/11/29#smoking-4core&#34;&gt;interesting post&lt;/a&gt; about Haskell performance and Haskell parallelization showing Haskell could outperform C on a simple Fibonacci example.&lt;br /&gt;&lt;br /&gt;A friend of mine, Peter (that I seem to manage to constantly piss off) thought about it on another level, saying you could achieve a _MILLION_ times better using a direct formula in C or Java, &lt;a href=&#34;http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fibFormula.html#formula&#34;&gt;the Binet formula&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I decided to try as the improvement scale seemed a bit surprising. I first compared a Java recursive fibonacci with a Haskell one. Here are the results for Haskell GHC 6.6.1 vs Java 1.6.0 on Linux for fib(44):&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/R2AevOMNqtI/AAAAAAAABI4/Ju0-GjX6W14/s1600-h/simple_haskell.png&#34;&gt;&lt;img style=&#34;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&#34; src=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/R2AevOMNqtI/AAAAAAAABI4/Ju0-GjX6W14/s320/simple_haskell.png&#34; border=&#34;0&#34; alt=&#34;&#34;id=&#34;BLOGGER_PHOTO_ID_5143144571069115090&#34; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://1.bp.blogspot.com/_9RyqGT46Fbk/R2AeveMNquI/AAAAAAAABJA/DJDx3Vw0LyU/s1600-h/simple_java.png&#34;&gt;&lt;img style=&#34;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&#34; src=&#34;http://1.bp.blogspot.com/_9RyqGT46Fbk/R2AeveMNquI/AAAAAAAABJA/DJDx3Vw0LyU/s320/simple_java.png&#34; border=&#34;0&#34; alt=&#34;&#34;id=&#34;BLOGGER_PHOTO_ID_5143144575364082402&#34; /&gt;&lt;/a&gt;&lt;br /&gt;Then I decided to check out the time for fib(44) or any fib at all, I was unable to measure precisely enough since it always came out as 0ms, in Haskell, or in Java. Looping out 10 million times, Java gave out 7.3s and Haskell something similar (but my method to loop 10 million times in Haskell is probably very bad).&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/R2AnZOMNqvI/AAAAAAAABJI/DHpUw2wMiTc/s1600-h/binet_haskell.png&#34;&gt;&lt;img style=&#34;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&#34; src=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/R2AnZOMNqvI/AAAAAAAABJI/DHpUw2wMiTc/s320/binet_haskell.png&#34; border=&#34;0&#34; alt=&#34;&#34;id=&#34;BLOGGER_PHOTO_ID_5143154088716643058&#34; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/R2AnZOMNqwI/AAAAAAAABJQ/dkgIlZuXSPE/s1600-h/binet_java.png&#34;&gt;&lt;img style=&#34;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&#34; src=&#34;http://4.bp.blogspot.com/_9RyqGT46Fbk/R2AnZOMNqwI/AAAAAAAABJQ/dkgIlZuXSPE/s320/binet_java.png&#34; border=&#34;0&#34; alt=&#34;&#34;id=&#34;BLOGGER_PHOTO_ID_5143154088716643074&#34; /&gt;&lt;/a&gt;&lt;br /&gt;The original post actually points to a link that describes various algorithms for Fibonacci. They basically say that for large n, the rounding is not precise enough, they also propose algorithms in log(n). I tried and was really impressed by the performance of those algorithms. Again I could not measure the difference for a single calculation between it and the binet formula as elapsed time is always 0. The binet formula becomes inexact already at n=71 in Java with doubles.&lt;br /&gt;&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://2.bp.blogspot.com/_9RyqGT46Fbk/R2AoLuMNqxI/AAAAAAAABJY/o0Z4pI0ELPY/s1600-h/fancy_haskell.png&#34;&gt;&lt;img style=&#34;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&#34; src=&#34;http://2.bp.blogspot.com/_9RyqGT46Fbk/R2AoLuMNqxI/AAAAAAAABJY/o0Z4pI0ELPY/s320/fancy_haskell.png&#34; border=&#34;0&#34; alt=&#34;&#34;id=&#34;BLOGGER_PHOTO_ID_5143154956300036882&#34; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Of course the original post is still quite interesting, it shows how easy it can be to parallelize calculations in Haskell. But the example is silly as another algorithm can lead to 10 millions times the performance. Still Haskell performs well with the shit or good algorithm when compared to Java.</description>
    </item>
    <item>
      <title>Ubuntu 7.10 vs Fedora Core 8 - Gutsy vs Werewolf</title>
      <link>https://chasethedevil.github.io/post/ubuntu-7.10-vs-fedora-core-8---gutsy-vs-werewolf/</link>
      <pubDate>Tue, 20 Nov 2007 16:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/ubuntu-7.10-vs-fedora-core-8---gutsy-vs-werewolf/</guid>
      <description>&lt;p&gt;I was pretty happy with Ubuntu 7.10, but when Fedora 8 came out I decided to give it a try. Last time I tried it it was Core 2 or something like that, and it was NOT good.&lt;/p&gt;&#xA;&lt;p&gt;At first Fedora 8 looks quite good, has a good Live CD install, reminiscent of Ubuntu. The positive side is that it is based on the latest Kernel. It manages my Thinkpad T42 very well (suspend, hibernate work). But after a few days, one notice Fedora is not as stable as Ubuntu, for example:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Apache DbUtils Completely Useless</title>
      <link>https://chasethedevil.github.io/post/apache-dbutils-completely-useless/</link>
      <pubDate>Fri, 02 Nov 2007 17:17:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/i-fell-in-the-trap-of-boolean.getboolean/</link>
      <pubDate>Fri, 12 Oct 2007 16:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/fast-web-development-with-scala/</link>
      <pubDate>Tue, 25 Sep 2007 14:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>2 Months of Ubuntu on Mac Mini</title>
      <link>https://chasethedevil.github.io/post/2-months-of-ubuntu-on-mac-mini/</link>
      <pubDate>Mon, 27 Aug 2007 23:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/2-months-of-ubuntu-on-mac-mini/</guid>
      <description>&lt;p&gt;I am finally happy with my OS. I had previously [some complaints]({{ relref . &amp;ldquo;1-year-of-mac-mini&amp;ndash;the-deception-point.md&amp;rdquo; }}) about MacOs X and the Mac Mini. It is now over, with &lt;a href=&#34;https://www.ubuntu.org&#34;&gt;Ubuntu&lt;/a&gt;, I am very happy of my quiet system.&lt;/p&gt;&#xA;&lt;p&gt;I use Quod Libet for Audio, it has similar interface as iTunes, with more features (ability to play most audio formats). I chose Quod Libet instead of the standard Rhythmbox because of its practical mp3 tags handling. This also means that unlike iTunes, when I reimport my full library with another player, or on another computer, I have it all organized the right way, because the right meta data is in the audio files and not in a xml file that sometimes gets corrupted.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Spring Web Services, Finally!</title>
      <link>https://chasethedevil.github.io/post/spring-web-services-finally/</link>
      <pubDate>Thu, 23 Aug 2007 11:22:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/original-pattern-servletrequest-in-threadlocal/</link>
      <pubDate>Thu, 02 Aug 2007 12:07:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Vim setup</title>
      <link>https://chasethedevil.github.io/post/vim-setup/</link>
      <pubDate>Fri, 27 Jul 2007 16:13:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/vim-setup/</guid>
      <description>Here is my Vim setup information for reference&lt;br&gt;&lt;br&gt;in .vimrc or _vimrc, add at the beginning:&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; set langmenu=en_US.ISO_8859-1&lt;br&gt;set gfn=Bitstream_Vera_Sans_Mono:h9:cANSI&lt;br&gt;colorscheme oceandeep&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;First line is to avoid menus in French.&lt;br&gt;The font (you can &lt;a href=&#34;http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/&#34;&gt; find here&lt;/a&gt;) is simply &lt;a href=&#34;http://www.kuro5hin.org/story/2004/12/6/11739/5249&#34;&gt;the best programmer&amp;#39;s font&lt;/a&gt;.&lt;br&gt;oceandeep mode can be found &lt;a href=&#34;http://www.tomsdiner.org/vim/oceandeep/index.html&#34;&gt;here&lt;/a&gt; .&lt;br&gt;</description>
    </item>
    <item>
      <title>Why Eclipse Is Better</title>
      <link>https://chasethedevil.github.io/post/why-eclipse-is-better/</link>
      <pubDate>Fri, 27 Jul 2007 14:37:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/tapestry5-vs-wicket-1---0/</link>
      <pubDate>Wed, 11 Jul 2007 12:49:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/netbeans-6.0m10-out-without-announcement-yet/</link>
      <pubDate>Sat, 30 Jun 2007 07:15:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/use-orm-for-better-performance/</link>
      <pubDate>Tue, 12 Jun 2007 12:59:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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;</description>
    </item>
    <item>
      <title>People Using Spring, EJBs Don&#39;t Know Basic JDBC</title>
      <link>https://chasethedevil.github.io/post/people-using-spring-ejbs-dont-know-basic-jdbc/</link>
      <pubDate>Wed, 30 May 2007 12:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/wizards-bad-for-productivity/</link>
      <pubDate>Wed, 16 May 2007 14:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/less-productive-with-maven2./</link>
      <pubDate>Sun, 29 Apr 2007 17:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/less-productive-with-maven2./</guid>
      <description>&lt;p&gt;My &lt;a href=&#34;https://chasethedevil.github.io/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>How to Build Good Software? Good network connection</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-good-network-connection/</link>
      <pubDate>Fri, 27 Apr 2007 12:40:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-good-network-connection/</guid>
      <description>&lt;p&gt;Not having good internet connection can be problematic to download new libraries, read or search for documentation on development subjects. But not having a good internal network connection is  killer of productivity. It means sometimes not being able to access integration, preprod or even production environment, or ssh session not responding in the middle of an action. As software makes an increasing use of the network, it means not being able to test or to use correctly all kind of software.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Private office, again</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-private-office-again/</link>
      <pubDate>Wed, 25 Apr 2007 15:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-private-office-again/</guid>
      <description>&lt;p&gt;Apparently it&amp;rsquo;s more a habit of French companies to have big open spaces with no separation at all between people. There is nothing more annoying than having people in conference call in front of you while you are trying to work on something completely different. French people forgot the cubicle part in the American open space idea. So sometimes the room is just a big mess, everybody being able to disturb you anytime. Even if I have no private office, please give me at least a cubicle.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Welcome newcomers</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-welcome-newcomers/</link>
      <pubDate>Wed, 18 Apr 2007 20:17:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-welcome-newcomers/</guid>
      <description>&lt;p&gt;Some companies do it naturally, some really don&amp;rsquo;t. In small companies, it is almost natural, people will make a newcomer productive very quickly. In a big company it&amp;rsquo;s not the same game.&lt;/p&gt;&#xA;&lt;p&gt;Some important points are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Computer ready the first day, well sized (right ram, right power, developers are not MS office users), right OS.  I had experience with having not the right amount of ram, not the right version of OS, not the right user rights to install and use critical software for my work, and all those were known from the team. I also hate when companies give the cheapest computer available for developers/architects. On top of that badly configured computers take often a month to be ready in big companies. It just does not makes sense.&lt;/li&gt;&#xA;&lt;li&gt;Network access. I have seen people coming for a short contract and not having network account or email account before 1 week.&lt;/li&gt;&#xA;&lt;li&gt;Give documents to read, show applications the person will work with. Involve newcomer in new decisions on his project.&lt;/li&gt;&#xA;&lt;li&gt;Some big companies have it right. I remember my internship at IBM Germany, where on the first day I had a box waiting for me with computer inside, that I had to unpack and install (with OS/2) for my use. I think this is the best way for developers/tech people. And then they recommended excellent reading on the subject I would be working on. It&amp;rsquo;s not that difficult.&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Project Estimations And Fibonacci Sequence.</title>
      <link>https://chasethedevil.github.io/post/project-estimations-and-fibonacci-sequence./</link>
      <pubDate>Fri, 13 Apr 2007 13:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/project-estimations-and-fibonacci-sequence./</guid>
      <description>&lt;p&gt;I was recently in a meeting where use case complexity was estimated using numbers in the &lt;a href=&#34;http://en.wikipedia.org/wiki/Fibonacci_number&#34;&gt;Fibonacci sequence&lt;/a&gt;. I was surprised by the choice of the Fibonacci sequence. Why not any sequence? Why a particular one? I googled and found the culprit,  &lt;a href=&#34;http://www.mountaingoatsoftware.com/system/hidden_asset/file/15/aep_sample.pdf&#34;&gt;Mr Mike Cohn&lt;/a&gt;  in his book Agile Estimating and Planning. It&amp;rsquo;s actually not a bad sequence to choose, since the scale is increasing constantly, so by picking up numbers in this sequence, you can quite accurately describe estimation. If you have defined complexities of 1,2,3,16,17 corresponding to 5 different use cases then obviously 16 or 17 denotes the same complexity, and it would be surprising that you can really distinguish both. You need an ever increasing scale. But a power of 2 scale might not be precise enough (steps are growing too fast).&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Use a bug management software, really.</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-use-a-bug-management-software-really./</link>
      <pubDate>Fri, 13 Apr 2007 10:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-use-a-bug-management-software-really./</guid>
      <description>&lt;p&gt;This will seem obvious, unfortunately, when people are involved, nothing is that obvious. It&amp;rsquo;s not because you setup a bug/feature management software that people will use it. You have to force people to go through the bug management software each time they want something fixed. If you don&amp;rsquo;t do that some people will keep sending incomplete mails, or worse call you to get something fixed, that will be forgotten in a week. It is also very useful to avoid receiving 10x the same request from the same person.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Have a good build process</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-have-a-good-build-process/</link>
      <pubDate>Thu, 12 Apr 2007 09:54:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-have-a-good-build-process/</guid>
      <description>&lt;p&gt;Important points are: standard code hierarchy, automatic download of dependencies, a distribution command with versioning support and source control interaction, a simple command to build each part of the project. In Java best candidates are a sophiticated ant build, or maven2. Maven2 is quite good since it forces you to do some of those steps, even though I think ant can&amp;rsquo;t really be avoided for many more specific tasks.&lt;/p&gt;&#xA;&lt;p&gt;Once, I got wrong code before I left for a customer site, because code given to the customer was not checked into a source repository everytime before it was given to the customer. Furthermore the code I had could not be built because of missing jars, and the project structure forced some source directories containing source code common with other projects to be in a very specific directories at a particular level, because project isolation was poor. It took me 7 days to understand their very awkward build process.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Private Office</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-private-office/</link>
      <pubDate>Wed, 11 Apr 2007 10:52:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-private-office/</guid>
      <description>&lt;p&gt;In an open space, people keep on coming to discuss various issues with various people, issues that have nothing to do with your work. You end up either being distracted, or annoyed by the increased noise level.&lt;/p&gt;&#xA;&lt;p&gt;Apparently at Microsoft, they have private offices for each programmer. It might be extreme, paradoxally not in the XP (extreme programming) sense, but it is much better than open space for productivity. In XP, it&amp;rsquo;s almost the opposite with 2 developers working often together.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Lay Off Quickly.</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-lay-off-quickly./</link>
      <pubDate>Tue, 10 Apr 2007 11:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-lay-off-quickly./</guid>
      <description>&lt;p&gt;If you have to lay off in your job, do it quickly. I don&amp;rsquo;t understand companies that want to keep someone as long as legally possible when this someone wants to leave. First the employee won&amp;rsquo;t be as motivated, but more importantly, you will continue to train that person to your company&amp;rsquo;s software and ways of work. This would be much better used on another person, that will stay in the company. Time for layoffs should exclusively be used for knowledge transfer.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? Talk to people, especially the ones you don&#39;t know well.</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-talk-to-people-especially-the-ones-you-dont-know-well./</link>
      <pubDate>Fri, 06 Apr 2007 17:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-talk-to-people-especially-the-ones-you-dont-know-well./</guid>
      <description>&lt;p&gt;Someone modified a simple launch script on a integration machine. This pissed off the author of the script. Why?&lt;/p&gt;&#xA;&lt;p&gt;Just because the guy who modified the script never worked before with the author of the script. If only the author had been notified verbally or by mail of the modification, he would have been happy. Furthermore this would increase the quality of the change since the new guy might have made a change that has other impacts, that the author will best evaluate quickly.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Find Grep And Vi Keys Small Memo</title>
      <link>https://chasethedevil.github.io/post/find-grep-and-vi-keys-small-memo/</link>
      <pubDate>Thu, 05 Apr 2007 18:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/find-grep-and-vi-keys-small-memo/</guid>
      <description>I tend to forget this now and then to grep on a specific list of files:&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; font-weight: bold;&#34; class=&#34;gmail_quote&#34;&gt; find . -name &#34;*.xml&#34; | xargs grep &#34;iwantthis&#34;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;And I also tend to forget the &lt;a href=&#34;http://www.mathlab.cornell.edu/local_help/vi.html&#34;&gt;vi keys&lt;/a&gt;. Small extract:&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; &lt;b&gt;h&lt;/b&gt; - move left one character&lt;br /&gt;&lt;b&gt;j&lt;/b&gt; - move down one line&lt;br /&gt;&lt;b&gt;k&lt;/b&gt; - move up&lt;br /&gt;&lt;b&gt;l&lt;/b&gt; - move right&lt;br /&gt;&lt;b&gt;$&lt;/b&gt; - go to the end of the current line&lt;br /&gt;&lt;b&gt;0&lt;/b&gt; - go to the beginning of the current line&lt;br /&gt;&lt;b&gt;G&lt;/b&gt; - go to the last line in the file&lt;br /&gt;&lt;b&gt;15G&lt;/b&gt; - go to line 15&lt;br /&gt;&lt;b&gt;control-F&lt;/b&gt; - forward one page&lt;br /&gt;&lt;/blockquote&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;b&gt;control-B&lt;/b&gt; - backwards one page &lt;/blockquote&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&gt;&lt;b&gt;n (N)&lt;/b&gt; - next (previous) in search mode (/ or ? forward or backward)  &lt;/div&gt;&lt;/blockquote&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;b&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;/span&gt;s/OLD/NEW/g&lt;/b&gt; - replace on current line&lt;br /&gt;&lt;/blockquote&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;b&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;&lt;/span&gt; %&lt;/span&gt;s/OLD/NEW/g&lt;/b&gt; - replace every occurence in file (or use 0,$ instead of %)&lt;br /&gt;&lt;/blockquote&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; &lt;b&gt;x&lt;/b&gt; - delete one character&lt;/blockquote&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&#34;font-weight: bold;&#34;&gt;Update &lt;/span&gt;I have to add the standard replace in multiple files via sed command. Here is an example of how to move your eclipse workspace to another directory:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;find . -name &#34;*.xml&#34; | xargs sed -i &#34;s,c:[/\\]java[/\\]eclipse,d:/eclipse302,gi&#34;&lt;/li&gt;&lt;/ul&gt; &lt;/div&gt;&lt;/div&gt;</description>
    </item>
    <item>
      <title>How to Build Good Software? MS Press Code Complete says Measure twice, cut once</title>
      <link>https://chasethedevil.github.io/post/how-to-build-good-software-ms-press-code-complete-says-measure-twice-cut-once/</link>
      <pubDate>Thu, 05 Apr 2007 14:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/how-to-build-good-software-ms-press-code-complete-says-measure-twice-cut-once/</guid>
      <description>&lt;p&gt;I am starting a series of posts about software construction, based on good and bad experiences while working for my many employers.&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;Software construction (a.k.a. architecture), is the only activity that&amp;rsquo;s guaranteed to happen on every project&amp;rdquo;. It is not rare that projects or new features are abandoned either because they are too costly, or because they are not needed anymore, or because they are other more important priorities.&lt;/p&gt;&#xA;&lt;p&gt;In the same vein: &amp;ldquo;Measure twice, cut once&amp;rdquo;. “Measure twice, cut once” is highly relevant to the construction part of software development, which can account for as much as 65 percent of the total project costs. The worst software projects end up doing construction two or three times or more. Doing the most expensive part of the project twice is as bad an idea in software as it is in any other line of work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Java Concurrency In Practice Book Review</title>
      <link>https://chasethedevil.github.io/post/java-concurrency-in-practice-book-review/</link>
      <pubDate>Wed, 14 Feb 2007 16:33:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/why-are-you-not-using-entity-ejb-1.1/</link>
      <pubDate>Wed, 07 Feb 2007 16:38:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Switching to Windows</title>
      <link>https://chasethedevil.github.io/post/switching-to-windows/</link>
      <pubDate>Thu, 25 Jan 2007 01:04:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/switching-to-windows/</guid>
      <description>&lt;p&gt;That&amp;rsquo;s it, I have done it, the unthinkable. I have switched from MacOs X to Windows XP. My idea was first to install Ubuntu on the Mac Mini, but if you want to keep the Mac Os X install, the methods I have read on the web required to use bootcamp. At around the same time I was annoyed by problems I had with bluetooth and Skype in MacOs.&lt;/p&gt;&#xA;&lt;p&gt;So, with bootcamp installed I decided to give a try to Windows. And it works quite well on the Mac. As I use it mostly as a media box (movies, photos, jukebox, browser and tablature reader) and not really as a developer, I find Windows quite convenient. I have always preferred Picasa to iPhoto. And moving back to Picasa for my photos is a joy. I can&amp;rsquo;t believe the speed difference between the two apps, and it&amp;rsquo;s not a matter of memory, I have 2gb. The crappy ways iPhotos deals with my folders is over. I am also happy to use again foobar2000 instead of bloated (and limited (only MP3s and MP4s)) iTunes. In my quest to look for a convenient setup, I discovered ProjectM visualisation, also available for MacOs X (with iTunes) and Linux. I am quite impressed with the animations. I have the impression that graphics are much faster under Windows than under MacOs, it&amp;rsquo;s probably due to much better optimized drivers.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Social (Web) Revelation: Tags Are Lame</title>
      <link>https://chasethedevil.github.io/post/social-web-revelation-tags-are-lame/</link>
      <pubDate>Tue, 16 Jan 2007 10:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/1-year-of-mac-mini---the-deception-point/</link>
      <pubDate>Mon, 08 Jan 2007 15:56:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/tired-of-bad-singletons/</link>
      <pubDate>Thu, 04 Jan 2007 11:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/declaring-your-logger---no-problem/</link>
      <pubDate>Fri, 29 Dec 2006 11:45:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/very-quick-django-trial---bye-bye-django/</link>
      <pubDate>Thu, 21 Dec 2006 17:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/a-proof-that-javascript-sucks./</link>
      <pubDate>Fri, 15 Dec 2006 16:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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;</description>
    </item>
    <item>
      <title>Building With Ant &#43; Maven Antlib?</title>
      <link>https://chasethedevil.github.io/post/building-with-ant--maven-antlib/</link>
      <pubDate>Thu, 14 Dec 2006 10:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/the-hibernate-network-proxy-a-dumb-idea./</link>
      <pubDate>Mon, 04 Dec 2006 14:41:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/workaround-when-eclipse-fucks-off-with-cvs/</link>
      <pubDate>Tue, 28 Nov 2006 11:42:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/maven-game-over-try-again/</link>
      <pubDate>Fri, 24 Nov 2006 17:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/how-jdepend-changed-my-java-packaging/</link>
      <pubDate>Fri, 13 Oct 2006 09:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/you-know-ioexception-think-again/</link>
      <pubDate>Thu, 14 Sep 2006 10:59:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/good-software-books---2006-version/</link>
      <pubDate>Mon, 11 Sep 2006 14:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/i-get-spring/</link>
      <pubDate>Wed, 23 Aug 2006 18:04:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-serialization-vs-.net-serialization---java-perverse/</link>
      <pubDate>Tue, 22 Aug 2006 12:55:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/5-minutes-of-google-spreadsheets/</link>
      <pubDate>Thu, 17 Aug 2006 12:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/procedural-programming-in-an-oo-language/</link>
      <pubDate>Tue, 08 Aug 2006 12:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/back-to-real-java-bye-bye-j2ee/</link>
      <pubDate>Wed, 26 Jul 2006 16:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/moving-weekly-javablog-stats-to-a-new-blog/</link>
      <pubDate>Mon, 26 Jun 2006 17:25:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/jsf-was-too-hard-for-experienced-developers/</link>
      <pubDate>Fri, 23 Jun 2006 14:59:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/on-ejb-restrictions---can-you-open-a-socket/</link>
      <pubDate>Mon, 19 Jun 2006 11:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/using-linux-to-recover-fucked-up-windows-data/</link>
      <pubDate>Thu, 01 Jun 2006 01:52:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-html-parsing-example-with-htmlparser/</link>
      <pubDate>Tue, 30 May 2006 11:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/first-steps-with-ehcache/</link>
      <pubDate>Thu, 04 May 2006 18:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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;</description>
    </item>
    <item>
      <title>Null vs. Errors</title>
      <link>https://chasethedevil.github.io/post/null-vs.-errors/</link>
      <pubDate>Wed, 26 Apr 2006 16:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/algorithms-in-java-third-edition-book-review/</link>
      <pubDate>Wed, 26 Apr 2006 12:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/caching-http-responses-in-java/</link>
      <pubDate>Wed, 19 Apr 2006 18:14:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/javablogs.com-2005-top-20/</link>
      <pubDate>Tue, 18 Apr 2006 16:42:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/how-to-use-java-with-blogger-a-tutorial/</link>
      <pubDate>Tue, 18 Apr 2006 16:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/last-week-javablogs.com-top-10/</link>
      <pubDate>Tue, 18 Apr 2006 11:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/web-services-no-better-than-corba/</link>
      <pubDate>Mon, 10 Apr 2006 15:23:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/is-your-uml-composition-french-or-american/</link>
      <pubDate>Fri, 07 Apr 2006 11:40:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/are-uml-aggregation-and-composition-good-concepts/</link>
      <pubDate>Tue, 04 Apr 2006 11:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/soa-and-b.-meyer/</link>
      <pubDate>Fri, 31 Mar 2006 15:08:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/tired-of-my-10-best-xxx-blog-posts/</link>
      <pubDate>Thu, 30 Mar 2006 10:32:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/bilinear-gaussian-lanczos-downsampling/</link>
      <pubDate>Fri, 17 Mar 2006 17:32:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/bad-jdk-design-example/</link>
      <pubDate>Thu, 16 Mar 2006 15:02:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/current-popular-subjects-in-java-blogs/</link>
      <pubDate>Wed, 15 Mar 2006 20:00:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/non-fiction-books-mostly-software-programming-before-2003/</link>
      <pubDate>Wed, 15 Mar 2006 15:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/del.icio.us-firefox-toolbar-update/</link>
      <pubDate>Mon, 13 Mar 2006 19:45:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/why-did-netscape-choose-javascript/</link>
      <pubDate>Thu, 09 Mar 2006 17:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/new-mac-mini/</link>
      <pubDate>Tue, 07 Mar 2006 20:51:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/features-that-ruby-lacks-and-java-has/</link>
      <pubDate>Fri, 10 Feb 2006 15:57:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/what-is-modern-java-compilation/</link>
      <pubDate>Tue, 07 Feb 2006 11:12:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/rmi-nightmares---non-interoperability/</link>
      <pubDate>Tue, 31 Jan 2006 18:39:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/my-dream-job/</link>
      <pubDate>Thu, 12 Jan 2006 11:42:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/ogg-better-than-mpc-and-mp3---aac-crap/</link>
      <pubDate>Wed, 04 Jan 2006 11:47:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/whats-your-favorite-design-pattern/</link>
      <pubDate>Tue, 27 Dec 2005 12:18:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/professional-portal-development-book-review/</link>
      <pubDate>Tue, 27 Dec 2005 12:08:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/ibm-websphere-portal-strategy/</link>
      <pubDate>Wed, 07 Dec 2005 17:48:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/portlets-in-an-ajax-world/</link>
      <pubDate>Tue, 29 Nov 2005 16:29:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/good-software-books/</link>
      <pubDate>Thu, 17 Nov 2005 21:24:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/apple-rumors-and-x86-first-move/</link>
      <pubDate>Wed, 16 Nov 2005 17:59:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/7-years-later-still-ejbs/</link>
      <pubDate>Mon, 07 Nov 2005 16:29:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/job-hunting-interview-madness/</link>
      <pubDate>Fri, 04 Nov 2005 10:40:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/does-eclipse-rot-the-brain/</link>
      <pubDate>Thu, 27 Oct 2005 17:42:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/orkut-statistics-and-blog-evolution/</link>
      <pubDate>Tue, 18 Oct 2005 13:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/spring-books-roundup-updated/</link>
      <pubDate>Mon, 10 Oct 2005 16:27:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/spring-books-roundup-updated/</guid>
      <description>&lt;p&gt;I am completing my &lt;a href=&#34;https://chasethedevil.github.io/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://chasethedevil.github.io/post/spring-books-roundup/</link>
      <pubDate>Mon, 10 Oct 2005 11:15:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/interesting-plug-in-framework---dpml-transit/</link>
      <pubDate>Thu, 29 Sep 2005 15:20:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-puzzlers---can-you-figure-this-out/</link>
      <pubDate>Wed, 28 Sep 2005 16:04:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/is-prolog-better-suited-than-sql/</link>
      <pubDate>Mon, 26 Sep 2005 15:36:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/when-california-was-an-island/</link>
      <pubDate>Wed, 21 Sep 2005 19:01:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/currying---a-very-interesting-use-of-generics/</link>
      <pubDate>Fri, 16 Sep 2005 14:41:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/on-j2ee-portability-accross-application-servers/</link>
      <pubDate>Tue, 13 Sep 2005 16:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/javablogs-weekly-top-10-and-java-html-parsing/</link>
      <pubDate>Mon, 12 Sep 2005 16:00:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/spam-in-blog-comments/</link>
      <pubDate>Sat, 10 Sep 2005 01:34:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/javablogs-daily-analysis/</link>
      <pubDate>Fri, 09 Sep 2005 17:10:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/commons-beanutils-is-slow/</link>
      <pubDate>Wed, 07 Sep 2005 17:28:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/generate-your-rss-feed-in-java/</link>
      <pubDate>Mon, 05 Sep 2005 14:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/the-evil-port-80/</link>
      <pubDate>Thu, 01 Sep 2005 13:46:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>Google Sidebar Hotkey Activation</title>
      <link>https://chasethedevil.github.io/post/google-sidebar-hotkey-activation/</link>
      <pubDate>Thu, 25 Aug 2005 14:35:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/google-sidebar-hotkey-activation/</guid>
      <description>I like the new &lt;a href=&#34;http://desktop.google.com/en/&#34;&gt;Google Desktop&lt;/a&gt; with the sidebar. It shares similarities with &lt;a href=&#34;http://www.konfabulator.com/&#34;&gt;Konfabulator&lt;/a&gt;, recently bought by yahoo. They both allow easy access to some custom little widgets that I would call &#34;active&#34;. They are active because they are refreshed periodically with new information (processor usage, news, scratch pad, emails, etc). But while Konfabulator choose to emphasize on visual effects, Google prefers a more standard information presentation. This shows as well in their choice of technologies:&lt;br /&gt;&lt;ul&gt;   &lt;li&gt;Google Sidebar plug-ins are just Windows appz that can take advantage of Google Interfaces. That makes them quite powerful in theory, but programming them is less accessible.&lt;br /&gt;  &lt;/li&gt;   &lt;li&gt;Konfabulator plug-ins are Javascript+XML, the Javascript is not just regular client-side javascript, it can use Konfabulator API (containing many effect and rudimentary network access), and COM objects . That makes them very focused on presentation, and the Internet.&lt;/li&gt; &lt;/ul&gt; In the long run, Google choice makes sense, the forthcoming &lt;a href=&#34;http://fortes.com/work&#34;&gt;Avalon&lt;/a&gt; will make visual effects very accessible to windows developers.&lt;br /&gt;&lt;br /&gt;Now back to the subject, I missed the &#39;activation on hotkey&#39; feature from Konfabulator for the Google Sidebar. Fortunately, I a have found a powerful little open-source program, &lt;a href=&#34;http://www.autohotkey.com/&#34;&gt;Autohotkey&lt;/a&gt;, that allowed me to do that very quickly. Here is the script I use (it&#39;s a hack since it relies on toolbar size (but not position), but I like the default position and it works (only using floating deskbar, i let you figure out for the non floating version)):&lt;br /&gt;&lt;span style=&#34;font-family:Courier New, Courier, monospace;&#34;&gt;F12::&lt;br /&gt;MouseGetPos, X, Y&lt;br /&gt;if WinExist(&#34;ahk_class _GD_Sidebar&#34;)&lt;br /&gt;{&lt;br /&gt;    WinActivate&lt;br /&gt;    BlockInput,On&lt;br /&gt;    MouseClick, left, 160, 16&lt;br /&gt;    MouseMove, X,Y&lt;br /&gt;    BlockInput,Off&lt;br /&gt;    return&lt;br /&gt;}&lt;br /&gt;else if WinExist(&#34;ahk_class ATL:0044A4C8&#34;)&lt;br /&gt;{&lt;br /&gt;    WinActivate&lt;br /&gt;    BlockInput,On&lt;br /&gt;    MouseClick, left,  158,  16&lt;br /&gt;    MouseMove, X,Y&lt;br /&gt;    BlockInput,Off&lt;br /&gt;    return&lt;br /&gt;}&lt;/span&gt;</description>
    </item>
    <item>
      <title>I Need Another DB Framework!</title>
      <link>https://chasethedevil.github.io/post/i-need-another-db-framework/</link>
      <pubDate>Tue, 23 Aug 2005 19:37:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/del.icio.us-toolbar-customized/</link>
      <pubDate>Sun, 21 Aug 2005 05:20:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/inside-the-java-virtual-machine/</link>
      <pubDate>Thu, 18 Aug 2005 11:03:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/firefox-shortcut-url-as-command-line-for-the-web/</link>
      <pubDate>Tue, 16 Aug 2005 13:42:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/hibernate-criteria-api-vs-hql-overhead/</link>
      <pubDate>Wed, 10 Aug 2005 14:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/how-to-become-a-javarss-member-on-blogger.com/</link>
      <pubDate>Fri, 05 Aug 2005 13:32:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-is-more-productive-than-rubyrails/</link>
      <pubDate>Tue, 26 Jul 2005 13:26:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/f%C3%A9minisme-et-statistiques/</link>
      <pubDate>Thu, 21 Jul 2005 12:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/ruby-python-javascript-lua-java-c-benchmark/</link>
      <pubDate>Wed, 20 Jul 2005 11:49:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/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://chasethedevil.github.io/post/jython-instead-of-ant-sample-code/</link>
      <pubDate>Sat, 16 Jul 2005 01:50:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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://chasethedevil.github.io/post/java-development-without-ant/</link>
      <pubDate>Tue, 12 Jul 2005 16:16:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/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>
    <item>
      <title>lion</title>
      <link>https://chasethedevil.github.io/post/lion/</link>
      <pubDate>Tue, 28 Jun 2005 17:00:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/lion/</guid>
      <description>&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://photos1.blogger.com/blogger/6384/1303/1600/top_lion.1.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/400/top_lion.1.jpg&#34; alt=&#34;&#34; border=&#34;0&#34; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;test</description>
    </item>
    <item>
      <title>This is who I am</title>
      <link>https://chasethedevil.github.io/post/this-is-who-i-am/</link>
      <pubDate>Sun, 19 Jun 2005 18:20:00 +0000</pubDate>
      <guid>https://chasethedevil.github.io/post/this-is-who-i-am/</guid>
      <description>&lt;a onblur=&#34;try {parent.deselectBloggerImageGracefully();} catch(e) {}&#34; href=&#34;http://photos1.blogger.com/blogger/6384/1303/1600/IMG_3839-1.jpg&#34;&gt;&lt;img style=&#34;float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;&#34; src=&#34;http://photos1.blogger.com/blogger/6384/1303/200/IMG_3839-1.jpg&#34; border=&#34;0&#34; alt=&#34;&#34; /&gt;&lt;/a&gt;</description>
    </item>
  </channel>
</rss>
