java

Arrays in Objective-C main method. Sigserve errors. Newb.

In Objective-C how should I best approximate what in Java I am doing like this: static private String[] array {"A", "B", "C"}; What I think I need is a simple array that I can index into with some integers. Alternative suggestions are welcome, but bear in mind that if I am getting stuck on this then I am pretty much hopeless anyway...

java string to datetime conversion issue

I can't seem to see the problem with the example code below. For some reason seems to be ignoring the year and saying the dates are the same, as can be seen in the output below. I must be missing something simple. 01/28/2006 01/16/2007 Tue Apr 01 00:00:00 PDT 2008 Tue Apr 01 00:00:00 PDT 2008 done import java.util.*; impo...

What are the most commonly used Java Frameworks?

for me I will answer this question based on my experience. so if I'm gonna start new project I will use the following technologies: AndroMDA as MDA framework. Spring (DI, Interceptors, Quartz, ACEGI, ... etc). Hibernate. JSF. off course you might need to play with some helper frameworks/libraries such as: Velocity. CAS; if you nee...

Create an array of JButtons with the Netbeans 6.5 GUI Builder

Hello, I want to create an array of JButtons with the GUI Builder (not actually writing the code, but drawing it). I can only figure out how to change the name of the element, not add it to an array. Thanks. ...

Java screen capture applet

Hello, Am wondering if there is any applet which I can use and customize to capture the users screen (windows and mac) in java? I saw jxCapture but it takes only screen shots. I want to use the tool to capture the screen (for screencast) and then export as flv format. Am wondering whats the best solution for that? Is there any applet/s...

Autogenerate value objects

Given an interface or interfaces, what is the best way to generate an class implementation? interface Vehicle { Engine getEngine(); } @Generated class Car implements Vehicle { private final Engine engine; public Car(Engine engine) { this.engine = engine; } public Engine getEngine() { return...

Best practices for using and persisting enums

I've seen several questions/discussions here about the best way to handle and persist enum-like values (e.g. http://stackoverflow.com/questions/492096/persisting-data-suited-for-enums , http://stackoverflow.com/questions/256978/how-to-persist-an-enum-using-nhibernate ), and I'd like to ask what the general consenus is. I've tried to sum...

Books recommendation on Java and programming

Duplicate: Best Java book you have read so far I consider myself as an intermediate to advanced level Java programmer. I am looking forward to buying some books to enhance my current knowledge in Java and programming in general. What would your recommendations be in these areas? For Java, I heard about Effective Java being prett...

Math operators in Criteria queries

Given the mapped hibernate class: @Entity public class MyTestClass { /* id and stuff */ private Integer aValue; private Integer bValue; } you can do the following with HQL: Query query = getCurrentSession().createQuery("select aValue * bValue from MyTestClass"); List<Double> resultList = query.list; and get the calculated...

Difference between JVM implementations

Where do JVM Implementations differ (except licensing)? Does every JVM implement Type Erasure for the Generic handling? Where are the differences between: JRockit IBM JVM SUN JVM Open JDK Blackdown Kaffe ..... Deals one of them with Tail-Call-Optimization? ...

Remove nested test classes with maven2

Hi There! I use nested classes for accessing private members in JUnit tests. They are alaways named "TestProxy". I would like to remove them at Build time using maven2, to not include it into the jar file. -Is there any configuration option? -Can it be done with a plugin? If so, a prototype would be nice! ;-) Thanks Edit: Why us...

Is there Java library or framework for accessing Serial ports?

Is there a java library or framework (other than the javax.comm provided by Sun) that is easy to use when accessing serial and parallel ports ( especially RS-232 ). I need something free that will work both on Windows and Linux. ...

Annotation ElementType

What does following annotation's ElementType means? @Entity @Table(table="application") @ElementType(type=1L) class application extends Element ...

How can I find the current time as a long in C#?

I have this Java code, and I want to do the same thing in C#: long now =System.currentTimeMillis()/1000; ...

How can I configure a Hudson job to use a specific JDK?

I have a number of projects running on a Hudson slave. I'd like one of them to run Ant under Java6, rather than the default (which is Java5 in my environment). In the project configuration view, I was hoping to find either: An explicit option allowing me to set a custom JDK location to use for this project. A way to set custom environ...

Java Transactions API and .NET System.Transactions

I'm analyzing the different behaviors between the JTA (Java Transactions API) and the .NET counterpart System.Transactions: the approach is quite different between the two of them. In fact, Java's version of Transactions seems more a specification, leaving to developers the obligation to implement either the Transactions, TransactionMana...

[MS-Windows] Lauching a Java app from a batch file with the correct JRE

I have a very simple batch file that lauches a Java app (Saxon) with the simple command "java net.sf.Saxon.transform..." This app requires java version 1.5. This batch file will be used by 400+ users who each may or may not have some versions of the JRE installed on their machines. I had thought that simply installing the most recent ...

override java final methods via reflection or other means?

This question arise while trying to write test cases. Foo is a class within the framework library which I dont have source access to. public class Foo{ public final Object getX(){ ... } } my applications will public class Bar extends Foo{ public int process(){ Object value = getX(); ... } } The unit test case is ...

How do you make a multi-module spring configuration ?

I have a multi-module (maven) spring build. All the modules publish some beans, and most also consume beans defined further down the dependency graph. Although most of it is annotation declared beans, almost every module also has one or two xml-declared beans. Although we have a half-decent solution, but I am really wondering what is th...

Porting a comparator from C# to Java

I am trying to convert these small math calls to Java from C# and just wanted to make sure that they operate the same way. I added one additional call as it is not supported in Java. Here is code in C# public override int CompareTo(object a) { EquationGenome Gene1 = this; EquationGenome Gene2 = (EquationGenome)a; return Math.Sign(Gene...