January 29, 2006
Custom threads / J2EE
As you all know , custom thread creation is not recommended in J2EE. In all the J2EE projects I worked, I always had a need to execute some tasks concurrently. Several workarounds like Schedulers, MDBs were used.
Now using JSR 237, a nice framework is available to use container threads and BEA Weblogic 9.0 supports it. Using this any concurrent work can be executed along with the current thread.
Now using JSR 237, a nice framework is available to use container threads and BEA Weblogic 9.0 supports it. Using this any concurrent work can be executed along with the current thread.
Read feeds using Java...

Was looking for a Java framework to read feeds from a Java app. Found Rome. An easy to use framework which returns the feed as a SyndFeed object.
Just tried it on my feed and it works great!
January 27, 2006
SGI

SGI is one of my fav companies. The reason being their advanced products like XFS, workstations and high-end clusters. So it was sad to see the stock got delisted from NYSE.
I hope the company will rebound soon with their high-end Altix Linux Systems.
They have also enhanced XFS to a shared filesystem for SANs called CXFS. Looks interesting.
Google`s Golden Rules
Newsweek has an article on Google`s 10 Golden rules on dealing with "knowledge workers". I like the "Strive to reach consensus" rule.
January 26, 2006
Flow Chart Editor

Flow Charts are useful to explain process flows in HLD documents. SFC is a nice flow chart editor and even generates pseudo code out of it.
Framework to create Charts
jfree.org has a free java framework called jfreechart to create various types of charts. It can even be used in servlets.
January 25, 2006
OutOfMemoryError / debug data
How to get debug data when OutOfMemoryError occurs ?
- If it happens during development, we can attach to the process and analyze using any of the profilers ( jmp or JConsole )
- If it happens in production or somewhere remote, one way is to catch OOME in application itself and make it wait , so that a profiler like jmap can attach to it and produce a heap summary and dump
- In Java SE 6.0 (Mustang), it gets even better. A stack trace will be generated on OOME, -XX:+HeapDumpOnOutOfMemoryError option for auto heap dump
To analyze heap dump, use hat tool (this is included in JDK 6.0 as jhat)
- If it happens during development, we can attach to the process and analyze using any of the profilers ( jmp or JConsole )
- If it happens in production or somewhere remote, one way is to catch OOME in application itself and make it wait , so that a profiler like jmap can attach to it and produce a heap summary and dump
- In Java SE 6.0 (Mustang), it gets even better. A stack trace will be generated on OOME, -XX:+HeapDumpOnOutOfMemoryError option for auto heap dump
To analyze heap dump, use hat tool (this is included in JDK 6.0 as jhat)
January 23, 2006
Product of the Year 2006

developer.com has announced its product of the year 2006 winners. Its great to see lot of open source products in the list.
January 21, 2006
32 bit, 64 bit
32 bit, 64 bit are one of the most used jargons in IT. What are they?
It can be explained based on the following contexts.
CPU: It means the CPU has 64 bit registers and/or 64 bit address bus. Bcos of that it can address more memory upto 18 billion GB ,compared to 4GB in 32 bit systems. Also 64 bit computations (say adding 2, 64 bit integers) will be faster.
e.g. Sun`s UltraSPARC
OS: To make use of the above advantages, the OS should be 64 bit too. Here some may be pure 64 bit and some offers both 32 bit and 64 bit modes. Not alone just the OS, even the device drivers should be supporting 64 bit for full performance
e.g. Fedora 64 bit Linux
Compilers: 64 bit compilers are also needed if u want the applications to take advantage of the above
e.g. GCC
Applications: Just compiling an application with 64 bit compiler wont be enough. For example , size of long in ILP32 gcc is 32 bit , but on LP64 gcc, it will be 64 bit. If the applications assumes 32 bit for long anywhere, then it wont work
The above issue can be avoided if fixed width types like uint32_t, uint64_t etc are used.
It can be explained based on the following contexts.
CPU: It means the CPU has 64 bit registers and/or 64 bit address bus. Bcos of that it can address more memory upto 18 billion GB ,compared to 4GB in 32 bit systems. Also 64 bit computations (say adding 2, 64 bit integers) will be faster.
e.g. Sun`s UltraSPARC
OS: To make use of the above advantages, the OS should be 64 bit too. Here some may be pure 64 bit and some offers both 32 bit and 64 bit modes. Not alone just the OS, even the device drivers should be supporting 64 bit for full performance
e.g. Fedora 64 bit Linux
Compilers: 64 bit compilers are also needed if u want the applications to take advantage of the above
e.g. GCC
Applications: Just compiling an application with 64 bit compiler wont be enough. For example , size of long in ILP32 gcc is 32 bit , but on LP64 gcc, it will be 64 bit. If the applications assumes 32 bit for long anywhere, then it wont work
The above issue can be avoided if fixed width types like uint32_t, uint64_t etc are used.
finalize() / performance
I have seen few developers adding finalize() to a Class to just print "GC Called...".
finalize() was not intended for this purpose and it will have its own effects on performance as the JVM does several actions , if an object is finalizable.
GC on that object will get delayed if finalizer thread has low priority.
finalize() should be used only for real resource cleanups and even then it should be avoided if alternate exists.
finalize() was not intended for this purpose and it will have its own effects on performance as the JVM does several actions , if an object is finalizable.
GC on that object will get delayed if finalizer thread has low priority.
finalize() should be used only for real resource cleanups and even then it should be avoided if alternate exists.
January 20, 2006
MacBook Pro / Linux

