Lubos Programming Blog

Lubos Blog about Programming (mainly Java) and Computers

Archive for December, 2004

Home Page of Jad – the fast Java decompiler

Posted by lubosp on December 31, 2004

Pretty good Java decompiler, get the FrontEnd Plus UI for JAD decompiler

Home Page of Jad – the fast Java decompiler

Posted in java, tools | Leave a Comment »

Nice tools for Java developers

Posted by lubosp on December 31, 2004

Nice tools for Java developers [Java Java Proxy]
This time a collection of links to various tools that can easen our burden a little bit.

First, PDF and Excel creation using pure Java. This may seem unnecessary to small projects, but turns out to be quite handy, especially as more and more technical literature and external communications are written in PDF. We shouldn’t forget about Excel also: altough this is “we love to hate” Microsoft product, but one must agree that it gives the end user the time of his life creating the slice charts.

The following two packages allow reading and writing PDF and Excel files from Java:

  • PDF – IText from here
  • Excel – JExcelAPI from here

Pay particular attentions to the example that explains how to create a dynamic PDF which is sent to the web-based client from the servlet. This doesn’t involve creating the PDF on the web-server file system. The resulting stream is treated by the client automatically based on the content header and then associated with the corresponding plugin.

In addition, Jakarta POI project allows manipulating OLE2 Microsoft format used for all Office formats. Currently supported is – full support for Excel, simple capabilities for Word. More open-source for PDF can be found here

And now to the more prosaic world of memory profiling. This beast starts to raise its ungodly head when you suddenly find out that the garbage collection can get you so far. This much appraised mechanism makes our lives much easier, freeing us from both dreaded UNIX segmentation faults and elaborate C++ mechanism of virtual destructors; on the other hand we grow sloppier every day in forgetting to “free” objects that are no longer needed. This is referred to as unintentional retention.

I’ve experienced this one lately: there’s a massive computation performed by some object. This object creates a series of graphs, each having hundreds of thousands of nodes, and eventually splits these graphs. The result is a very compact segmentation of some input space which later is reused. As this computation is spread through several functions, i’ve decided to store these graphs in a member list variable. In the outer classes i store a reference to this object for reuse of the result. Guess what? The intermediate results are stored as long as this object lives, because I didn’t nullify them

So here a few tools (only one of them was actually run by me) that are collectively known as heap profilers:

  • hprof, not a tool on itself, more of a utility supplied with JDK. Detailed explanation is provided in this article from Sun
  • HAT, Heap Analysis Tool that works with Java 5.0 and provides a web-based GUI (in your browser of choice). Make sure though that you update the hat.bat to use -Xmx512M: for an hprof file of 46Mb, the JVM running Hat takes over 303Mb.
  • HUP, Heap Usage Profiling available here
  • HeapAnalyzer available from IBM (after they force you to tell them everything about yourself in a 10-page web form)

So, the next time you complain to your boss about that 1GB RAM that doesn’t meet your needs anymore, use these. The GC itself will thank you.

Enjoy
Kirill

[via java.blogs Day’s Entries]

Posted in java, tools | Leave a Comment »

Ant date/time

Posted by lubosp on December 31, 2004

Following snippet should set property myDate with current date:

<tstamp>
<format property=”myDate” pattern=”MM/dd/yyyy :HH:mm:ss”/>
</tstamp>
<echo message=”Today is: ${myDate}”/>

Posted in ant, java | Leave a Comment »

Karen’s Power Tools

Posted by lubosp on December 29, 2004

Karen’s Power Tools

Posted in windows | Leave a Comment »

High availability Tomcat

Posted by lubosp on December 28, 2004

High availability Tomcat

Posted in java, web | Leave a Comment »

Are you blogging at work? [Blogging Roller] Weblog…

Posted by lubosp on December 28, 2004

Are you blogging at work? [Blogging Roller]

Weblogs have been appearing all over the intranet where I work and I keep hearing about behind-the-firewall blogs at other companies. I’ve heard of… [151 characters]

[via java.blogs Day’s Entries]

Posted in tools, web | Leave a Comment »

AnalogX – a lot of smal utils

Posted by lubosp on December 26, 2004

News /// AnalogX

Posted in tools | Leave a Comment »

Jameleon – An Automated Testing Tool

Posted by lubosp on December 26, 2004

Jameleon – An Automated Testing Tool

Posted in java, testing | Leave a Comment »

Apache Server and Tomcat

Posted by lubosp on December 26, 2004

Interesting links to Apache Server and Tomcat Configuration
Apache HTTP Server Version 2.0 Documentation
Installing Tomcat with Apache
Jakarta Tomcat Connector – Installation for Apache 2.0.x
The Apache Jakarta Tomcat Connector
Configuring Apache Web Server with Tomcat
Configuring & Using Apache Tomcat 4
Integrating Tomcat with Apache

Posted in java, web | Leave a Comment »

New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 1.5: A Conversation with Joshua Bloch

Posted by lubosp on December 26, 2004

New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 1.5: A Conversation with Joshua Bloch: “New Language Features for Ease of Development in the Java 2 Platform, Standard Edition 1.5: A Conversation with Joshua Bloch”

Posted in java | Leave a Comment »