Saturday, September 30, 2006

Which Java web framework you should choice?

Matt Raible at Virtuas made a presentation about some Java web frameworks, they are included Struts, Spring MVC, Tapestry, WebWork and JSF. He provided basic information about them and the criteria you should consider before choose any framework to work.

For this presentation, you can download it here.

And here you can find a series of interviews web framework authors did by Matt. Interesting interviews!

IntelliJ IDEA 6.0 Release Candidate 3 (build 5755) is available

At this time JetBrains only focuses in fixing critical bugs and improvement. This build has many good feedback from users. For changes in this build, you can see here.

Wednesday, September 27, 2006

IntelliJ IDEA 6.0 Release Candidate 2 (build 5745) is available

This is a bugfixes build with some minor improvements. For more details, you can see here.

I guess that IDEA 6 final will be released about October 15.

Batch Generator 1.1 is released

Change notes:
   New feature: Supports to generate hardcode arguments
Fixed bug: Need to reset return value of dialog if user click Cancel
Fixed bug: Some minor bugs

Batch Generator 1.1: plug-in, source code, license, user's guide, contest

Monday, September 25, 2006

And now is new feature for 1.2

If users generate batch file in current project's context which is under control of a VCS, Batch Generator should ask users to add the batch file to VCS.

At this time, it's only the idea because I need to research IDEA's OpenAPI also it will depend on my time. But I will try my best before the contest reaches to the end.

Plan for Batch Generator 1.1

After v1.0 is released, I found that Batch Generator should support users enter hard code arguments.

I will start the next release, v1.1, today and hope that it can be finished this weekend.

Update: At this time (September 26, 2006 12:18 AM), after about 3 days, Batch Generator is already downloaded 31 times (of course, I didn't download it 30 times ;-). I encouraged because I didn't think the download times of my plug-in is over 20. Maybe somebody will remove it after a try, but users can know about my plug-in's features via the user's guide. It's very simple plug-in but if it's not useful, nobody will give it a try.

Congratulation me ;-)

Sunday, September 24, 2006

How Can I Not Love You

How Can I Not Love You
Joy Enriquez

Cannot touch, cannot hold, cannot be together
Cannot love, cannot kiss, cannot love each other
Must be strong and we must let go
Cannot say what our hearts must know

Chorus:
How can I not love you
What do I tell my heart
When do I not want you here in my arms
How does one walks away
From all of the memories
How do I not miss you when you are gone

Cannot dream, cannot share sweet and tender moments
Cannot feel how we feel, must pretend its over
Must be brave and we must go on, must not say
What weve known all along

Chorus:
How can I not love you
What do I tell my heart
When do I not want you here in my arms
How does one walks away
From all of the memories
How do I not miss you when you are gone

How can I not love you

Bridge:
Must be brave and we must be strong
Cannot say what weve known all along

Chorus:
How can I not love you
What do I tell my heart
When do I not want you here in my arms
How does one walks away
From all of the memories
How do I not miss you when you are gone

How can I not love you
When you are gone

What's next?

After releasing Batch Generator, I've just had a new idea. At the first time when I had this idea, it aimed to resolve my own problem. Later I think it can help others too. It can be provided as a service or value-added product.

At this time, it's only the idea and you can only know it with the name "SSRSS".

Saturday, September 23, 2006

Batch Generator 1.0

I attended IntelliJ IDEAL plug-in contest with Batch Generator. It's my first IntelliJ IDEA plug-in. It's not complex enough to earn me $5000 plus a bunch of software but it's good enough to help me to have a new T-shirt. Beyond this, after a painful lesson, I learned a new lesson: When you have an idea, please do it, do it immediately. It's the biggest prize for me at this time.

Batch Generator 1.0: plug-in, source code, license, user's guide

For the idea to create this plug-in, you can see here.

Thursday, September 21, 2006

IntelliJ IDEA 6.0 Release Candidate 1 (build 5734) was released

JetBrains released IntelliJ IDEA 6.0 Release Candidate 1 (build 5734). Here are changes in build 5734 from 5706:

* Plugins. Included sources of GWT Studio, JBoss, Geronimo
and GlassFish plugins in the Plugin Development Package.
* Bugfixes and minor improvements.

Complete list of changes here

Update: New splash of IDEA 6. I like it than the old one in IDEA 5, it looks more professional