I cant have any more excuses to not switch to Mac!
One of the nice features it has is, EFI, not legacy BIOS seen in PCs.
Now that brings up a question whether Linux bootloaders can run on EFI. There is ELILO.
So will Linux distros run? No Idea. Googled around but couldnt find any info. For sure drivers issue will be there. But it wouldnt be too long before Tux can shine on MacBook.
The day I see Linux running on MacBook with all the hardware support, Iam ordering one for me!
January 18, 2006
milliondollarhomepage.com
As you all know a 21 yr old has made million dollars in few months using an innovative ecommerce ad idea. Ad banners is not a new concept and its been around over a decade, but what made this particular site click, is its innovative twist.
So What did i learn ?
Innovative Twist to an existing business model and being the first in that innovation, with good publicity and word of mouth in blogosphere, WINS!
We will be seeing more of this model rushing, but iam sure it wont have the same effect.
Congrats Alex Tew!
So What did i learn ?
Innovative Twist to an existing business model and being the first in that innovation, with good publicity and word of mouth in blogosphere, WINS!
We will be seeing more of this model rushing, but iam sure it wont have the same effect.
Congrats Alex Tew!
startstop
I was looking for a watchdog kind of process which can manage a set of java servers. Mostly I needed the auto restart feature if the server crashes.
Found startstop , which was originally built for managing java servers.
Found startstop , which was originally built for managing java servers.
January 13, 2006
SIP Message Parser
We have been using NIST SIP stack for several applications. I had a need to parse raw UDP SIP message.
The SIP String Parser in NIST sip stack can be used even outside the stack, to parse raw buffers into SIP request/response objects.
The SIP String Parser in NIST sip stack can be used even outside the stack, to parse raw buffers into SIP request/response objects.
January 12, 2006
StringBuilder
I was just going thru the enhancements in JDK 5.0 and found that there is a new class called "StringBuilder", which is faster than StringBuffer.
StringBuilder is not thread safe, but most usage of StringBuffer are as local buffers within a method, so that shouldnt be an issue.
First thing 2morrow, I have to go and replace all my StringBuffers!
StringBuilder is not thread safe, but most usage of StringBuffer are as local buffers within a method, so that shouldnt be an issue.
First thing 2morrow, I have to go and replace all my StringBuffers!
SLAMD

SLAMD is a java based distributed Load Generation framework , useful to load test web applications. But the framework can be extended to load test any server applications say SIP servers using the Job based API.
January 11, 2006
VoWi-Fi

Netgear`s Skype phone is a great step towards the VoWi-Fi future. Its a mobile phone with Wi-Fi capability and inbuilt skype client. Awesome!
January 08, 2006
retrievr
retrievr - search by sketch engine. Even though its in experimenting stage, I think its a great step towards new kind of image search.
Lets say we want to search for "blue sky with yellow sun in the top left". It would be easier to specify these properties (color, space etc) by a sketch.
Lets say we want to search for "blue sky with yellow sun in the top left". It would be easier to specify these properties (color, space etc) by a sketch.
January 07, 2006
Best of "Web 2.0" web
As you all know, Web 2.0 is the latest buzzword in the industry. WSJ has a list of best Web 2.0 applications. Obviously, flickr is there!
January 06, 2006
Basic Java Server Tuning
I have developed / developing several Java based server applications. Three basic tuning that will be helpful for any server applications are
- Heap Size tuning: Proper Heap Size setting using -Xms and -Xmx options
- GC policy: Choosing the right GC policy and setting correct values for their options
- server VM: Make sure server class VM is used (-server option).JDK 5.0 has an automatic detection feature to detect server class machines
- Heap Size tuning: Proper Heap Size setting using -Xms and -Xmx options
- GC policy: Choosing the right GC policy and setting correct values for their options
- server VM: Make sure server class VM is used (-server option).JDK 5.0 has an automatic detection feature to detect server class machines
January 05, 2006
host based authentication / ssh
our corporate security policy mandates use of ssh on all servers and no Telnet. I normally use putty as the ssh client on windows and the std ssh client on linux.
i login to atleast dozen of solaris/linux boxes and today is the day , i finally setup host based authentication to some of these hosts.
redhat has a nice explanation on how to do this.
i login to atleast dozen of solaris/linux boxes and today is the day , i finally setup host based authentication to some of these hosts.
redhat has a nice explanation on how to do this.