I am using processing 1.0.6, which runs on java 1.6. I have the following code:
Pattern pattern = Pattern.compile("func\((.*),(\-?[0-9\.]*),(\-?[0-9\.]*),(\-?[0-9\.]*)\)");
but it gives the error:
unexpected char: '('
and highlights the line I pasted above. If I change the offending \( to another character like #, it complains of t...
I'm pretty new to Java and I don't understand what is this structure. I know what is an interface and how is defined, but in this case, I really don't know. Could you tell what is about?
public interface WebConstants {
public interface Framework {
String ACTION = "action";
}
public interface Look {
String LI...
how do you return number of distinct/unique values in an array for example
int[] a = {1,2,2,4,5,5};
...
I am working on a project using Hadoop and it seems to natively incorporate Java and provide streaming support for Python. Is there is a significant performance impact to choosing one over the other? I am early enough in the process where I can go either way if there is a significant performance difference one way or the other.
...
There is JavaDoc of normal API of the JAVA with English version, a Chinese edition, but seems to become the separate source codes each.
...
What happens if both catch and finally blocks throw exception?
...
in windows batch and and bash scripts there is %USERPROFILE% and ~, is there a command that works the same in java that will allow me to switch to the users home directory?
...
Some background:
On Mac OS X 10.6 using Macports and I have DYLD_LIBRARY_PATH set in my .bash_profile.
The problem:
When I run java -version I get this error:
Error occurred during initialization of VM
Unable to load native library: libjava.jnilib
By way of one helpful forum thread, I've discovered the problem is some files in...
I want my program, a Java executable .jar, to be run just once. I made a program but now I want users not to be able to open more than one instance ....thanks for your time...
I've checked the server/client solution and the lock file, but I don't understand them much, I also tried to make them run in NetBeans, with no luck...
...
I'm having trouble figuring out the proper way to update "nested" data using Google App Engine
and JDO. I have a RecipeJDO and an IngredientJDO.
I want to be able to completely replace the ingredients in a given recipe instance with a new list of ingredients. Then, when that recipe is (re)persisted, any previously attached ingredients...
I need to write blocks of data (characters) and I don't care about the sequence of those blocks. I wonder what kind of OutputStream I should use to achieve high performance?
...
How do I build oracle pl/sql query dynamically from a java application? The user will be presented with a bunch of columns that are present in different tables in the database. The user can select any set of column and the application should build the complete select query using only the tables that contain the selected columns.
For exam...
I am trying to make a mail application through apache james, but I could not really get all the
things, please give suggestions how to use it. MOreover, I could not figure it how to use jsp and servlet for james. Please help.
...
Hi guys,
I have defined a many-to-many relationship between my two entity classes User and Permission. User has a primary key composite of username and countyId, and my Permission table has a regular integer Id. The table UserPermission has the three foreign keys as its primary key: username, countyId and permissionId.
Since this is a ...
Is there an easy way to simulate low memory inside the emulator ?
I'm interested to perform resource cleanups similar to this post
...
How can i get hold of the instantiating object from a constructor in java?
I want to store reference to the parent object for some GUI classes to simulate event bubbling - calling parents handlers - but i dont wanna change all the existing code.
...
Please can anyone tell me what is the error in the following piece of code?
Question is
Create a class person which has
A variable ‘name’ which stores the name of the person.
A constructor that takes a single argument that is used to initialize the name variable
A method getName() which displays the name.
A protected method setName()...
Hi,
Is there simple and reliable way to detect your website visitor IP address using Java. I am trying to make use of Akismet to detect spam on my blog post/comment. The API require me to specify the IP address of the commenter.
Thanks =)
...
I have a problem when trying to add a PApplet into SWT, it turns up an empty window when it should just render the PApplet. I.e. the PApplet works by itself, but not in a SWT window.
I thought that just adding the PApplet into the frame should initially do the trick, using the SWT tutorial code in Eclipse. Apparently it wasn't so easy....
Hi I have created a slider in java in linux platform. But the slider gave different look and feel in different operating systems. Means in linux it looks little bit good but in mac operating system the slider looks different. so how to give same look and feel to my slider irrespective of operating system
The code is given below.
import...