Taking a walk on our big virtual world I found this nice page http://elements.wlonk.com. which contains fun periodic tables which can be a great help to remember the elements.

As the page says: These colorful, fun, and informative periodic tables are great for elementary, middle, and high school students, as well as adults.

There are two kind of syntax hightlighters for a web place, those who run on the server side and those who run in the client side.

The first group depends on your server, if you are using plain HTML pages or any CMS or blog system (Wordpress, Drupal etc). When you request a page, the server side code highlighters colorizes your text in the appropriate way and returns it to the clients.

In the opposite, the client side code highlighters are, basically, a pice of JavaScript code that is loaded with your page, scan your code and highlight the specified blocks. All the work is done by the client, the browser.

In summary, this post is all about to point to the Alex Gorbatchev syntax highlighter a very nice client side solution, which among other things has:

  • Support for a great number of languages: C, Java, Bash, XML, Perl, PHP, ...
  • Collapsible code option
  • Line numbers
  • Wrap lines
  • ...and many more
You can see it in action on this blog :)

If like me, you need to parse some text using regular expressions and it must be done in a casi insensitive way, here is the trick you are looking for.

If you use the Pattern class approach, then add the Pattern.CASE_INSENSITIVE flag:

Pattern p = Pattern.compile("YOUR_REGEX", Pattern.CASE_INSENSITIVE);

If you prefer to use the String.matches() method, then use the ?i flag in the regular expression:

"XYZxyz".matches("(?i)[a-z]+")

I want to note I found this help on: http://blogs.sun.com/xuemingshen/entry/case_insensitive_matching_in_java.

Recently I started working with Jetty. I have never used it, always working with Tomcat and my dear GlassFish.

One of my first problems with Jetty was about the symbolic links in Linux. Usually, while developing, I like to have my code organized in some directories and my servers in others. Then I create a simlink from the webapps Jetty's folder to my project folder. But that strategy fails initially in Jetty.

Taking a look in the FAQ pages found here and here, you can read that:

Jetty by defaults runs in a mode where all file accesses are checked for aliases, such as case insensitivity, short names, symbolic links and extra characters (Eg %00). If a resource is an alias, then it is treated as not found.

There are, or at least I know two solutions.

  1. Start Jetty by command line and specify the property value, like: java -Dorg.mortbay.util.FileResource.checkAliases=False -jar start.jar
  2. Adding it as an initialization parameter in the webdefault.xml file:
    default org.mortbay.jetty.servlet.DefaultServlet . . . aliases true . . .
No doubt to put any comments.
Too much time without write anything, and unfortunately I continue without time to write more. This post is only to point to a very interesting link that talks about JPA and the problems of the concurrency when persisting entities.

Some time ago I started reading about GTD "philosophy". GTD is easy to follow and effective in your day by day. In my case it helps me a lot at work, improving my organization and the problem resolution. Like other methodologies the difficult isn't in the methodology itself but in ourself, that is, we now what are the "right steps" but forgot to follow them. Here I point three little tools can help with your day by day (applying GTD):

All three are based on the TiddlyWiki (imagine a HTML page that modifies itself). In the case of 'd3' you have an util calendar to put your reminders.