James Hook

Greenhorn
+ Follow
since Jan 20, 2003
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 James Hook

that was very tough.. but managed to get 152/155 anyway
thanks to everybody at JavaRanch!!
20 years ago
I wrote a routine that iterated through all the classpaths. If the classpath was a .jar file, then I had to use a JAR url to retrieve the helpfile from the JAR file.
My interpretation is that as long the major bits of code
(ie.
1) locking
2) criteriaFind)
in your project are your own, then the odd bit plagiarism
will be ok.
One site I have found useful is JavaAlmanac. This has several
pieces of code that can be copy and pasted - I also have copied
a piece of code that centres the form on the screen.
Hi,
I would be interested in finding out how much people are writing
in their design choices document. Also, what design choices do
you have to document?
I have written a couple of paragraphs about each of the two main
topics (RMI vs Serialized Objects and Extending vs Modifying), but
i'm thinking this is probably not enough.
Thanks
James
You get a
java.rmi.NotBoundException
if you try to lookup an object name in the registry before it has been bound. I can get this exception by starting my client before starting my server.
Sorry, only me again..
Phillipe, I see in your commentary of the code
that you are worried that a large data set would flood
the available memory of the JVM. Given that the
return type of of criteriaFind method is DataInfo[], is
there any way of streaming data back to the caller?
Think I may investigate throwing an exception if this happens. Or is this overkill because the db.db file is so small anyway?
Thanks
James
I see that you have used the String Tokenizer to split the String up..
but what if the criteria string takes the form?
FieldName='sgjhgdsj,gjgjhg=dfgjgjhfdg'
has anybody else used regular expressions to check that the criteria is valid?
There is .NET remoting that looks soooooooo similar to RMI. I heard
at a Microsoft Developer talk that somebody at Microsoft came up with the design of .NET remoting independently. hmmmmmm.....
I have just started the GUI portion of my assignment, but I haven't done any proper GUI building in Java before. Would anybody be able to warn of the likely mistakes that a beginner is likely to make?
Thanks.. James
Just been reading the above thread, and just wanted to confirm..
If the user chooses to operate in local mode then the user could, potentially, be viewing data from the same db.db file as clients operating in network mode. It is not necessary to ensure concurrency in this situation??
just passed - so I can now reclaim my life
Thanks to Javaranch!
[ January 31, 2003: Message edited by: James Hook ]
[ January 31, 2003: Message edited by: James Hook ]
21 years ago
the term 'forward reference' applies to using a method or variable before it has been declared. In c\c++, the compiler has to know the prototype of the method before it is used but Java is not so demanding.
The rules are:
Method Variables - you must declare and initialize a method variable before it is used
Class/Instance Variables/Methods - can be used in the source code file before they have been declared. The Java compiler will probably already know about these methods form a previous sweep through the file.
Good luck with your exam (if you haven't already taken it)
In one of the mock exams I have taken (the Sun one!) I have been marked wrong for thinking that the only time the finally block will not run is if JVM is shutdown.
Should I consider JVM shutdown and System.exit to be two different scenarios for the purposes of the exam?
I am now thinking that JVM shutdown is when the JVM process is killed by the operating system.
the question above is exam 3.2.2 - the question says choose two but the reference says only one is right. - i Agree with the reference!
in exam 2, question 1.1.1 has an uninitialized variable - no, wait a minute - they have fixed this question - hurrah!
They have also fixed another question on the first exam (4.6.2)
Sometimes spotting these mistakes is a good way to learn! Still a bit peeved that they never got back to me!
the question on garbage collection on the first exam goes something like (I have change the names of the objects to protect the innocent!)
with the following piece of code when do o1 and o2 become eligible for collection?

Am I right in thinking
After line 2, no objects may be gc'd
after line 3, what was o1, is now referring to same object as o2, nobody is referring to o1 created by line 1 (1 object is eligble for collection)
after line 4 o2 is refering to nothing, o1 is still a valid reference to the object created on line 1 (still only one object eligible for gc)
Is this a fair comparison with the question on the mock.
Also, the first question on the second mock uses an unitialized primitive!! tut tut!