IntelliJ Idea 10 Early Acces Program is here

Today, the Early Access Program (EAP) has been opened for IntelliJ Idea 10.

There is a lot of changes, here are some of them (the most interesting in my point of view) :

  • Faster indexing speed
  • Java - Faster method usage search
  • Spring Web Services support
  • Spring testing support
  • New Spring live templates (patterns and frameworks)
  • intelligent resources support (smart completion and warnings for resource types)
  • Maven Refactorings
  • Maven pom.xml editor new features
  • Maven Dependencies Diagram
  • Discover & download libraries from maven repositories even in plain java projects
  • XML editing improvements in IntelliJ IDEA X
  • Git support improvements, including 'Git Log' view.
  • Mercurial support
  • Hibernate Criteria API supported
  • JDBC Console UI revised
  • Initial support for AspectJ and Spring Roo frameworks
  • A lot of other interesting features

To consult the full list of new features, read the release notes. And if you want to test this version, download it here.

Discover Java VisualVM 1.3

2 days ago, Java VisualVM 1.3 has been released. We'll see what's new with this release.

At this time, there is no package for Ubuntu, so we'll install it manually :

wget https://visualvm.dev.java.net/files/documents/7163/151728/visualvm_13.zip
unzip visualvm_13.zip

And then we can directly launch it :

cd visualvm_13/bin
sh visualvm

You'll be asked for the license agreement and after that the tool is launched :

VisualVM 1.3 Startup

Read more…

Top 15 Best Wordpress Plugins

When working on a Wordpress site or blog, it's essential to install several plugins to optimize the site readibility, accessibility, performances, ...

Here are 15 plugins that I think the best of the Wordpress plugins and that I use everyday. The list is not in interest order but in alphabetical order.

Akismet - Avoid spam

This plugin automatically filters spams for you. It's really simple, you just have to install it and it works great. In my little blog, it filters more than hundred spams a day.

Akismet Stats

Read more…

Tip : Optimize images on Ubuntu Linux

When working with a lot of images by example for galleries on a website, it could be really interesting to optimize the images to save a lot of space and directly improve the performances of the website and save some traffic if this is limited by your hosting.

Optimize JPEG images with jpegoptim

A great tool to optimize JPEG images is jpegoptim. It's a simple command line tool available as Ubuntu package. You can install it easily :

sudo apt-get install jpegoptim

And it's also really simple to use. First, to optimize an image without loss :

jpegoptim image.jpg

Or with a loss of max 25% :

jpegoptim --max=75 image.jpg

More informations on the official site.

Optimize PNG, BMP and GIF images with optipng

An other tool to optimize other types of images is optipng. Here again you can install it with apt-get :

sudo apt-get install optipng

It's as easy as the first tool :

optipng image.png

You can also configure the tool to use the best optimization level, but also the slowest :

optipng -o7 image.png

So here we are : You have now enough informations to optimize all you images on Ubuntu. I hope this will be useful to somebody.

IntelliJ Idea 9.0.3 is here !

A new version of IntelliJ Idea is available : IntelliJ Idea 9.0.3

  • A new UI for merging Subversion branches
  • A new tool to store encrypted passwords for VCS, proxy server etc.
  • A lot of bugfixes, more than 350
  • The HTML editor comes with initial support for HTML 5
  • The Flex debugger has been improved a lot
  • This version supports now Grails 1.3.x
  • Several little performance improvements in specific part (XHTML editing by example)

The change notes are available on the site of JetBrains.

You can download it from now and install it manually or just launch Idea and the patch will be downloaded and applied.

Tip : Profile an OSGi application with VisualVM

When you develop applications and you've performance problems, it's really interesting to see what can cause this problems. And it that case, the profilers are the most useful tool. By example, we can use VisualVM, packed by default with the Java Virtual Machine. For more information, you can read this introduction to Java VisualVM.

But, when you work with OSGi application, it's not as simple as a normal application. The profiler needs that its class can be found by the profiled classes, but with OSGi, the classloader are restricted by the framework and the classes of the profiler cannot be found.

Read more…

Play Framework - The template engine

In the previous post about Play Framework, we seen how to install Play and create a first simple application. In this post, we'll see how to customize the views and use the template engine of the framework to easily create web pages.

Play has its own template engine to generate HTML web pages. The template engine use Groovy as expression language. You will use Groovy language to create all the dynamic parts of the web pages. But there is no need to learn completely Grooxy, it's really close to Java and if you know already knows Java, there is no problem to use Groovy in your templates. All the templates are located in the app/views folder in your application. All the dynamic part of the web page is resolved during the execution of the template and the result is a part of the HTTP Response.

Read more…

OSGi - Simple Hello World with services

In this post, we'll develop a simple Hello World application with OSGi. We will use Felix as OSGi container. In the next post, we'll continue with this application and use Spring Dynamic Modules to improve it.

To make the development interesting, we will create two bundles :

  • A bundle providing a service of HelloWorld
  • A bundle consuming the service to print hello at regular interval time.

Read more…

State of the Lambda

Brian Goetz, from Oracle, has posted an updated proposal for the lambda expressions : State of the Lambda

Here are some examples of closures taken from the proposal :

We can use lambda expressions to replace the heavy usage of Single Abstract Method (SAM) interfaces :

public interface CallbackHandler { 
    public void callback(Context c);
}

CallbackHandler cb = { c -> System.out.println("pippo") };

We can make references to methods to use it as SAM interfaces :

class Person { 
    private final String name;
    private final int age;

    public static int compareByAge(Person a, Person b) { ... }
    public static int compareByName(Person a, Person b) { ... }
}

Person[] people = ...

Arrays.sort(people, #Person.compareByAge);