java

Is there any free java open source application that can monitor website status?

Anyone know any? I need to send in a http request and make sure the http response i got back is not http 500 ...

How do i get all Sunday dates in a particular year?

Exact duplicate: http://stackoverflow.com/questions/590385/how-to-get-all-dates-of-sundays-in-a-particular-year-in-java int year = 2009; Calendar cal = new GregorianCalendar(year, Calendar.JANUARY, 1); for (int i = 0, inc = 1; i < 366 && cal.get(Calendar.YEAR) == year; i+=inc) { if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY...

getClass() and static methods: What is the best practice?

I am looking to provide some convenience through reflection to programmers who will be using my code. To achieve my desired result I would like to get the class object for classes that extend my code. Even though they can't override the static method I wish to access the information from, it would be currently helpful. I may end up si...

Where do I start to write/use a 3D physics simulation engine?

I need to write a very simple 3D physics simulator in Java, cube and spheres bumping into each other, not much more. I've never did anything like that, where should I start? Any documentation on how it is done? any libraries I could re-use? ...

Tips of coding java programs in multicore scenario

There seems to be a lot of fuss about multicore and java. While some people say that java support is not good enough, it definitely seems to be an area to look forward to. There seems to be many techniques to improve performance of concurrent programs. Any tips/advices about programming in a multi core scenario is appreciated. ...

How should I serve ZIPped webpages?

Background: Our software generates reports for customers in the usual suspect formats (HTML, PDF, etc.) and each report can contain charts and other graphics unique to that report. For PDFs everthing is held in one place - the PDF file itself. HTML is trickier as the report is basically the sum of more than 1 file. The files are availabl...

Java: How to Implement Iterable

Given the following code, how can I iterate over an object of type ProfileCollection? public class ProfileCollection implements Iterable { private ArrayList<Profile> m_Profiles; public Iterator<Profile> iterator() { Iterator<Profile> iprof = m_Profiles.iterator(); return iprof; } ... p...

Concept and programming for Accessing xml file that uses xsl file in a jsp Code.

Hi, I am a beginner in accessing backend xml files(which acts like a database) in a jsp code. can any one please provide me the links and references that provides good understanding for beginners like me. pls help. ...

close the command interpreter

Hi, my requirement is the follwing. I run the batch file using java code. The batch file does the following one xml file using java and it takes some time. After xml file is run the applet is displayed. If the applet is closed manually then the command prompt will close. I need to close the command prompt using the java my problem is...

Import Data from MS Excel using Java Source Code

I want to Import data placed in MS Excel and print it using Java Application Program. I am newbie in Java. So Please guide, is it possible. If yes, how? Any website/tutorial will be of great help.. Thanks in advance.. ...

What is the performance cost of assigning a single string value using +'s

I have often wondered this, is there a performance cost of splitting a string over multiple lines to increase readability when initially assigning a value to a string. I know that strings are immutable and therefore a new string needs to be created every time. Also, the performance cost is actually irrelevant thanks to today's really fas...

java servlet

When I try to use javax.servlet.http.*; an error package does not exist is thrown. Should I want to reinstall java or it occurs due to some other problem. I'm using j2sdk 1.4.0 & Tomcat 6.0. Thanks & Regards ...

What is the best way to deal with collections (lists or sets) in key-value storage?

I wonder what can be an effective way to add/remove items from a really large list when your storage is memcached-like? Maybe there is some distributed storage with Java interface that deals with this problem well? Someone may recommend Terracotta. I know about it, but that's not exactly what I need. ;) ...

How to create a stream of jpegs(live) in c++ or c# or java? RTSP?

I am building a server sided html rendering browser that renders html and sends jpegs to the mobile client. I need to figure out how to build a server that grabs jpegs and streams them in a session to a client that i am going to write in j2me ...

Getting java gui to open a webpage in web browser.

I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file. I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. How would I go about doing that? ...

Java Object Serialization Performance tips

I must serialize a huge tree of objects (7,000) into disk. Originally we kept this tree in a database with Kodo, but it would make thousands upon thousands of Queries to load this tree into memory, and it would take a good part of the local universe available time. I tried serialization for this and indeed I get a performance improveme...

Could "content" of AttributedString can be saved in file ?

I am doing some research on how to "draw" some attributed text on Graphics2D. So, i am interested is it possible to save content of AttributedString in some format ? I know it could be Java serialized, but, i don't need that solution here. Also, if somebody knows some example which shows how to edit AttributedString ? Here is some Ja...

How can I access the ApplicationContext from within a JAX-WS web service?

Similar to How can I access the ServletContext from within a JAX-WS web service?, is there a way to access applicationContext, easier than this? import javax.annotation.Resource; import javax.jws.WebService; import javax.servlet.ServletContext; import javax.xml.ws.WebServiceContext; import javax.xml.ws.handler.MessageContext; import or...

Array of Strings to an Array of Objects

Maybe there is a method that does this that I don't know about - I doubt it though - but I'm trying to convert an array of strings to an array of Objects. Here is the problem: I'm reading a file in from the command line. The file represents several classes of the following types each with their own data fields. Vehicle is the parent clas...

How do I externalize named queries in a Hibernate annotations app?

Is there a way to externalize HQL named queries to an external file. I have too many named queries and using @NamedQueries/@NamedQuery at the head of my entities classes is hurting. Is there a way to externalize to several files? ...