Kevin Mangold

+ Follow
since Jan 13, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kevin Mangold

Take a look at the RandomAccessFile class. You can open a file for reading and writing, read until you get to the point where you need, then you can output your changes, all from within the same class. I think this would be the best and easiest way of doing what you're describing.
15 years ago
Yes, your ImageResults class has to implement Serializable:

15 years ago
Why not just do this?

15 years ago
One thing I would do is create my own TableModel and within the respective methods, update the database along with updating the data itself within the program.
I never add referential integrity unless I have to. And the "have to" depends on if other developers will be updating the database also. I find it easier to do my own checks within my code than to let the database management system do that for me, because there are some times where I want to perform some action that would make the DBMS complain.

It is good design though to add checks, triggers, and all that jazz. Because, sadly, not everyone is perfect and it might get messed up somewhere down the line.

I've been asked this question before and the first thing I do, before I give an answer, is ask questions about the situation.
sqrt() is much more processor intensive than raising a number to a power. Try to square all your data so you can get rid of the need for sqrt(). All 3D game engines do this to help increase performance.

Brief example, if you are trying to find the distance between two points:
distance = sqrt( Math.pow(x2 - x2, 2) + Math.pow(y2-y1, 2) );
Get rid of the sqrt() by squaring distance.

Unless, of course, you need it to be the square root.
15 years ago
I've had this problem before. My mistake was my use of CR (\r) and LF (\n). I know that C/C++ can be a bit particular with these.
You can also take a look at the Java Communications Package. They have classes for dealing with classes in Windows, Solaris and *nix. Apple's website might have their own port of this package.
Is your server creating and starting a new thread for each client?
Henry's solution works. You can use wait() and notify()/notifyAll() with his solution too.

Another solution is to use a callback method. Use reflection, get a Method object of a target method, then when the thread needs to return something, invoke that method.
I beleive that design topics will never go out of scope, no matter how much technology evolves. I have many old design books as well as many new ones, including database design. The content of the new and old books are generally the same. How can you change the way you design something abstract?

As far as database design goes, UML, I beleive, is very key in creating a well structured database schema. You'd think that a common sense design would be apparent to most (if not all) programmers, database administrators, IT professionals, etc. I have worked for the government for a four years now and I have yet to see a decently designed schema. Even designs thought to be appropriate twenty years ago would have received my approval. There was no planning involved.

Even if UML isn't explicitly used, any form of planning, outlining or drawing the structure of a schema will in some way use UML. Application/database design has been around since the beginning. The term UML hasn't come into play really until the past 10-15 years.

To answer your question Branko, design will never disappear, nor will the search for faster or more efficient ways of searching. It's best to be kept separate. A database administrator should not have to worry about speed of efficiency. They need to worry about design since that will be their responsibility. Speed and efficiency should be left for the database programmers/engineers.
Yes, you need to figure how to get the printer to echo back. All hardware has a way to echo data back if you send it. If you get text back, a printer is connected, otherwise nothing is there.
16 years ago

Best IDE i've used for Java (even compared to the ones that cost money).
16 years ago
A NullPointerException is a RuntimeException, meaning the compiler won't find it for you. Somewhere in your code, and the examples, it is trying to use a null object, hence the exception. Other than that, I am sorry to say that I cannot help much because I am not familiar with JavaSpeech.
17 years ago