java

Double Greater Than Sign (>>) in Java?

What does the double greater than sign mean in Java? I had never seen it used befor but came accross it today and I tried googling it, but google hates punctuation (which is really annoying some times). ...

Singleton with Arguments in Java

I was reading the Singleton article on Wikipedia and I came across this example: public class Singleton { // Private constructor prevents instantiation from other classes private Singleton() {} /** * SingletonHolder is loaded on the first execution of Singleton.getInstance() * or the first access to SingletonHold...

How to send PUT, DELETE HTTP request in HttpURLConnection ? Looks like not working.

I want to know if it is possible to send PUT, DELETE request (practically) through java.net.HttpURLConnection to HTTP-based URL. I have read so many articles describing that how to send GET, POST, TRACE, OPTIONS request but still not finding any sample code which successfully perform PUT and DELETE request. Can any one give idea regardin...

How can I access methods based on strings in an array?

Hello! I'm not even sure if this is possible, but hopefully it is in Java. I know I've done it in PHP by using variable variables and accessing a variable dynamically, but I read this isn't possible in Java in a different question. I have an array of strings which contains the state of checkboxes in my JSF GUI. If all checkboxes are s...

Given Name Formatting

To anyone who can help, Thanks Okay, so I have a database holding a customer list. The problem that I am having is that I have found that all the entries for the customers First and Last names are stored in all Uppercase letters. And I wanted to know if anyone knows of some utility that I could use to convert the names to their correct ...

How to add greater than/less than to Hibernate filters

How can you add greater than or less than symbols to the condition on a Hibernate filter specified in the hbm.xml file? I am trying to add a filter to limit the collection to a specific date range: <filter name="limitTalksByDateRange" condition="talkstart >= :tstart and talkstart <= :tend" /> Unfortunately this breaks the XML parsing...

How to find how much disk space is left using Java?

How to find how much disk space is left using Java? ...

IMAGE_CAPTURE Intent never returns to onActivityResult(int, int, Intent);

Hi, I start an IMAGE_CAPTURE Intent like this, and my activity's onActivityResult() get called: Intent i = new Intent (android.provider.MediaStore.ACTION_IMAGE_CAPTURE, null); i.putExtra("return-data", true); startActivityForResult(i, PICK_ICON_FROM_CAMERA_ID); But, if I start my Intent like this, the Capture Image Intent did get cal...

How to get the results of WHERE conditional evaluations in the result set?

The PROBLEM I have a query like this: select a.id from a join b on ( a.id = b.my_a ) join .... where ( /* complex and expensive conditional */ ) AND (( /* conditional #1 */ ) OR ( /* conditional #2 */ ) OR ( /* conditional #3 */)) I would like to have the query return something like: select a.id, co...

Java EE Jar file sharing

At our shop, we are maintaining roughly 20 Java EE web applications. Most of these applications are fairly CRUD-like in their architecture, with a few of them being pretty processor intensive calculation applications. For the deployment of these applications we have been using Hudson set up to monitor our CVS repository. When we have a ...

What is the best way to serialize an EMF model instance?

I have an Eclipse RCP application with an instance of an EMF model populated in memory. What is the best way to store that model for external systems to access? Access may occur during and after run time. Reads and writes of the model are pretty balanced and can occur several times a second. I think a database populated using Hiberna...

The proper way to deploy a Hibernate-based J2EE app to a remote server..

I have a pretty monstrous Java app in development here. As of now, it's only ever been deployed on my locally installed Tomcat/MySQL setup. For completeness, the app is an online game server written using Spring, Hibernate with MySQL currently on the backend. Now, I can easily package up the WAR and get that on the remote server.. The ...

Correct way to add lib/*.jar to an IntelliJ IDEA project?

When creating a new Java project in IntelliJ IDEA, the following directories and files are created: ./projectname.iml ./projectname.ipr ./projectname.iws ./src/ I want to configure IntellJ to include my dependency JARs in ./lib/*.jar to the project. What is the correct way to achieve this in IntelliJ IDEA? Yes - I'm an IntelliJ IDEA ...

How to programmatically enable GPS in Android Cupcake

I'm currently writing an app in Android that works with the GPS, at the moment I'm able to work out whether the GPS is enabled, my problem is that I want to enable the GPS on app startup if it is disabled, how can I do this programmaticaly? ...

Warning on Mac when use Dozer

I'm building application with GWT + GAE on my MAC. In this app i have DTO's and to convert from DTO to Persistent entities I'm using Dozer Library, its Mapper object. Everything compiles and runs fine on Windows but when I'm trying to run my app in hosted mode on MAC i'm getting following WARNING: The server is running at http://localho...

Isn't an unchecked exception that is caught in a try block a checked exception in Java?

I was told that in Java, unchecked exceptions can be caught in a try block, but if it's caught, isn't it called a checked exception? ...

What is the best approach for serializing BigDecimal/BigInteger to ProtocolBuffers

Hi I am starting to migrate a custom serialization mechanism to Protocol Buffers. One data type that will be used particularly regularly is BigDecimal. Does anyone know of a good way of serializing this within Protocol Buffers? Our current serialization routine uses BigDecimal.toPlainString() for serialization, and new BigDecimal(Strin...

Ideas for building a virtual conference

I am trying to build a virtual conference framework which provides functionality for holding virtual summits/conferences. Some of the core features: - graphical representation of conference room hall (perhaps different genres?) - Ability to invite people to summit/conference, register, unregister. - Video podcasts/broadcasts. - PPT ...

Can generic XML by parsed as nicely as simple XML in Groovy?

Given a nice, simple XML structure, XmlSlurper() can allow me to read values from it very easily. def xml = "<html><head><title>groovy</title></head></html>" def html = new XmlSlurper().parseText(xml) println html.head.title Is there a way to make this simple tree navigation possible for generic (type-based, etc) XML. Ideally, in t...

Unable to Connect to Tomcat Using VisualVM

I am having problems monitoring a remote Tomcat process. I'm trying to use the Java 6 versions of JConsole/JVisualVM. I have jstatd running on the remote server with the appropriate security policy. The process is started and the TCP connections are available. When I try to connect through JConsole, I get 'Connection Failed:jmxrmi'...