Bài học tiết kiệm của người Hàn

Hôm kia và hôm nay công ty có chuyện lạ. Chẳng hiểu sao mấy thằng ở công ty lại vác cơm đi ăn trong khi bình thường cả lũ vẫn kéo nhau ra ngoài. Mấy thằng Việt ngố chẳng hiểu gì cứ đoán già đoán non: "Chắc chúng nó có việc gì bận nên ăn vậy cho nhanh". Hôm nay, mình cũng thử ngồi ăn với chúng nó xem sao.

Mẹ kiếp, cơm gì mà lèo tà lèo tèo toàn thứ vớ vẩn. Tí thịt, tí trứng còn toàn là rau linh tinh. Những thứ được nhồi vào bụng nhiều nhất là một hộp mì ăn liền và một hộp cơm (cơm hộp bên này có loại giống như nấu sẵn vậy, hâm nóng lên là ăn luôn, mà là cơm không thôi nhé).

Hỏi Park xem hôm nay có phải ngày gì đặc biệt không (tại sắp tới là Chusok - trung thu, mà trung thu của người Hàn thì to như Tết, nghỉ tận 3 ngày liền). Park bảo không phải. Hỏi tại sao lại tự nhiên cả lũ lại ăn như vậy, Park bảo, "Tao đếch biết". Hỏi Nam, Nam bảo chẳng phải ngày đếch gì đặc biệt cả, "bọn tao đang thử nghiệm để saving money".

Ăn thì đói mờ mắt ra, thế mà còn học đòi saving money. Đã muốn saving money mà còn không dám nhận. Thay vào đấy chúng nó bớt hút thuốc lá đi, rồi nhồi cơm, nhồi thịt vào có phải saving được tốt hơn không. Nhưng nhìn bọn nó cũng ngãm lại ở VN mình. Quan trên thì phè phỡn, dân cũng phung phí tơi bời. Riêng điều này đáng để học tập dân Hàn đấy ;-)

Tuesday, September 19, 2006

Getting file extension

Java doesn't give you a way to get the extension of a file so you must do it yourself.

Usually you will get the position of the dot then use it to extract the extension. But it is not a correct way. Why? Because it depends. Depends on what? Depends on you and the OS you target.

If you use Windows, it's OK. Files in Windows can have extension. But in *nix, it's a different story. So you target to run your application both in Windows and *nix, you should consider this problem.

If your application target to run on Windows only, it's fine if you use the position of the dot to extract the extension (but remember, you must use lastIndexOf("."), not indexOf(".") because in Windows, extension will be determine by the position of the dot and from right to left of filename, not from left to right).

The below code fragment runs well in Windows and Linux.

public String getExtension(File file) {
String osName = System.getProperty("os.name");

if (osName.startsWith("Windows")) {
String filename = file.getName();
int index = filename.lastIndexOf(".");

if (index > 0 && index < filename.length() - 1) {
// extesion in Windows doesn't include the dot
// so we must use (index + 1) to substring
return filename.substring(index + 1).toLowerCase();
} else if (index == filename.length() - 1) {
// the dot is the last character in filename
// so extension is blank
return "";
}

// otherwise, this file doesn't have extension
// so we should return null
}

return null;
}


Update: Correct the source code

1-to-0..* and 1-to-1..*

This afternoon I think about how can I represent 1-to-0..* and 1-to-1..* relationship between objects.

First, I should describe what are 1-to-0..* and 1-to-1..*. 1-to-0..* means 1 object of this class can have relationship with 0 or more objects of another class. And 1-to-1..* means 1 object of this class can have relationship with 1 or more objects of another class.

A tourist guide can guide zero or more tours. But an order, it must contains at least one order item. In contrary, a tour and an order item cannot exist without tourist guide and order.

Of course, in TouristGuide class and Order class should contains a collection to keep the tours and order items. But how to represent the 1-to-0..* and 1-to-1..* relationships? User can call getTours() or getOrderItems() any time he wants.

I think in 1-to-0..* relationships, when user invokes getTours() on a TouristGuide, he can have a collection contains no element if that TouristGuide doesn't have any Tour to guide. But in 1-to-1..* relationthips, when user invokes getOrderItems() on an Order, he can have a null value if that Order didn't contain any OrderItem yet.

