Wednesday, March 17, 2010

op4j - a useful java library

op4j is a cool java library with lots of nice features. Let's hear the definition of op4j from the official website;

It is a Java library aimed at improving quality, semantics, cleanness and readability of Java code, especially auxiliary code like data conversion, structure iteration, filtering, mapping.

These are the features of the library (again, from the website):


  • Apply functions on object:
    Including more than 200 predefined functions for data conversion, string handling, calendar operation, math operations, etc...

  • Manage structures (arrays, lists, maps and sets), including:
    Easily creating them from their elements (building).
    Modifying them (adding / removing / replacing elements).
    Iterating them, applying functions on each element.
    Transforming them into other structures.

  • Execute conditional logic (execute actions depending on conditions).

  • Define functions from expressions, for later use (similar to closures).


I recommend the reading of the op4j presentation here for further information.

Wednesday, March 3, 2010

old versions of applications

Didn't you sometimes feel the need to use an older version of an application instead of the current version? If your answer is yes, then a time-consuming adventure lies before you. Or you can check two websites I'll recommend. OldVersion.com and OldApps.com are there to help you in your quest for older versions of popular applications.

Wednesday, December 30, 2009

string manipulation in java part 1: reverse a string

In these series, I'll try to provide code fragments for daily problems in string manipulation. First, we will see how to reverse a string. Note that there are -naturally- more than one way to do this.


public class StringUtils {
public static String reverseString(String string){
/*
Check if the string is not null and empty
*/

if(string != null && !string.isEmpty()){

/*
Create a StringBuilder from the string in hand
*/

StringBuilder str = new StringBuilder(string);

/*
Reverse the StringBuilder content and return it as a String
*/

return str.reverse().toString();
}
return null;
}

public static void main(String[] args){
System.out.println(StringUtils.reverseString("I am your father"));
}
}



Output is "rehtaf ruoy ma I".
It is possible to use StringBuffer instead of StringBuilder. As I don't need thread safety I'll pick StringBuilder which's faster. Quite easy to reverse a string, right?

Tuesday, December 29, 2009

listen to free music online

I talked about justhearit which's a music streaming service. Grooveshark is a great alternative to justhearit. The design of the website and the music archive are awesome. Check it!

Monday, December 28, 2009

change your status in multiple social networks

You can change your status in multiple social networking websites (facebook, myspace, twitter, plurk, linkedin, tumblr, hi5, plaxo ) using quub. Quite practical for those who actively use multiple networking websites.