Hello,
I made a tool that measure some cohesion metrics on the Java source files, but these metrics depends that you can determine the list of attributes that are accessed by the method, to do this I made a parser that extract the method code, but I got some problems, so I ask if there any tool to parse the Java file and extract the meth...
What's the difference between these two methods of initializing the observers ArrayList. Or any other type for that matter. Is one faster than the other? Or am I missing some other benefit here.
class Publisher implements Observerable
{
private ArrayList observers = new ArrayList();
}
class Publisher implements Observerable
{
...
I'm in the process of developing a simple 2d grid based sim game, and have fully functional path finding.
I used the answer found in my previous question as my basis for implementing A* path finding. (http://stackoverflow.com/questions/735523/pathfinding-2d-java-game).
To show you really what I'm asking, I need to show you this video s...
Hi,
I'm really confused in the following line about the BodyContent class, which I've taken from the Javadoc:
Note that the content of BodyContent
is the result of evaluation, so it
will not contain actions and the like,
but the result of their invocation.
I really don't get it, what do they mean in above line.
...
I have a Vector < String >. Now i want to store those Strings in database. But i have one "but"! The program user mustn't install anything else except J2RE, he will just copy program to his computer and run. Does java has such kind of database?
P.S. Previously i think about object serialization or just simple text\xml file but according...
I'm new to SQLite and Java, and I'm trying to learn things on the fly. I have a column that has some numeric values in it, and I would like to get the sum of it and display it in a textview.
My current code is this:
public Cursor getTotal() {
return sqliteDatabase2.rawQuery(
"SELECT SUM(COL_VALUES) as sum FROM myTable", nul...
It's been about 6 years since I've written Java, so please excuse the rust.
I'm working with a library method that requires that I pass it Class objects. Since I'll have to invoke this method a dynamic number of times, each time with a slightly different Class argument, I wanted to pass it an anonymous class.
However, all the document...
Can anyone recommend a decent java library for face detection (recognition not required, just detection).
The library would preferably be pure java (e.g. no dependencies on other native libs, DLLs or such).
Platforms: Linux is a must; OS X and windows are very nice to have.
Performance isn't a big deal, can be slow, it's for server offli...
What is the best way to read a MIDI file (chronologically) with multiple tracks? (Java)
Note: I don't want to play the MIDI file, just read the messages.
Couple ideas:
Is it safe to assume there are no note events shorter than the 1/64th note? Or should I visit every track and only move to the next tick after all other ticks tracks
...
I have a program where I need to make 100,000 to 1,000,000 random-access reads to a List-like object in as little time as possible (as in milliseconds) for a cellular automata-like program. I think the update algorithm I'm using is already optimized (keeps track of active cells efficiently, etc). The Lists do need to change size, but tha...
Something that has been puzzling me for a bit now, and an hour or two of googlin' hasn't really revealed any useful answers on the subject, so I figured I'd just write the question.
When I create a database in SQL using 'CREATE DATABASE DBNAME' am I implicitly creating a catalog in that database? Is it proper to refer to that 'DBNAME' a...
Hi,
what's the exact meaning of the word "Deployment" in case of Tomcat. Is it just putting any Servlet or JSP file in the web app folder correctly, or I'm still forgetting anything important here?
...
Hi,
I am trying to access request parameters on a web page and trying to set a hidden fields value to the passed parameter. How can I achieve this using struts2 tags?
Something like...
<s:hidden name="myfield" value="#parameters['myparam']"/>
I have tries using the parameters object but it does not work!
Thanks in advance.
...
I'm trying to find all the occurrences of "Arrows" in text, so in
"<----=====><==->>"
the arrows are:
"<----", "=====>", "<==", "->", ">"
This works:
String[] patterns = {"<=*", "<-*", "=*>", "-*>"};
for (String p : patterns) {
Matcher A = Pattern.compile(p).matcher(s);
while (A.find()) {
System.out.prin...
I am currently writing an application using Drools 5.0. This application seems to be running a little slow, but I have a theory why. This application receives many updates for facts already in stored in the knowledge session. The Drools update function under the hood really does a retraction then an insertion. This application has over 2...
I'm assigned to a large project that is going to be done in Java and viewed by a few programmers on the team. I want the code to be readable and understandable, and so want the naming convention to suite everyone that reads it.
I'm wondering if I have to use the Java naming convention in order for other people to view it and understand ...
Why did Java's designers consider it useful/necessary?
...
Hi,
I am intrigued as to how singletons work in Google App Engine (or any distributed server environment). Given your application can be running in multiple processes (on multiple machines) at once, and requests can get routed all off the place, what actually happens under the hood when an app does something like: 'CacheManager.getInst...
Can Scala be used to script a Java application?
I need to load a piece of Scala code from Java, set up an execution scope for it (data exposed by the host application), evaluate it and retrieve a result object from it.
The Scala documentation shows how easy it is to call compiled Scala code from Java (because it gets turned into to re...
I use Appfuse in Java to crank out a quick web app pre-configured with the front-end and backend frameworks of my choice. Appfuse used ANT or Maven to build a web application.
Seeing as .net has equivalent frameworks & tools to Java, i.e. ANT and NANT, Hibernate and NHibernate, log4j and log4net, Spring and Spring.Net; Is there an eq...