Understanding the merging in Subversion

While the basic work cycle of update/resolve/commit in Subversion is easy peasy for almost everyone, merge is a lot more confusing. This post shows how the common merging tasks can be accomplished using Subclipse in Eclipse with the understanding of the merging in terms of fundamental Subversion functionalities.

Reading Effective Java Second Edition by Joshua Bloch, Prentice Hall (2008)

Joshua J. Bloch (born August 28, 1961) is a software engineer, currently employed at Google, and a technology author. He led the design and implementation of numerous Java platform features, including the Java Collections Framework, the java.math package, and the assert mechanism. He is the author of the programming guide Effective Java, which won the 2001 Jolt Award, and is a co-author of two other Java books, Java Puzzlers (2005) and Java Concurrency In Practice (2006).

Given that a foo is a bar, why is a foo collection not a bar collection?

In Java, while arrays are covariant, collections are invariant. For example, given that a Foo is a Bar, while we have a Foo[] is a Bar[], we do not have that a Collection<Foo> is a Collection<Bar>. This implies that we cannot pass in a Collection<Foo> where a Collection<Bar> is needed. Why?

Explicit type parameters for generic methods

Generic methods provide a great convenience that the compiler does the type inference on them. In most cases, we can call a generic method without specifying actual types for the type parameters. However, there are some cases the type inference does not work. In these cases, we need to specify explicit type parameters.

Insidious error in date time arithmetics

Suppose that we need to write a program to get the date which is exactly 50 days before now. What we can do is that we get the epoch time of now, and shift backward for 50 days. It looks that the code is easy to write, but it is usually hard to avoid some insidious error and get the correct result the first time you write the code.

Curiously recurring template pattern and visitor implementation in C++/Java

The curiously recurring template pattern (CRTP) is a C++ programming idiom that powers the static polymorphism, the policy-based design and many other metaprogramming techniques. Here we try to apply CRTP to Java, implementing the visitor pattern in a similar way to a C++ implementation. We compare the behavior between the implementation, and explain how the differences in behavior could be understood in terms of the differences between C++ templates and Java generics.

Understanding the evolvable POF objects in Coherence

Portable Object Format (POF) is a serialized format more efficient, more compact, and language agnostic, compared to the standard serialized format in Java. POF supports evolvable objects, i.e., the classes of these objects can be hot upgraded without shutting down Coherence.

New XSL stylesheet for JMeter command line results report

Convert your JMeter .JTL output files to .HTML files themed with Apple Mac OS X look and feel.

Select distinct days from a date column in oracle database

Say now we have a requirement that there is a "created" column of DATE type in the "blogs" table that records the time stamp a blog is posted, and we need to display a list of days that have blog posts. In Oracle, we can use DATE functions to achieve this.

Filter ordering for GeSHi filter

Use the order "HTML filter > GeSHi filter > Line break converter" to ensure standard compliant markup.