java io class hierarchy diagram

The large number of classes in the Java IO package is overwhelming and annoying. However, if we use Java, we still need to understand those classes. In fact, the classes in Java IO package is not very complex, but we need a good way to learn those. There are two important factors for understanding the … Read more

Parse HTML in Java

This code example shows how to parse HTML in Java by using jsoup. As there are many libraries for various purposes, there are a lot of html parser in Java. A lot of developers wonder which one is the best before they made a decision on an HTML parser. Jsoup is a very good start. … Read more

OpenNLP Tutorial

The Apache OpenNLP library is a machine learning based toolkit for processing of natural language text. It includes a sentence detector, a tokenizer, a name finder, a parts-of-speech (POS) tagger, a chunker, and a parser. It has very good APIs that can be easily integrated with a Java program. However, the documentation contains unupdated information. … Read more

Research in Software Engineering – Available Data/Artifacts

For software engineering research, there are various kinds of data available for analysis. Those are called software artifacts and they can be generated during any stage of software lifecycle, such as design, development, testing, maintenance, etc. This is the directory of artifacts available and their download addresses. I have done investigation on different kinds of … Read more

LeetCode – K Empty Slots (Java)

Given a garden with N slots. In each slot, there is a flower. Each of the N flowers will bloom one by one in N days. In each day, there will be exactly one flower blooming and it will stay blooming since then. Given an array of numbers from 1 to N. Each number in … Read more

LeetCode – My Calendar II (Java)

Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking. Your class will have one method, book(int start, int end). Formally, this represents a booking on the half open interval [start, end), the range of real numbers x such that start

Swing vs. SWT – Side-by-side comparison

In many articles, developers have compared Swing with SWT with a lot of details. However, there is not a side-by-side comparison by using a diagram which may give a direct impression of how they are different. In this post, I will compare Swing and SWT side by side and get a taste of the difference … Read more

LeetCode – Next Closest Time (Java)

Given a time represented in the format “HH:MM”, form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused. You may assume the given input string is always valid. For example, “01:34”, “12:09” are all valid. “1:34”, “12:9” are all invalid. Example 1: … Read more

Java vs. Python (1): Simple Code Examples

Some developers have claimed that Python is more productive than Java. It is dangerous to make such a claim, because it may take several days to prove that thoroughly. From a high level view, Java is statically typed, which means all variable names have to be explicitly declared. In contrast, Python is dynamically typed, which … Read more

Error message during installation of PyDev for Eclipse

Eclipse version: Indigo Platform: Ubuntu 11.10 Error message: An error occurred while collecting items to be installed session context was:(profile=epp.package.java, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository found containing: osgi.bundle,javax.mail.glassfish,1.4.1.v201005082020 This is possibly caused by in compatible eclipse version. If we use Help -> Eclipse MarketPlace to install PyDev, the problem is gone.