If you are using c3p0 for db connection pooling and also using Java 6, be sure to use version c3p0-0.9.5-pre8, no the latest version c3p0-0.9.5-pre9. Starting from version c3p0-0.9.5-pre9, c3p0 interface com.mchange.v2.c3p0.PooledDataSource extends from Java 7’s java.lang.AutoClosable, so c3p0 c3p0-0.9.5-pre9 cannot run on Java 6. See source code 0.9.5-pre9 and 0.9.5-pre8 for the difference.

Sometimes we need to calculate the size of a certain text for layout purpose, even though generally this is not a good practice. For example, we may want to place the text’s center in certain position.

The generic technique is quite simple, just create an invisible block containing the text and calculate its size, as shown in CoffeeScript code below.

Read on →

It has been a long time since I updated the iOS app, so I need to upgrade it to be working with iOS 8.1. Below are some issues I found during the upgrade.

InAppSettingsKit

InAppSettingsKit needs to be updated to version 2.1, otherwise it will have compilation error. Use pod update InAppSettingsKit to update.

ABPeoplePickerNavigationController

A new delegate method needs to be implemented, otherwise clicking a person’s phone number will call this person. See this StackOverflow question.

ABPeoplePickerNavigationController new delegate method
1
2
3
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
    [self peoplePickerNavigationController:peoplePicker shouldContinueAfterSelectingPerson:person property:property identifier:identifier];
}
Read on →

When I was trying to start a new release using Maven jgitflow plugin, it always complained about Working tree has uncommitted changes. I checked Git repository using git status -s and it seemed that all changes had been committed. I even tried to use git clean -f -d to clean all untracked files, even though I’m pretty sure that I already configured jgitflow to allow untracked files using <allowUntracked>true</allowUntracked>. But still no luck.

Read on →

Writing files to Hadoop HDFS should be that hard, but I searched and tested different approaches and finally got it working.

Use correct version of Hadoop client

The version of Hadoop client must be the same as Hadoop server version. For example, if you are using Hadoop 2.5.1, then Hadoop client must be the same version 2.5.1.

sbt file
1
libraryDependencies += "org.apache.hadoop" % "hadoop-client" % "2.5.1"
Read on →

When I was searching for open source solutions for better JMX support, I found out Jolokia and Hawtio is a very powerful combination. So I planned to to use them in my project. One major goal to achieve is to manage Quartz jobs. Hawito already has a Quartz plugin to support that, but the plugin has a bug which prevents it from listing Quartz jobs with JobDataMap and a PR already exists. I cannot wait for this PR to be merged and new version is to be released. So I decided to create a local build with that PR.

Read on →