if I have say classA and classB which extends classA in classA theres a public static method someStaticMethod
Don't know. I'm not keen on j2ee app servers on the whole, and JBoss is the only one whose source I've looked at.
OK, probably because the choice isn't very large in open source community *sigh*
No, there are a fair few.
hey everybody
just use a thread and poll and be done with it
It's just that the only j2ee project I've worked on used jboss.
…ok…well looking at thirdparty sources is often a good exercice
Yeah. But I only do that for projects I actually care about.
See "I dont' like j2ee" for details.
DRMacIver, yes, we all know you like java ee 5, not j2ee
If Sun can't be bothered to make their versioning system make sense, I'm sure as hell not going to care about getting it right.
(jee6 is showing inklings that it might start to get things right, but I don't really believe it)
don't be too pessimistic
give some details please…I'm not very familiar with J5 so with J6
actually never used in Enterpise
The main thing that looks interesting is jee6 will be doing some cool stuff with the new module system.
I mounted a remote NFS directory as Layout on my file system.. now how to access it in Java?
InputStream _is = new FileInputStream("dir"); ?
I'm holding out hope for decent nondeclarative transactions as well.
I bet so.
Like any file mounted on your system
(Dependent on closure implementations not sucking)
…("/mnt/nfs1/file");
hey, I'd like my axis webservice to throw a NestableException from Apache commons, is there a way ?
Cause default serializer doesn' like serializing a nested Exception
java.io.FileNotFoundException: \\Layout (The filename, directory name, or volume label syntax is incorrect)
But I mounted it (Add new network place)
nevermind.
It seems I need to provide authentication as well. hmm.
chnarr, I can't read the dir.. it says (Access is denied)
The person who created this library was mad.
Mad I tell you!
http://jung.cvs.sourceforge.net/jung/jung2/jung-algorithms/src/main/java/edu/uci/ics/jung/algorithms/util/Context.java?view=markup
why DRMacIver?
See link.
yeah I checked it out
heh need
wtf
It's not the 'trivial data holder class' I object to. That makes sense. It's not even the 'mutable public fields on trivial data holder class' I object to. That's objectionable but mild. It's the *caching a single instance of this trivial data holder class and using and mutating it for all
getInstance calls* that makes me giggle.
Where by 'giggle' I mean 'cry'.
that is an accident waiting to happen ..
And it's not like this is a trivial utility class which isn't used anywhere.
The damn thing is prolific.
but its some edu junk .. these folks dont care about design .. maybe rightfully so, they just wanna see their algo's crunshing numbers
DRMacIver, a singleton?
The sad thing is that it's a really powerful library.
It's not a singleton though.
but you can only have on reference of this class
one*
The constructor isn't private.
It's really just a trivial data holding class which is supposed to be used for holding a graph context (that is, a graph and an element of it)
The getInstance thing makes *no sense*.
well.. it does
its working right ?
'sense' and 'working' are totally orthogonal properties.
so you may request many instances of this class
Lots of stupid things manage to work anyway.
I think the reasoning here is that contexts are not meant to be available persistently, so it doesn't really matter what you do with them, and it may as well save on the allocation.
But… no.
It's still stupid.
totally implies perfection .. be careful with that
for this to make more sense he should have made the ctor private
isn't it?
It's not supposed to be a singleton.
It shouldn't be a singleton.
If he had made it a singleton I would track him down and kill him in his sleep.
As it is I'm just flabbergasted.
it could be better .. much better .. but this is an edu guy .. he's got no concept of what goes on in the real world .. and his papers and publications is NOT reviewed by example of poor pattern impl.
Oh, fuck off.
you know im right .. kisses ? hehe
This "academics are bad programmers" meme has to die.
On balance I've met far more good academic programmers than I have in your precious "real world".
you said it yourself .. powerful package ..
on balance i think your weight needs to be adjusted.
I think the reasoning here is that contexts are not meant to be available persistently, — why
becasuse it's static?
The main use for this is in PredicateContextFoo, Bar.
For filtering graphs, etc.
its ment to be a singleton but its shit .. case closed.
lol
It's *not meant to be a singleton*
Get over your singleton obsession.
get over your antisingleton obsession
first sign of denial is denial .. you need help man ..
Look. It clearly has none of the signs of being a singleton except for implementation similarity. Your brain is just so pattern-rotted that you think "Oh! A method called getInstance! It must be a singleton! MY FAVOURITE!"
wtf
it's not that
it's that it's not making sense without it being a singleton
#kde
a two layer ten neuron network could do better than you right now ..
oops
wanted to join that
DRMacIver, context is private static
but you're right .. getInstance is a giveaway .. returning the local albeit static instance of itself .. yes.. patternrecognition tells me this was most likely supposed to be a singleton …
DRMacIver, you could always create a new instance of context since ctro is public
s/ctro/ctor
The getInstance method takes parameters. If it's any pattern it's a factory.
arrrh … not really .. well.. some bad ass factory it would be no ?
Sure. it's a bad implementation of a factory.
But pattern failure is irrelevant. What is relevant is that it's *bad*
whats more likely this dude thought off ?? 1. nothing at all, 2. facotry 3. singleton
what was the intent ..
what sense could you make out of it?
Yes, I'd definitely create a new one rather than using getInstance. But it's used in existing library code.
absolutely nothing ;p
indeed .. lets just settle on bad
I think I'm going to file this as a bug.
theres also the possibility that he knew exactly what he was doing but was in a hurry and really couldnt be arsed to do it right ..
Looking through the code, this seems to only be used in the visualisation layer.
So theoretically it will never be invoked by more than one thread at a time (as it's all done in the render thread)
bSo theoretically it will never be invoked by more than one thread at a time (as it's all done in the render thread)/b
if I have say classA and classB which extends classA… in classA there's a public static method someStaticMethod()… this method creates an object of classA and invokes nonstatic X() of classA… classB overides X() method… which method will be invoked if I
invoke classB.someStaticMethod()? the one in classA or the one which is overriden and in classB?
be invoked if I invoke classB.someStaticMethod()? the one in classA or the one which is overriden and in classB?
~tias
Try it and see. You learn much more by experimentation than by asking without having even tried.
static methods ignore the inheritance structure.
if bar is static foo.bar() will invoke bar on the compile time type of foo.
oh, ok…
try http://www.javablackbelt.com
and become a blackbelt expert in java stuffs
That sounds like a total waste of time.
yes, but most of java exam subjects code sample are totally unused in real life
That's because edge cases tend to correspond to bad code…
understanding object programming with java let you program nonsense
certification is not a waste of time, in general.. it is helpful to convince (mostly ignorant) people of you knowledge/skills…
sure
If I need a certificate to convince people that I'm good then I've already failed.
and then go back to you bes practices
(Or they have)
you're reasoning as an utopic phylosoph
but say you're applying for a job… the employer doesn't know of how good you're… and certificate give him confidence you're the best man for the job
"best man"? nah certification might say that at least you have the minumum requierments for the job..
nnot at all that you are "the best",
I didn't get turned down by a single company in my most recent round of job applications.
I don't need certification to convince people that I'm good.
^^
But employer is alwas impressed so
^^?
"I refer you to the above"
I agree… but… the employer might THINK so…
stupid employer then
.. get another one!
sure, I'm just making a point here… not arguing about your qualifications (which I suppose are high)
you know, I'm not certified neither
mojojojo_, you are supposing too much…
No one I work with has certification. And my boss is a Java genius.
so do I not need certification to convince neither
My qualifications are reasonable on paper. The difference is that I apply to competent companies who actually know how to judge programmers in a useful way.
yes, and in my last mission, my bosses where all certified, but their code I had to maintain where the ugliest I'd never seen !
ok, ok guys, I give up
hehe..
certification may be a way to offset a lack of prestigious experience
bytheway , being certified can be a requirement in some enterprises recruitment policy
BTW… I think in my company certificates are somehow valued… workers with certificates give more point while the web hosting company is competing in the auction to win given project
mmm….being certified….why not, but for just a version is quite disappointing isn't it ?
although, certification basic, advanced, web, etc….One is just not enough to convince….my opininon is that they want to get more dollars
I was out for lunch…damn lunch time here….have you find out ?
hey, I'd like my axis webservice to throw a NestableException from Apache commons, is there a way ?
when you drawRect does it draw from the y axis downwards, and with drawString from the y axis upwards?
not the same axis
yes. drawString: dunno. tias.
Hm. Well at least they're responding to my "Your code is nasty" bug report.
what chnarr said. You DO calculate x and y the same way, however
(Bet it will result in a notabugwontfix though)
DRMacIver:heh
which bug is this?
joker, I was talking about Apache axis that's why :Op
https://sourceforge.net/tracker/index.php?func=detail&aid=1775331&group_id=73840&atid=539119
(Hm, I've probably just done something dumb like pasting my session ID in there. Oh well. )
But why wwould it be upward for String ??? I don't know, is there any reason ? (cause I'm not erally familiar with it)
uBut why wwould it be upward for String ??? I don't know, is there any reason ? (cause I'm not erally familiar with it)/u
Worst case scenario here is that it woudl result in allocationg O(50,000) objects inside a tight render loop. This is Bad. )
God, I can't type today
it's not, really. for drawRect, you define the upper left corner and lower right corner. for drawString, you define the left point of the string's baseline. it's conceivable that they implemented drawString to go from the know point upwards
the source is out there if you really want to know
mmhmm
Hi. A while back someone (here, i think) mentioned a Free Software tool that did diagrammatic complexity analysis of java servlet hosting code. What was it called?
like distance and cyclomatic and co ?
some maven plugins may do this…
do you receive ?
None of those names sound familiar, but you could be right.
diagrammatic complexity analysis - whats that!
I suppose it's kind of metric results as diagramms
jdepend ?
~JNI
Overlook217, JNI is http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
Overlook217, JNI is a href="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html"http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html/a