class TouristGuide {

private ArrayList<Tour> tours = new ArrayList<Tour>();

public ArrayList<Tour> getTours() {
return tours;
}

public void addTour(Tour tour) {
tours.add(tour);
}

...

}

class Order {

private ArrayList<OrderItem> orderItems;

public ArrayList<OrderItem> getOrderItems() {
return orderItems;
}

public void addOrderItem(OrderItem orderItem) {
if (orderItems == null) {
orderItems = new ArrayList<OrderItem>();
}

orderItems.add(orderItem);
}

...

}

IntelliJ IDEA 6 build 5706 was released

Yesterday night, after I went to sleep about 15 minutes, JetBrains released IntelliJ IDEA 6 build 5706. It's a bug fixed build. For more details, you can see here.

JetBrains will focus on fix Critical and Blocker priority bugs rather than implement new features. Also, lower priority bugs will be fixed after releasing IDEA 6.

IDEA 6 RC1 will come soon...

Other news relate with SVN and TestNG:

   + TortoiseSVN 1.4 was released last Friday
   + JavaSVN will support SVN 1.4 in next release
   + TestNG 5.2 was released 2 days ago also with an update for TestNG-J.

Preparing to release

I've just finished the first version of my project 5 minutes ago. Now I can take a rest with some breads and a little of milk.

What're next steps? Hmmm, I need to choose the license and write some documents. Hope that I can release it this weekend :-)

Go to sleep now...

Saturday, September 16, 2006

An old opportunity

Tonight, here and alone, I just remember an opportunity I missed in the past. I think it was a good opportunity, but I didn't catch it when I could and now I must regret.

4 years ago, I graduated the university and started to work at Hobo Hanoi. It's a small company with about 15 members. There was a place I will keep it in my memory for a long time where I had the first job, where I improved my little knowledge and my experience.

Most of jobs I did in Hobo Hanoi at that time relate with NorthShore project (more extractly, some projects). It's a real state management system for NorthShore Inc. and we deveploped a client/server version (with Visual Basic) and 3 web versions (2 with ASP, 1 with Java). The Java version started but never finish. The most interesting things are in 2 ASP versions: The client required us to develop a "grid style" form to support they enter data.

We did it. It's not perfect solution but it's good enough to satisfy client's requirement. Our "grid" can enter text, number, date (with validation and format), calculate total for "number" column (result will be showed in footer). It can has combo box columns, also radio button and checkbox. It supports dependency between columns (example: when you change this combo box, values of the depended combo box will be changed). It only update the rows you changed. You can delete some rows at one time. Also you can add a new row on the "grid" (don't need to use another form). But it's very hard to reuse because we didn't implement it as a component. And now you can guess what was my opportunity.

At that time, as I searched, there was only one grid component for ASP, ASPGrid. But they only supports in basic level (enter text, number, date with validation and format, combo box column). They created a ActiveX component and use an XML configuration file. All the things developer need to do is creating an XML configuration file and do Server.CreateObject() in ASP pages. Developers don't need to use Response.Write() to write the grid out 'cause ActiveX component did it.

I implemented a very simple ActiveX component, it supported to enter text only (no validation, no combo box, no format,...) But I threw it away, at that time .NET Framework is released in beta. I decided to move to Java 'cause at that time in Java field, there wasn't any "grid" component. (display:tag can show data only with sorting). I read JSTL, JSP tag libraries. But... Now I must regret.

Some days ago I have an opportunity to move to another company, they work in RIA (Rich Internet Applications - more detail: Java/Flash/Flex). But I decided to stay. I'm having a challenge (at current company) and I want to win it. If I win, it will open a big opportunity for me. But if I fail, no problem, I will have a good lesson and I will find another one.

Friday, September 15, 2006

How to read a specification?

These days, I need to do a research on EPCIS specification. It's the first time I read a spec carefully (I played with JLS but in a "overview" way). I tried to read the spec likes I want to eat each by each words. But it's very slow and the spec is really hard to remember. I decided to find a better way to read a spec.

Here is an article can help you to read a spec easier. Even though it focuses on W3C specs, but it still provides some useful information. And another one for functional spec.

Thursday, September 14, 2006

Blogger added label

Seems today Blogger added supporting for labels, somebody will familiar with it by "tag". During the upgrading process, you can't browse blogs even though you can post, edit blog items.

I think they should provide supporting to add label for old blog items. At this time you need to edit each item to set its label.

