java

Snap point to a line - Java

Hi, I have two gps coordinates which link together to make a line. I also have a gps point which is near to, but never exactly on, the line. My question is how do I find the nearest point along the line to the given point? Many thanks ...

Velocity vs. FreeMarker

Velocity or FreeMarker? They look pretty much the same, even the syntax? What to use? Or when to use what? ...

What Java technologies are most needed now?

I'm new in Java. I'm studying this program language and I guess that pure Java is not very useful. Can you advice me what related technologies / frameworks I should to study firstly? ...

What's the effect of -server option for the HotSpot JVM?

Hi all, I cannot find any clear documentation about the exact effect of passing the -server option when launching a sun HotSpot JVM. Can anybody sum-up what it does? ...

getting more informations from sax validator

Can i get for example the node structure or something like this from the validator? Something like a listener or an handler. The exception is not enough. I have to select the node where the error occured. Thats what i build so far. def factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI) def schema = factory.newSchema...

adding image on a panel

hello everyone. uhhmm. ive been finding ways on adding images(Image object) on a panel. Basically, what i want to do is to create a page - a panel with moving objects (animation using sprites). but i can't. everytime i try to add the images to the panel, the screen goes on like "blinking". anyone can help me with this? I need this ASAP.....

How to upload bulk data to Google Servers using Google App Engine running on Java?

I am not able to figure out how to upload bulk data to the Google's servers bypassing the 10mb upload limit and 30 sec session timeout. I want to design an application that takes my standard SQL data and pushes it to the Google's servers. I might sound naive but your help is most valuable for my project. ...

How to get current time in YYYY-MM-DD HH:MI:Sec.Millisecond format in java

The below code gives me current time. but it does not tell anything about millisecond public static String getCurrentTimeStamp() { SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//dd/MM/yyyy Date now = new Date(); String strDate = sdfDate.format(now); return strDate; } I get date in th...

Velocity: hide methods from template

Is there a way I can mark a public method as "not callable from a velocity template". ...

git pull - changes from Java

I have a web app that serves some markdown files. What i would like to do is when there is a push to github i would ping my application using a webhook and i want my application to run git pull to retrieve changes. I am sure that no application specific files will change only markdown files in a specific folder. Does any one done somet...

JNI segmentation fault bug

Hi, there is this morphological analyzer (open source, written in OCml) named ocamorph. download and make instructions here The java binding is buggy and I'll have to fix it and after a few hours of struggle now it seems to me it'll take a few days to fix it as I'm not familiar with C, JNI, OCml and this particular software. Here you c...

Can Java Annotations help me with this?

I'm wondering if there is a way to specify that a method gets called in advance of a class method. I know something like this should be posssible, since JUnit has before(), what I want to do is similar. Here is a concrete example of what I'd like to do class A { public void init(int a) { System.out.println(a); } @magic(arg=1) p...

How to pass a session between tomcat and php.

Hey, I am in a WTF code situation working on a jsp tomcat server and trying to pass session data (user id, etc.) to php. i am planning to rewrite php session handling with session_set_save_handler() my question is where does tomcat stores it session data (harddrive?) and what kind of encoding does it uses? or am i on the wrong path? i kn...

com.sun.xml.rpc.tools.ant.Wscompile cannot be found

Hi I need to use a service at http://mihansmscenter.com/webservice/?wsdl so i should use jax-rpc i add jax-rpc plugin to my netbeans then righ click on my project > New > Web service client > and set: WSDL URL:http://mihansmscenter.com/webservice/?wsdl project: my project package: smsService client style: JAX-RPC Style but when cl...

Set Default file association Mac OS X Java Package Maker Installer

I have two questions about Package Maker on Leopard. I installed Xcode 3.1.4. I exported my Java app out of Eclipse into an app bundle and made an installation program for it. I know little about Macs so I am going off of random sites right now on how to use this tool. 1) Is there a way using Package Maker or alter the "Info.plist" to r...

Launch a process from Objective-C on the desktop

We have a java app which we call with a parameter (a selected folder), which works fine in C#. However, I'm at a loose end to work out how to do this in Objective-C; I've found the LaunchApplication command, but it's a bit vague. Can someone please help me out? ...

Strange behavior when running a bash script from java program

I have a script (KSH script to be precise) that downloads 3 files from a FTP server, using the curl command. When I run manually my script, i.e. by executing the command ./ftp_download.sh XXX (XXX are the parameters for the script), the download finishes correctly. As I want to run the script from a Java program, I have made a short Ja...

Swing: listeners execution order on custom component.

My custom component is composed of three JTrees inside a JPanel. Only one JTree should be selected at a time, so I've added a TreeSelectionListener to each of them that calls clearSelection on the previously selected JTree. I'd like to add other TreeSelectionListeners to the JTrees being sure that the selection- handling listeners alway...

Where can I find old versions of the JDK and JRE?

To test compatibility, I need to find old versions of the JRE and JDK. Where can I find download links to these files? ...

Monitoring code metrics in Java over longer time period

Is there some tool to monitor different metrics for a Java project over a longer period of time, preferrably by the data in CVS to establish trends and weak points? This would be a good starting point for continuous code reviews and for maintaining code quality. I'm especially interested in number of references, size of classes and meth...