java

Reporting tool for C++ that shows number of times executed given a line

I would to know if there is a tool in C++ that gives you a report where it displays the following: The source code of the whole project. Usually one HTML page per source file. Beside the source code, there are line numbers, for readability purposes of course. And for each line, at the left of the line number, there is a value displaye...

Is there a Java Collection (or similar) that behaves like an auto-id SQL table?

Note that I'm not actually doing anything with a database here, so ORM tools are probably not what I'm looking for. I want to have some containers that each hold a number of objects, with all objects in one container being of the same class. The container should show some of the behaviour of a database table, namely: allow one of the ...

callablestatement - ArrayIndexOutOfBoundsException

I have a java program that is trying to call a stored procedure that returns a cursor type. However after registering the appropriate out paramaters and calling callableStatement.execute() I recieve an arrayIndexOutOfBoundsException: -1 I dont fully understand why I am recieving this error at this point in the program. Can anyone expl...

Implement wait between processes in Java?

I would like some help understanding and implementing a 'wait until process complete' between the various processes in my application, which need to proceed in a step-wise fashion. My java file runs a batch file which then runs a script. At the conclusion of this there are series of commands that I need to run (through the command line) ...

In Java, how does a post increment operator act in a return statement?

Given the following code, will ixAdd do what you'd expect, i. e. return the value of ix before the increment, but increment the class member before leaving the function? class myCounter { private int _ix = 1; public int ixAdd() { return _ix++; } } I wasn't quite sure if the usual rules for post / pre increment...

Design by Contract library (interface) thoughts?

I am looking at design by contract for a Java library, this what I came up with so far in terms of the interface. The user could call executeContract and executeContract invokes invokeContract after calling 'require'. ensure is called after executeContract to ensure the correctness of what is returned by invokeContract. This code also...

My JBoss server hits 100% SYS CPU on Linux; what can cause this?

We've been debugging this JBoss server problem for quite a while. After about 10 hours of work, the server goes into 100% CPU panic attacks and just stalls. During this time you cannot run any new programs, so you can't even kill -quit to get a stack trace. These high 100% SYS CPU loads last 10-20 seconds and repeat every few minutes. W...

Hibernate Detached Criteria

I have a DetachedCriteria which I am using to search a table based on a name field. I want to make the search case-insensitive, and am wondering if there is a way to do this without using HQL. Something like: private void searchByFullName(DetachedCriteria criteria, String searchCriteria) { criteria.add(Restrictions.like("fullName", "%"...

How can I provide a Jacl package from the classpath?

I need to distribute some TCL code as part of an enterprise application, and this code must be available to all nodes in the cluster. Due to security policy, the Tcl interpreter cannot access the TCL code from the filesystem, so I must make it available in a jar in the EAR itself. How can I convince Jacl (1.4.1, if it matters) to find ...

Eclipse still using http.proxyHost settings when no longer set

I'm dealing with the same sort of problem as "Zombie http.proxyHost settings for JVM on OSX" except I'm on Kubuntu 8.04 and Eclipse 3.4.2. I had to use a proxy for work but have migrated off it. I've reset everything in my environment I can find inside and outside Eclipse to get rid of setting the proxy. However when I try to use the Sof...

How can I avoid code duplication with many small classes?

I have different classes called English, Spanish, French, etc.: Class English{ String name = "English"; String alias = "ENG"; } Class French{ String name = "French"; String alias = "Fre"; } Similarly other language classes. And one more class called Language: Class Language{ String name = ""; String alias = ...

High level explanation of Similarity Class for Lucene?

Do you know where I can find a high level explanation of Lucene Similarity Class algorithm. I will like to understand it without having to decipher all the math and terms involved with searching and indexing. ...

How can I execute a PHP script from Java?

I have a php script which is executed over a URL. (e.g. www.something.com/myscript?param=xy) When this script is executed in a browser it gives a coded result, a negative or positive number. I want to execute this script from Java code(J2EE) and store that result in some object. I'm trying to use httpURLConnection for that. I establis...

Hibernate <generator class="" > When is it best to use what?

I am relatively new with Hibernate. I used Persistence and Toplink prior to this but didn't help too much when learning Hib. When I define my entity classes, specifically the id attributes,I find myself not knowing which values to use. Obviously theres different situations that call for different values. What do some of these values mean...

Is there a JDK class to do HTML encoding (but not URL encoding)?

I am of course familiar with the java.net.URLEncoder and java.net.URLDecoder classes. However, I only need HTML-style encoding. (I don't want ' ' replaced with '+', etc). I am not aware of any JDK built in class that will do just HTML encoding. Is there one? I am aware of other choices (for example, Jakarta Commons Lang StringEscape...

Converting UTF-8 to ISO-8859-1 in Java - how to keep it as single byte

Hi, I am trying to convert a string encoded in java in UTF-8 to ISO-8859-1. Say for example, in the string 'âabcd' 'â' is represented in ISO-8859-1 as E2. In UTF-8 it is represented as two bytes. C3 A2 I believe. When I do a getbytes(encoding) and then create a new string with the bytes in ISO-8859-1 encoding, I get a two different char...

CSS Parser in ColdFusion or Java?

I'm building something that requires a simple HTML frontend for editing some properties in CSS. However, I need to get the value specified by a CSS file. The only parser I can find is CSS Parser Project , and it is in Java. It implements both Document Object Model Level 2 Style & SAC: The Simple API for CSS API. It should work, but w...

How can I make Cobertura/Emma play nice with an Eclipse application?

My company is in the middle of upgrading our build system to use Buckminster (which has gone well). Naturally the managers would like it if we could automatically generate some of the metrics they use for code while we're at it - one of these metrics is coverage for the unit tests. The previous build, which was PDE-based, resulted in a ...

How can I follow and fully report on a chain of symlinks?

What are the best tools/programming-techniques for following a complicated nesting of symlinks and completely capturing and reporting on every symlink along the way, including those in the middle of a path (See below for more info). Here's a specific example. Consider the following output from a shell command ls -l /Library/Java/Home...

How to avoid ambiguity when calling Java from Matlab?

I just discovered that when calling Java from Matlab object.method(arg1,...,argn) is equivalent to method(object, arg1,...,argn) The problem here is I also have a method.m that does some translation from Java to Matlab (eg. convert String[] to cell of strings). My method.m looks like function result = method(object, arg1,...argn)...