Compiling cyclic dependency in Java

Tags: , , , ,

I was recently asked – If there is cyclic dependency between classes A, B and C. How do you go about compiling them in java? Apparently, that came up in an interview for someone. Well, I don’t know what kind of dependency that person had in mind when asking this question – But I had […]

Continue reading » 3 Comments

Configuring Eclipse to use a JDK at a location with spaces in it

Tags: , , , , , ,

I was setting up my Eclipse environment with some new plugins today and ran into some trouble, which seems to have bothered many souls as I gather from the posts I found when trying to fix the problem. Some tools/plugins/features in Eclipse may need to use a JDK rather than a JRE. Sometimes you may […]

Continue reading » 21 Comments

How to split a file, process the pieces in multiple threads and combine results using a shell script

Tags: , , , , , ,

Say you are in a situation where you have a file with a huge number of records to be processed and the processing of one record does not need data from the processing of previous records (ie. a perfectly paralellizable situation), what can you do to speed up things? Well, here’s what I did when […]

Continue reading » 4 Comments

Java Synchronization Benchmark

Tags: , , , , , , , , ,

Here is a very simple and straightforward benchmark to demonstrate how synchronization in Java can affect speed of execution to different extents in Java 1.4 and Java 6. In the attached image (click above for full size), you can see that for Java 1.4 the synchronized method needs over 700% more time to do its […]

Continue reading » 7 Comments

Azureus extension to schedule download speed by pinging an IP using Java

Tags: , , ,

I have a 128Kbps Internet connection with no download caps. So I often leave torrents downloading huge files on my torrent client overnight or when leaving home. Problem is that this brings the net speed down to a crawl for my roomies who access the net through an HTTP proxy running on my PC. So […]

Continue reading » 1 Comment