RSS feed [root] /weblog /java



title search:


Wed Jun 23 23:53:07 AEST 2021


(google search) (amazon search)
download zip of files only

Wed Nov 22 22:38:38 AEDT 2006 From /weblog/java/concurrency


An article introducing using K-mean algorithm in Java -

(google search) (amazon search)

Sun Nov 12 02:43:25 AEDT 2006 From /weblog/java/discussion


Some interesting points, but I guess this guy will improve his productivity after familiar with java environment? -[..]tsort=0&tid=156&mode=thread&cid=13845934

(google search) (amazon search)

Sat Nov 11 21:03:05 AEDT 2006 From /weblog/java/hacks

bitwise operation on boolean

bitwise operation on boolean

The solution to the puzzle is given in the Java Language Specification, chapter 15.22.2:
15.22.2 Boolean Logical Operators &, ^, and |
When both operands of a &, ^, or | operator are of type boolean, then the type of the bitwise operator expression is boolean.
For &, the result value is true if both operand values are true; otherwise, the result is false.
For ^, the result value is true if the operand values are different; otherwise, the result is false.
For |, the result value is false if both operand values are false; otherwise, the result is true.

Someone mentioned that there is no boolean, byte and short in byte code level, all just integer

(google search) (amazon search)

Tue Nov 07 16:11:24 AEDT 2006 From /weblog/java/hacks


Prevent System.exit() being call - Usually security manager forbid it

(google search) (amazon search)

Tue Oct 31 20:16:31 AEDT 2006 From /weblog/java/network

low level tomcat io

If you really stick to tomcat, then it might be useful for you

(google search) (amazon search)

Fri Oct 20 18:17:39 AEST 2006 From /weblog/java/annotation


An idea to transform annotation at runtime -

(google search) (amazon search)

Fri Oct 20 18:00:52 AEST 2006 From /weblog/java/swing

drag and drop

How to be done at SWT -

(google search) (amazon search)

Thu Oct 12 20:20:38 AEST 2006 From /weblog/java/performance


Improving performance in distributed Web applications

* Keep the session minimal - generally a bad idea to store shared objects in the session.
* Don't bypass setAttribute - if you just call getAttribute() to retrieve the Vector and then add something to it without then calling setAttribute again, the container might not realize that Vector has been changed.
* Use fine-grained session attributes - finer-grained objects in the session rather than one big monolithic object.
* Invalidate when done - call HttpSession.invalidate()
* Keep the session clean - remove reference to unuse thing to help GC

(google search) (amazon search)

Thu Oct 12 19:08:54 AEST 2006 From /weblog/java/network

post at java code

Optimizing HTTP downloads in Java through conditional GET and compressed streams


URL url = new URL(BASE_URL);
URLConnection con = url.openConnection();
// inform the connection that we will send output and accept input

// Don't use a cached version of URL connection.
con.setUseCaches (false);
con.setDefaultUseCaches (false);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// define a new PrintWriter on the output stream
PrintWriter outWriter = new PrintWriter(con.getOutputStream());

// send data to the servlet

InputStream input = con.getInputStream();

(google search) (amazon search)

Thu Oct 12 17:29:34 AEST 2006 From /weblog/java/concurrency


An example of using Future API which availabe upon 1.5 JVM

The other example, make a method timeout and interrupt for sure

(google search) (amazon search)

Wed Aug 09 02:59:46 AEST 2006 From /weblog/java/concurrency


There may be more issue rise at concurrency code, althrough I don't know why JVM can't/shouldn't take care all hardward change...[..]d_id=41602&asrc=EM_NNL_430426&uid=703565

(google search) (amazon search)

Thu Aug 03 13:16:24 AEST 2006 From /weblog/java/j2me


A list of j2me benchmark tools[..]small-guideto-j2me-benchmarktest-midlets

(google search) (amazon search)

Tue Jul 25 21:50:13 AEST 2006 From /weblog/java/network

Setting user agents

(google search) (amazon search)

Wed Jul 12 18:09:26 AEST 2006 From /weblog/java/hacks

Cracking class files

No sure if that still valid, but look like encrypt class file don't help on protecting class.[..]ld/javaqa/2003-05/01-qa-0509-jcrypt.html

(google search) (amazon search)

Fri Jul 07 16:17:14 AEST 2006 From /weblog/java/libraries


An article introducing various APIs of using java to access USB device

(google search) (amazon search)

Thu Jul 06 18:23:59 AEST 2006 From /weblog/java/libraries/ant


An nice articles about various issue of ant: involving ant with various scripting frontend of java may be a nice solution?[..]&hs=f13&hl=en&lr=&client=opera&rls=zh-tw

(google search) (amazon search)

Mon Jun 26 16:32:59 AEST 2006 From /weblog/java/hacks

trick for java 5

New look of resultset, WebRowSet, , but I personally don't think this is something useful

Some information how using jmxagent:[..]nus/archive/2006/06/going_beyond_jd.html

Just come across a nice article that discuss about various new features of 1.5 and provide tips on how to use them:

Create collection quick

List programmingLanguages = CollectionUtils.newList("Java", "C++", "Ruby");

Or this:

Map langs = new HashMap(3) {{
put("Java", "Wicked");
put("C++", "Ok");
put("Ruby", "Interesting");

(google search) (amazon search)

Fri Jun 16 23:36:39 AEST 2006 From /weblog/java/features

scripting support

A pretty clever way to work with database and xml with groovy and springs

(google search) (amazon search)

Sat Jun 03 18:27:54 AEST 2006 From /weblog/java/features

javaone slides

(google search) (amazon search)

Fri Jun 02 01:03:02 AEST 2006 From /weblog/java/features


Is it have to support so much? Not sure for me...[..]air/archive/2006/05/the_unknown_jav.html

(google search) (amazon search)

Mon May 29 13:58:43 AEST 2006 From /weblog/java/discussion

comment of final

I personally like to declare everything in final and immulatable so that it give me feel it more safe (e.g.: variable won't be replace with other value unexpected; method won't be override unexpected). The following is some discussion, see if you interested.[..]/2005/06/how-often-do-you-use-final.html[..]rd-particular-in-javautilconcurrent.html

Here is a few update that against using final, mainly against using final class but not final method and variable:[..].MichaelFeathers.ItsTimeToDeprecateFinal[..]gView?showComments=true&entry=3325667363

And here is some support using final:
Prevent security and memory leak in rare case:[..]a-tip-10-constructor-exceptions-are.html

(google search) (amazon search)

Mon May 22 18:33:35 AEST 2006 From /weblog/java/fundamental


In short, only call private methods from a constructor.[..]005/05/calling-abstract-method-from.html

(google search) (amazon search)

Fri May 19 16:41:12 AEST 2006 From /weblog/java/discussion

speed of sun

Also, top 25 bugs seem always the same?

Here is one nice blog about opensource java, see if anyone agree his position:

(google search) (amazon search)

Tue May 16 17:30:58 AEST 2006 From /weblog/java/hacks

equals() at proxy generated instance

At least need to test on the interface level. And more complicate if you don't want to expose the internal structure to interface

(google search) (amazon search)

Tue May 16 13:47:04 AEST 2006 From /weblog/java/deploy

Hard to upgrade

See the problem when updating JDK:[..]/05/google-desktop-and-java-install.html

(google search) (amazon search)