Jim Cheng

Greenhorn
+ Follow
since Dec 08, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jim Cheng

you could try to use interrupt() to interrupt the thread,
which might thows some exceptions
I am not familiar with the plug-in.

One hack that you could try is to Reassigns the "standard" output stream.
Check System.setOut(PrintStream out) to re-direct the output to a log file.

However, I would still suggest to change the code (e.g., System.out.println()) to use logging API.
17 years ago
Make sure that ojdbc14.jar is on your classpath.
It depends on the amount of files you have.
For large mount of files, database might be the most efficient.

For a handful of files, in-memory storage and operations make more sense.

Regards,
Jim
18 years ago
This is an interesting question.
I will try to duplicate the problem and figure out the reason if I have time.

Please also report back if you figure out the reason.


Jim
None of them

Fetch size is the number of rows that should be fetched from the database when more rows are needed.

If a fetch size has not been set by calling the method setFetchSize, the return value is implementation-specific.

Jim
You need to handle special characters properly in Java like single/double quotes.

Could you post the java code which actually embed the SQL statement?

Jim
Actually, it still traverses 1.5N nodes.

N nodes for the first pointer
0.5N nodes for the second.

Remember that in a single-linked-list, a pointer cannot advance two nodes directly.

Jim
19 years ago
"Make two pointers, advance the first through the list, advance the second every other time."

Stan's method would work.

Each time the firs pointer advances two nodes in a row, while the second advances one node.

when the first pointer reaches the end, the second reaches the mid-node.

A few minor issues:
Differentiate Odd/Even number of nodes in the list
Definition of mid-node in each case?
the case when the first pointer advances only one node in the last step..

Jim
19 years ago
Post your code will help others understand and answer your questions
19 years ago
This program runs fine on my Linux machine.

$ java Calories
23
24
23 24 0.0

$ java -version
java version "1.4.2_05"
......

Could you provide more detailed information?
Like the command you used to run, java version, and the exact exception information...

Regards,
Jim
19 years ago