Static Import in Java

In order to access static members, it is necessary to qualify references with the class they came from. For example, one must say:

double r = Math.cos(Math.PI * theta);

In order to get around this, people sometimes put static members into an interface and inherit from that interface. This is a bad idea. In fact, it's such a bad idea that there's a name for it: the Constant Interface Antipattern(see Effective Java Item 17). The problem is that a class's use of the static members of another class is a mere implementation detail. When a class implements an interface, it becomes part of the class's public API. Implementation details should not leak into public APIs.

Record audio with Java

Today, I write a small tutorial which record audio.

Language: Java

Platform: MacOS, Linux, Windows

Co Ba La (1)

Thẻ Technorati: ,

Integrate SyntaxHighlighter to Blogger, Blogspot

If you are a developer & want to share your code over the blog with proper highlighting & syntax, then Blogger/Wordpress doesn't have any feather like that
using System;

namespace HelloWorld
{
    class Hello
    {
        public static void Main(String[] args)
         {
             Console.WriteLine("Hello World");
         }
    }
}
There are many javascript library which allow us to do that. Now I'll show you how to integrate one into your blog.

Hello World

Hello World.