IntelliJ IDEA 6 build 5692 is released

About 38 minutes ago, JetBrains released IDEA 6 build 5692. Here are changes in build 5692 from 5661:

* JavaScript. Bundled Inspection-JS plugin.
* Java EE. Bundled JBoss, Geronimo and GlassFish plugins.
* Bugfixes and minor improvements.

More details, see here.

Wednesday, September 13, 2006

Subversion 1.4.0 was released

3 days ago, Subversion 1.4.0 was released. But at this time, there aren't any SVN clients support for Subversion 1.4.0 (TortoiseSVN 1.4.0 still release candidate and compiled for Subversion 1.4.0 RC4)

Here is Subversion 1.4.0 release notes.

Tuesday, September 12, 2006

StringEx 0.2.2 and t800t8.net

Sorry to take you wait in a long time, today I decided to publish StringEx 0.2.2 source code, tests and binary files. You can download it here.

And a new news, t800t8.net will come soon. I hope it will not late like StringEx 0.2.2 ;-)

Saturday, September 09, 2006

Hamburg song - a very sad song

Hamburg song
Kean

I don't wanna be adored
Don't wanna be first in line
Or make myself hurt
I'd like to bring a little light
To shine a light on your life
To make you feel loved

No, don't wanna be the only one you know
I wanna be the place you call home

I lay myself down
To make it so, but you don't want to know
I give much more
Than I'd ever ask for

Will you see me in the end
Or is it just a waste of time
Trying to be your friend
Just shine, shine, shine
Shine a little light
Shine a light on my life
Warm me up again

Fool, I wonder if you know yourself at all
You know that it could be so simple

I lay myself down
To make it so, but you don't want to know
You take much more
Than I'd ever ask for

Say a word or two to brighten my day
Do you think that you could see your way

To lay yourself down
And make it so, but you don't want to know
You take much more
Than I'd ever ask for

Thursday, September 07, 2006

IntelliJ IDEA 6 build 5661 was released

I miss this new version when it's out yesterday 'cause at that time I was learning to write a plug-in for IDEA. I only know JetBrains released it today.

Here are changes in build 5661 from 5650:

* CVS. Offline mode support.
* Intention to create enum constant.
* Bugfixes and minor improvements.

More details you can see here.

You can download it here (required registration)

Wednesday, September 06, 2006

IntelliJ IDEA plug-in contest's T-shirt


Do you like these T-shirts? I don't like them very much. I hope that JetBrains will change them.

A suggestion: Why don't make a "Plug with pleasure" T-shirt (with an IDEA icon)?

Check required arguments for batch files

Sometimes you need to create a batch file (*.BAT, *.CMD) to run a Java application, but your application need to pass some arguments from outside. It will be better if you can provide the arguments from command prompt instead using hard code inside the batch file. At that time, you should provide some basic logical to check the number of arguments you pass into the batch file.

Of course, it cannot replace logical to check required arguments inside your Java application ('cause user can run your Java application without the batch file). But it can provide a more flexible way to run Java application.

And here is your solution:

HelloKitty class requires to pass 2 arguments, they're presented by %1 and %2 and assume that you store this code segment into hello.bat

@echo off
if "%2"=="" goto error

java HelloKitty %1 %2
goto end

:error
echo Usage: hello arg1 arg2

:end

Tuesday, September 05, 2006

H2 1.0 is out

A very fast, small, new open source database from Hypersonic author is out, H2. It has a very nice feature: web client with supporting for i18n (English, German, French, Spanish, Chinese)


Performance
(source: http://www.h2database.com)

Saturday, September 02, 2006

IntelliJ IDEA 6 build 5650 was released

Yesterday night, when I was drinking with my friends, JetBrains released IntelliJ IDEA 6 build 5650. Here are changes in build 5650 from 5646:

* GUI Designer. Better GridBagLayout support (all properties of
GridBagConstraints are now editable).
* JUnit. Intenion to add junit.jar to classpath.
* Bugfixes and minor improvements.

For more detail, you can see here.

Now, after waking up with a heavy head (I drank a lot of beer and whisky), I have something to play with :-)

Friday, September 01, 2006

JUnit 4 vs. TestNG

An interesting article from Andrew Glover. You can find it here.

Linspire makes Click and Run FREE

Read it here. A good news for any Windows users want to move to Linux.

I'll give it a try :-)