Skip to content

Tag Archives: java

Split Pascalcase String

11-Sep-09

Do you ever need to split a camel case or pascal case string to a set of words? This can be achieved simply by regular expressions in Java as well as C#. The following code is for Java: String camelCase = “StructuralDesignPattern”; StringBuffer label = new StringBuffer(camelCase + 10); java.util.regex.Pattern p = java.util.regex.Pattern.compile(“[A-Z][a-z]+”); java.util.regex.Matcher m [...]

Unreachable code Error or Warning?

08-Jul-09

In Java, unreachable code is treated as compilation error. What do you think? Isn’t making it warning would have made developers’ life simpler? Of course you can write – if( true )    return; What if you could simply write return. This helps in testing a function quickly. As a good programming practice we always remove [...]

Setting up SDB for MySQL

21-Jun-09

Jena is a semantic web framework implemented in Java. It allows you to store/query/inference RDF/RDSF/OWL triples. In Jena a set of triples (in RDF) are called Model or stored within Model object. By default Jena creates in-memory models, but this is not suitable if you have pretty large set of triples to process. Here comes [...]

Setting Default JVM on Ubuntu

21-Jun-09

Heard of ‘update-alternatives’ on Linux? It’s a smart utility to find various versions of one software and set default. For example, you may have GNU Java as well as Sun Java. (frankly saying, I hate GNU Java, aka gcj) sudo update-alternatives –config java [ Where can I see all installed JVM? On Ubuntu, Java Virtual [...]