Skip to main content

Posts

Showing posts from August, 2012

Transform singular and plural forms of words (not WordNet)

import java.util.HashSet; import java.util.LinkedList; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Transforms words to singular, plural, humanized (human readable), underscore, camel case, or ordinal form. This is inspired by * the Inflector class in Ruby on Rails , which is distributed under the Rails license . * @author Randall Hauch * */ public class Inflector { protected static final Inflector INSTANCE = new Inflector(); public static final Inflector getInstance() { return INSTANCE; } protected class Rule { protected final String expression; protected final Pattern expressionPattern; protected final String replacement; protected Rule(String expression, String replacement) { this.expression = expression; this.replacement = replacement != null ? replacement : ""; this.expressionPattern = Pattern.compile(this.expression, Pattern.CASE_INSENSITIVE); }

Web application monitor tool

Ganglia http://ganglia.sourceforge.net/ JConsole http://docs.oracle.com/javase/1.5.0/docs/guide/management/jconsole.html jstack http://docs.oracle.com/javase/1.5.0/docs/tooldocs/share/jstack.html http://www.herongyang.com/Java-Tools/jstack-Detect-Java-Thread-Deadlocks.html jmap http://www.herongyang.com/Java-Tools/jstack-jmap-Generate-Heap-Dump-File.html htop http://htop.sourceforge.net/ visualvm http://visualvm.java.net/