Neil Renaud

Greenhorn
+ Follow
since Jan 19, 2005
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 Neil Renaud

Originally posted by Bert Bates:
Wow!

(You must have been pretty tired of us after 80 hours )

Congrats!



Thanks, it got hard going towards the end but I think the style of the book really helped! So thanks for writing such a great book.

The other way I kept my sanity was by playing table football
Hey,

I've just passed the SCWCD with 85%.

I did it with no previous knowledge of JSPs or Servlets in 10 days studying 9am-5pm with the HFSJ book. I read it through once. Then made some notes. Did the mock exam in the book and the others found around the forums. I found I just failed a couple of the mock exams but I made sure I knew why I get the questions wrong that I did. Once you do that you start to spot the tings they are trying to test which makes the exam easier. Also I think the fact that you know how many answers are correct in the exam helps bump the score up. That or I was lucky.

Neil
I don't think the answer to question 55 is right in my book.

It is a question about setting session attributes and binding listeners.

Where X is a HttpSessionBindingListener and prints B when bound and UB when unbound

The following code

req.getSession().setAttribute("key", new X());
req.getSession().setAttribute("key", new X());
req.getSession().setAttribute("key", "x");
req.getSession().removeAttribute("key");

produces the following output according to the correct answer

"BBUBUB"

I don't see how this can be as a set will replace an attribute, if the following output is correct it means their is a very small amount of time where using the setAttribute method has resulted in key having two values.

Surly this should be BUBBUB?

Can anyone explain this to me?

Neil
I think you should look up ConcurrentModificationException and under what conditions it is thrown by an iterator.

You are probably ok if you aren't going to edit anything. That being said if you aren't editing anything you can use Collections.unmodifiableList(yourList)

HTH
Right, I've got a

Now this is sort of thread safe. However if I want to check an index is in the list and then retrieve it I wold normally do code like this



Now calling this isn't thread safe. So i'd have to put a sychronize block around it. However I thought of another horrible solution...



How offensive do people think that is? I think i'm going to avoid doing it but I wanted to see what people thought.

Neil
Hi guys,

I currently cache all records at start up into a Database object, which contains a set of Record objects.

Now I am looking at locking and from what I can tell a lot of people seem to be synchronizing on a Collection of some sort to store the lock cookies. Which means that all threads get notified when a thread has finished locking a record rather than just the ones that can now lock the record they want.

I was thinking of using a different approach and putting the lock on my Record objects that are already there. This would mean a thread would only be waiting on the object it is trying to lock and therefore a notifyAll will only affect the threads that are trying to lock this record. The record would then store the lock cookie.

Does that make sense? What do people think of this idea? Too complex? Or have I already made the solution too complex by caching the records?

for clarity my lock and unlock signatures are:



Thanks for your input

Neil
Hey,

anyone know if I can "re-download" my assignment. Basically i'm working on it at home but I have unexpectedly come across some free time at work today and was going to use the opportunity to do some more design. So does anyone know if I can re-download the assignment?

Thanks,

Neil
The design is up to you as long as you can justify your reasoning. If you take a look around the internet there are lots of places where you have the ability to search on more than one criteria. I'd suggest having a look at some of these and see how they do it. (One example would be the search page on these forums)

Neil

congrats
any suggestion




I would suggest you get this book:

Amazon

It is fantastic.
19 years ago
Hi ppl,

I've just designed my database scheme and have tried to make it dynamic. E.g. if the scheme part of the database file changes I can still read in the database and create record and field options no problem.

What I am now going to do is have a set of constants that maps position x of my String[] to a field name. Then when I implement the following part of the interface a constant will say index 0 is name, index 1 is location etc. Then from then on I was going to work on names only.



The advantage of this way (as I see it) is that if the scheme changes all that has to be done is the constant mapping changed.

[edit: scrap that if the scheme changes I still wouldn't have to change anything, if the name and location fields were swapped round 0 would still map to name and 1 to location thus the client wouldn't break]


Am I doing too much here? Should I make it less dynamic?

Neil

[ January 25, 2005: Message edited by: Neil Renaud ]
[ January 25, 2005: Message edited by: Neil Renaud ]
No, i'm just not stuck in 2004 I moved on
19 years ago
I do have a must not have command parameters.

I do have a "all configuration must be done via a GUI" but as the only GUI ever mentioned is the client GUI I assumed it would have to be done via that. I guess as they haven't mentioned it I assumed I shouldn't make a server GUI i'm new to reading these specs as you can tell
I passed SCJP in Feb 04 (only just found these forums) with 95%
19 years ago
All valid points.

I guess it is just the enviroment I work in but I always see servers as command line only applications e.g. no GUI as such to enter a database location it would have to be typed at a command prompt but I really dislike that idea.

I'm guessing people have done a server GUI and passed then. In which case I'll do that.

Neil
Hey all,

I've just started my URLyBird project. I have read the posts on here about database location and these seem to suggest there are 3 modes of operating and needing the database location

1) Standalond
2) Client
3) Server

Now my thought are this...the server doesn't need to know where the database is until a client connects to it. Therefore when the server is started for the first ever time (before it has been able to put an entry in the properties file) it just sits there without a database. Then when the first client comes along you tell it the server IP and it connects and the server sends a message back saying "I don't have a database could you please set one" at which point the client pops up a gui gets a location and then tells the server that writes this into its property file. This then avoids the server having to have a gui/command line option/user typing in the location of the database/etc.

Comments?