Archive for August, 2012

Mac: Limit TimeMachine backup interval

Tuesday, August 14th, 2012
sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int nnn

Where nnn is in second (e.g., 18000 for 5 hours) . Set to 3600 to reset default.

source

Java Guava Sorting

Sunday, August 12th, 2012
Comparator byLastName = new Comparator() {
    public int compare(final Person p1, final Person p2) {
        return p1.getLastName().compareTo(p2.getLastName());
    }
};
Comparator byFirstName = new Comparator() {
    public int compare(final Person p1, final Person p2) {
        return p1.getFirstName().compareTo(p2.getFirstName());
    }
};

List sortedCopy = Ordering.from(byLastName).compound(byFirstName).reverse().sortedCopy(persons);

Great article about Guava Function, Predicates, Sorting and filter HERE