Tom said:
Pay attention and read the entire message before you start steaming
If you don't want me to start steaming, then be more diplomatic in your
posts. Accusing me of gross incompetence will merely put me on the
defensive and make me entrench myself. Then nothing else you say will
make me budge.
The reason for this is simple. If we are collaborating on finding a
solution to a problem, then great! I'll consider any suggestion you
have.
If on the other hand you are bullying me and making sullying statements
about me (or implying them), then you are my adversary rather than
partner, and you've created a situation with winners and losers.
Obviously, if I do or say anything that amounts to acceptance of your
judgment of me, then I lose, so I can't do that, and that means I have
to argue against whatever you're saying. I certainly cannot start
believing it, since it would mean starting to believe whatever
insulting thing was implied along with it. The reason for that is
itself simple: any other policy on my part would open the door to
letting any Tom, Dick, or Asshole on usenet convince me of whatever
negative claims about me they wished. I'd be letting anyone manipulate
me into all kinds of nihilistic, futility-implying beliefs, which would
probably end with suicide. The third option appears to be to disbelieve
the insult but not publicly oppose it, which will still leave whatever
audience there is with the unopposed impression that the insulting
claim might be true. That's not a much better outcome, since having
everyone in the world believe something bad and untrue about me (even
while I don't) would probably interfere severely in being able to
continue anything resembling a life worth living. Anti-me propaganda
must be met with an equal and opposite force rather than allowed to be
disseminated unopposed. Since I don't believe in censorship, forcibly
shutting up my attackers is out of the question too. Clearly,
therefore, the policy I adopt, which is to fight back with
counterarguments when anyone publicly claims something hostile to me,
is the only viable option.
there is more than just vivid rudeness in this reply. There is also an
actual attempt at providing some help.
Help? Unfortunately, attaching some "help" as a rider to a steaming
pile just ensures that it goes into the compost heap along with all of
the accompanying reeking shit.
As a rule, gifts wrapped in fancy paper are accepted far more
frequently than gifts left in someone's toilet bowl, and there's a
reason for this.
Only Allah knows why... (LOL).
This could explain a great deal...
But that all depends on whether you want some help or are just out to
assert yourself.
Well, first of all, the original problem raised in this thread has long
since been solved to my satisfaction, so actually, I don't. As for
"asserting myself", in response to a serious insult leveled at me in a
public forum, you're damned straight.
What insult did I commit? Is it that asked you not to be
condescending?
Hypocrisy is almost as bad. But the insult was the accusation of
incompetence.
In any event, your advice is suspect, since you suggested that
synchronizing access to a shared object in a concurrent application was
"unnecessary complexity". I disagree, especially given that it not
being synchronized was in fact causing difficulties before.
[Further insults]
You need to deflate quite a bit. This is a public forum, where the aim
is to try to provide help.
Unfortunately, some of you have forgotten that, unless you honestly
believe that the best way to help *anyone* is by insulting them.
[Insults my intelligence]
There are messages scattered around from the last couple of weeks, where
you seem to have some problem with your program and the fault is
definitely not yours, it has to be java, it has to be...
Well, let's see. The priority queue NPE is now part of the Java bug
database as an apparent regression in 1.6 vs. 1.5. That looks to be a
genuine library bug. This NPE proved to be a concurrency problem and
has long since been solved.
Because there can only be one solution for this task? what arrogance!
That's odd. In another thread here, people are blasting me for
considering that there may be more than one solution to a task. Now
here, with zero evidence, you accuse *me* of claiming there is only one
solution.
Did you ever read ESRs "How to ask questions the right way" (I'll leave
it to you to find it on the net).
I fail to see the relevance. You appear to be recommending some kind of
non-Java resource. It sounds like it might be a self-help book or
something similar, though, which implies an insult. In fact, the phrase
you've quoted itself implies an insult, namely that I'm doing something
the *wrong* way. (And now who is saying there is a right way and a
wrong way and arrogantly assuming the only correct way is their way?)
[Snip a whole lot of rubbish]
I stated some simple requirements, and you've failed to provide even a
sketch of your idea of a preferred implementation. Sorry, you scored 0
points in this round.
What you did instead, mysteriously, was ask a whole bunch of questions
seemingly with the intent of making me redesign the thing. If I did
that, I'd end up with the same code I have now, for obvious reasons.
Unless you suggest something else that obviously doesn't occur to me
otherwise. And you seem to be refusing to do so!
Maybe if you explain more than just a little bit of the problem you can get
some real answers!
Sorry, no can do. I will not divulge more than the minimum required,
and I did that in the post you are replying to in a part of it that you
completely ignored.
No, I have not misunderstood anything, I have read all the posts and I
know what the posters say. But you do not have time to listen, as you
throw out insults instead on focusing on what the posters are trying to
say to you.
Excuse me? *I* throw out insults? What is this, some kind of
transference, or whatever the psychobabble of the month for this
particular pathology is?
It is *you* who has persisted in throwing out insults.
Fortunately you do not have the possibility to control what I say, when
I say it and where I say it.
You misspelled "unfortunately".
You don't seem to have noticed that people here have actually tried to
help you
Really? Maybe early in the thread when I actually still needed it. I
haven't seen anything recently that looked like any kind of "help",
other than people trying to "help" me believe nasty and awful
accusations, start feeling bad about myself, and maybe go kill myself
or whatever it is that they seem to want.
but you have been so busy cutting them of with rude remarks
and self assertions that they simply cant be bothered to help you any more.
Really. I'm the one making "rude remarks" in your twisted perceptions?
Actually all I've done is refute some insulting, malicious remarks
people have made *about* me.
Now, if you are ready to listen, I will give you the suggestions you
think I am unable to provide.
Really? (And I never thought you were unable to give suggestions; just
unwilling, or at least unwilling to do so in a civil manner.)
[Insulting suggestion of malodor deleted]
That one doesn't need a detailed rebuttal. It's clearly ludicrous,
given the nature of the medium.
- what is the purpose of what you are trying to do?
Outside the scope of this discussion, and proprietary. Sorry.
- why do you need a deep directory structure with files scattered in it?
It is a cache implementation. Beyond that, you don't Need To Know(tm).
- why do you need support for multi threaded file operations within the
same directory structure?
That's irrelevant. It only matter *that* I do.
- can other solutions help you better?
Since it's multithreaded, I don't see any superior method to using the
"synchronized" keyword; sorry.
- the design and implementation you have chosen is not very maintainable
I disagree.
- the code its more complicated than it needs to be
- i.e. there are too many difficult to control side effects in the
code.
If this is true, it's also unavoidable.
1- don't use multi threading
- but that only solves your immediate problem, so you could almost
just continue to use multi threading.
This is silly. For one thing, the nature of the larger application
requires multithreading. For another, all of the file operations in the
directories in question are now in critical sections synchronized on a
single common Java object, and so in effect it already *is*
single-threaded for that purpose.
2- add some proper file error handling code, to allow you to recover
from file errors, as the file system is not very transaction based.
It has the potential to throw IOException; where file manipulation is
done there are catches and finallys to deal with these here and there
(e.g. to close streams). I'm fairly sure all the needed error handling
is already in place.
3- not use deep directory structure but some other method instead, such
as dotted hierarchical file names in one directory.
This has issues of its own and was ruled out a long time ago. Why isn't
your concern.
4- design the directory operations in a singleton object in its own
thread, with a message queue to send commands through.
This occurred to me as well, but it means adding a new class and other
complexities that just don't seem necessary given that the same effect
is achieved simply by synchronizing.
5- a recursive clean up method instead of the iterative version you
have chosen.
The directory construction uses "mkdirs" so there's no recursive
user-code to unroll along. Besides, construction and destruction may be
widely-separated events.
6- extend 4 with a separate TimerTask thread run every x seconds.
Complexity abounds. And you suggested that *my* method was too complex
for just adding a few "synchronized (foo) {" and "}" pairs here and
there!
And the operation that creates a
file in the directory structure must also be able to create any
missing directories, so it should be able to handle disappearing
directories
It already does, with mkdirs.
7- or even better, combine 4,5 and 6 into one solution, where the
TimerTask is to add a message in the message queue signalling clean-up.
Now the project we're currently discussing would have more classes for
doing just this cleanup than it does for doing the whole rest of what
it does.
