I have a set of objects each associated with a connection The object only contains a channel and an Integer field

can anyone look at this and tell me why a ParseException is being made?
http://pastebin.ca/647375
I can't see any reason why the SimpleDateFormat class cannot parse that string, but for some reason it gives an ParseException

how are you passing the date in the string?

eh?

nevermind
hadn't looked at code yet

lol, you got the pastebin then
g[r]eek: turns out that if I set the locale to new Locale("en","GB") instead of Locale.getDefault() it works fine
my locale here is spanish, I think maybe it has a problem with this date format

must be.
i have no clue otherwise

in addition, because the month Aug, does not match the locale settings abbreviation for August, in Spanish, August is Agosto, it doesnt parse correctly

oh well there's the cause then
well spotted
waht does getAvailableLocales() give you

mmm, this wss4j project for ws security is little out of date, isn't it?

hmm?

i'm checking Mule's security… it uses WSS4J
I think nobody uses that anymore…

ah. are you a committer?

he, no

popular project i must say

wss4j?

oh crap. i read emule
my bad
and i was sitting here scratching my head wondering why you'd need wss4j with emule

maybe its because axis2 now has its own wss implementation

yep, and CXF also…

app server?

"Axis2 comes with a module based on Apache WSS4J [1] to provide WS-Security features, called "Rampart""

yes

ah, jboss i presume
ah, jboss host i presume
hey cut it out

hey

Exception ApiException is not compatible with throws clause in Object.toString()
can someone help me please?

hi, i've an issue. i created jList1 via Netbeans, everything is fine except one - my problem is that each row is small - height about 2milimetres… i tried to set up bigger font, but it didn't help… how can i make "bigger" rows?

test case in pastebin?
~tell gothicNafik about test case

gothicNafik, Provide complete, compilable Java SOURCE CODE that shows the problem and nothing else. Be as brief as possible. (See http://javafaq.mine.nu/lookup?364 for details and a HOWTO.)

ok, i will paste it on a web…. give me a second

bbl

~pastebin

http://eugeneciurana.com/pastebin

ResourceBundle.getBundle("../../Hello"); finds Hello.properties fine, but "../../foo/Hello" doesn't find foo/Hello.properties.

http://eugeneciurana.com/pastebin/pastebin.php?show=3501 starting on row number 130

yikes, that is not nice-looking code…
no comments? what is this class supposed to do?
too long lines, that paste has lots of extra line breaks in it …
you do not close your readers in a finally-block

my eyes! the googles! they do nothin!

your indentation seems broken at line 136
a test case should not be in a package, it just complicates testing by others.
when I run that class the jvm exits directly
did you try that code yourself?

compilation and build is ok

yes, the code compiles, but with an empty main(…) it will not do much

And classes should start with a capital letter

gui.Main();

according to sun:s java code standard. You do not have to follow it (but I do in this regard)

program works fine, except that small rows

Exception ApiException is not compatible with throws clause in Object.toString() — how to handle that

that your method names are not english does not help, reading your code is not easy for me…

Sure, you don't _need_ to follow it. But if you don't (and mix both english and someLangeuage in looong lines) help is a lot harder to get here, imo. At least from me.
Hmpf. You beat me to it

when I add a Main() call in main(…) I get a window, with two white boxes, the left has a tree with one root and two nodes

i am sorry about that, next time i will write all in english

agreed

yes

but I myself do not follow the sun code guide regarding '('. I always put a blank before it (and make sure my pre-commit hooks checks for it)

and the second one (on the right side) is jList
but that jList has very small rows

the right contains nothing.
it is about 3 cm heigh

you are not right, jList1 contains data

could be because I do not have the valhala-data directory?

damn. I can't make toString() function throw my own exception?

lines 130-134

No

you can make it throw a RuntimeException, but not a checked one
(or subclass of RE of course)

i can see rows in jList with text… that's everything fine… i just want to make take rows bigger
on height

provide a test case that works for more people and do not depned on files that only exist on your hard drive

setFixedCellHeight() ?

g[r]eek: and this is method of jList?

g[r]eek: that is not the problem…

Neither do I (following the guideline completely). But a common base for "code that I want others to look at" is really needed and sun is closest here, imo

that setFixedCellHeight() works, thank you

maybe, but I do not care much as long as the code is using only one style guide

blank before '(' everywhere, including method calls?

yes
"new Foo ()" as well as "fooFactory.newInstance ()"

yuck

that was what I used in C/C++ a long time before I started doing java….
why should I think about what is a constructor/if/for/… or a method call

I've never had to think about it

http://www.firebox.com/product/1861?src_t=sbk&src_id=armyknife ???

neither do I… :-)

[krustofski]: heh. dunno. never seen it
it does use the word 'ridiculous' in the description, so they're not trying to be serious
[krustofski]: there's plenty of chatter. it looks real

that knife is only needed when you have to open a shitload of chardonay underfire

ok mr williams, shhhh

haha

well, you gotta admit, being under fire is when you really really want your chardonnay!

lol

yo!

yo homeslice.
wassup, bit-o-lemon?

5am. that hte javax.print library sux0rz. just generate a pdf and call acroread to print

why is there no Collections.synchronizedDeque() I wonder

heh

adobe's command line optiosn

I can see that

g[r]eek: you betcha. i even know what it is. acrord32 /h /p foo.pdf
*zing* off she prints.
i spent, oh, a good 12 hours trying to print a GIF from java web hosting via the javax.print library. it was horrifying.

o/~ move me on to any black square, use me any time you want… just remember that the goal is to capture all we want… o/~

mm, yes.

o/~ diddit diddit diddit diddit diddit diddit diddit di-dah o/~

*shookahshookahshookahshookashookashookashookashooka*

I'm still in the hammond bit
so HA HA HA

the shooka's are before the hammond. neener yerself.

o_O

shooka? Oh, the shakers

it made me think of "sound chaser"

that series of albums from Yes ranks among my favorites

Going for the One

yah, the shakers are in the first few versus, behind the dittit-dittit parts.
you listen to radioparadise?

mmm

erm… no bells ringing

ah, you should. you'd like it.
http://www.radioparadise.com/

I'm listening to Arcade Fire a lot lately, though, which is very uncharacteristic for me and thoroughly enjoyable

I've been meaning to pick up tormato and topographic oceans, just to round things out

tormato and oceans are just too indulgent for me… after Going for the One, Yes kinda went "no"
90125 and Big Generator were good, but they weren't really YES

one thing RP does is you can rate a song as it comes along. look at my ratings here - you get an idea of the sort of stuff they play:
http://www.radioparadise.com/content.php?name=Members&file=userinfo&u=12619

yeah, I actually have a separate classification in my ipod for Rabin's Yes
Drama was OK iirc
I don't have that one either

Drama wasn't yes either… sorry, without Jon Anderson it ain't yes

that article by weiqi gao… what a load of carrots

yeah, it was mostly the buggles iirc
the buggles with squire and white

ever listen to Anderson Bruford Wakeman and Howe? (yes-not-yes) ?

and rabin's yes… it was sort of like what someone with a hell of a lot of skill would imagine Yes as being had they never heard it
g[r]eek:
yes

eidolon, yeah - my favorite bassist (tony levin) played with them

yes, THAT group rocked… all they needed was to replace Levin with Squire and you'd have had Yes… and since Howe was the driving force behind Yes anyway, it was closer

but yet - they were kinda so-so

Bruford was playing an electronic kit.. I never enjoyed that much

all hail bill bruford.

yeah it sounds really… artificial

so if you're a classic Yes fan, I highly recommend Spocks Beard.

It's wierd, for a band that was supposed to be so far ahead technologically, Yes really wasn't all that brilliant on the effects/synths front

but I do listen to the resultant live album quite a bit

Pink Floyd was the same way

they didn't need to, and thank goodness for that. their ahead-ness was in arrangements and pure unadulterated skill.

for all their reported brilliance as technologists, they relied on the farsi organ a hell of a lot

gonna have a hard time finding any better series of musicians than squire, how, anderson, and bruford
howe.

is that a new java lib?

I saw the last tour though, they had the "classic" lineup again
was excellent

Rush has gotten more technologically reliant mostly because the arrangements finally went into eight-musician territory, which three musicians just couldn't do live

brb.

yeah

hrm. must've stumbled into ##oldmusic by mistake.
weird.
damn mondays.

lol

the "ladder" tour was so bad that I almost didn't go this time but I'm glad I did…
bthe "ladder" tour was so bad that I almost didn't go this time but I'm glad I did…/b
and that's all I'll say about that

the House of Yes recording was really good.

somebody must have a case of the mondays :|

and I liked the Homeworld track… the rest… bleh

i have a case of the idontwannaworks

but that's kinda my feeling for all Yes post-BG

"Talk" was at least as good as BG imo

You know, I haven't heard Talk

~fap cheeser

Is that sad?

pick it up, it's quite decent

right, so, here ya go. classic music that was ahead of it's time, IMHO
Moody Blues - Question

rabin actually tried to get wakeman for it, but there was some contractual problem

yeah, wakeman and contracts have never worked out
for such a wanker, MAN was he awesome in concert

yeah…
brilliant

but he caused more problems for Yes than anyone else has
put the band into bankruptcy when he JOINED

they're supposedly touring again next year
40000th anniversary or some such

only 40000th?

have you guys ever coded/designed a system and then when its just about ready to goto production you realize that you coul dhave improved on it with just some more time?

I hear they're the reason that Java went with a "long" for timestamps instead of an "int"

almost every time
no, if that was the reason, java would have had long longs

ug im having to rush to get this system out and now im wishing i had more time to revamp some things =\

Aradorn, don't worry about it - if it meets the requirements, it's as good as it needs to be

yeah

learn for next time

its 10000 times better than the previous version
ive completely rewritten it in about 4 months

g[r]eek: that weiqi gao post has gotten me a lot of flack

i'm not surprised.

it's funny for me, because people didn't get what I was actually saying

i figured you were saying "don't hire this guy. anybody. ever."

changes are weiqi himself missed it
g[r]eek: what's funny is that weiqi is a really bright guy

is there a simple stringy object/method for string substitution like "hello %name%, how are you on this lovely %day% ?" or something similar. in .NET and ol' C it's prety easy.

yes

that's what i like about publishing an article on tss. it can either make or break you. if it makes you however, then what a way to earn a rep

g[r]eek: yeah… although a large part of me frets about what I'm doing to myself and my future employment possibilities

hehe

what's the name ?

PrintWriter

perhaps a tad taboo, but what are your thoughts on infoq

jottinger thanks i'll javadoc it

pm welcome

g[r]eek: *shrug* not taboo, I think it's good for what it is
I think it has some fundamental challenges ahead of it, many of which I think the cult of personality will help evade
but I hope - for Floyd's sake - he never loses that cult
bbut I hope - for Floyd's sake - he never loses that cult/b

i guess that's your experience in these matters talking. from my point of view, all i see is a jack-of-all-trades attempt with one helluva interface

g[r]eek: you like the interface?
you should be a fly on the wall for floyd's and my conversations

yes. that's not to say i think it's superior to tss's.

we're good friends, of course, and I plan to keep it that way
g[r]eek: InfoQ's interface is WAYYYY better than TSS'
I'm terrifically glad infoq is there, it's helping drive the TSS rewrite
and yes, there is one

So you are spending all your spare time rewriting the TSS interface?

I'm working on a final revision of the requirements doc today, in fact
god no

tss's does it's job well. infoq's is more web2.0'ish

g[r]eek: for our audience, we need web 2.0-ish
the average TSS reader considers himself ahead of the curve (like all drivers, they consider themselves to be above average) and they expect their tech sites to be ahead too

but like i said, i like that fact that tss is java full stop.

g[r]eek: *nod* that's likely to change slightly… but we're never going to abandon the platform

has bitten off a big chunk…

the language and platform are changing too rapidly for us to stay just java (language and platform)

lets hope they chew well.

we'll slowly integrate groovy, ruby, python

g[r]eek: infoq allows you to filter out some of the ocntent yo migh tnot wat though, doesn't it?

g[r]eek: They're not doing what they'd like to do, I think
only with coarse filters

sure, that's what makes their interface great
interesting i've never really given the filter an in-depth analysis. i don't bother much with non-java material

how do I read from an URL if I'm behind proxies?
http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html

for a tech media company, our technical acumen blows

http://pastebin.ca/647461

there is a company behind TSS?

is tss your full time job?

however, after the error messages, I do get the contents

g[r]eek: yes, among others

kids?

yes
g[r]eek: and other consulting
Rod Johnson actually asked me how I found time

hmm, I never knew.. not that it changes anywathing..

Well, it does, in some ways

Heh. That's putting it mildly

i like the idea of making a living from managing a popular news board / blog

we're backed by a huge media company, which is good and bad… good because we have funds to push forward, bad because it's a media company and not a tech company
[TechGuy]: putting what mildly?

Having a media company behind you is good and bad

[TechGuy]: ah, yeah
well, having a three-year project shut down due to requirements - when you have domain experts in house and screaming to let them help - is baaaaaaaad

been there, done that

some of the questions I managed to get were staggering
they were planning on using a JCR product… and pondered using an in-house search library or google

nice

(for the illiterati, JCR includes - and mandates - a full-text search solution.)
they also wanted to avoid ajax because it wasn't seo-compatible

Yeah, we're going to use JCR, on top of Hibernate, with Lucene
heeheheh

that's probably my only fear in growing my software company - reaching the stage where it's not longer simple to redesign something / enjoy a good hack. bureaucracy is a necessary stench
*no longer

g[r]eek: well, the key is to keep your business' goals in mind

My business goal? Get big. Make money.

Interface21 uses drupal, for example, which is PHP

goal #1 - no employees

mmm, drupal.

I blasted them for that, but their response was correct - their goal isn't to use java, it's to use something that works
that said, Rod's remembered that I said that for years now… and he brought it up last time we met

hi. im stuck

mostly because SOMEONE mentioned backing TSS with cakePHP (not me)
get some lube.

breath in, and try to move.

breathe out surel
who designed the infoq interface?

inside toString i'm throwing checked exceptions..

g[r]eek: floyd, I think…
floyd and alexandu popescu

you guys on 'good' terms?

g[r]eek: yes

Don't do that then

we IM on a fairly regular basis, we consider each other good friends

cool. you guys are like a mini version of gates and jobs
well, not quite. impulsive idea that sounded neat at first

Exception ApiCheckedException is not compatible with throws clause in Object.toString()
im stuck here

~jottinger

was that a compliements, or..

I guess the factoid 'be jottinger' might be appropriate:
There are no stupid mistakes, only stupid people.

bleh
++

~literal be jottinger

replyThere are no stupid mistakes, only stupid people.

i created two classes of exceptions, ApiCheckedException and ApiUncheckedException

~literal api war

I have no factoid called "api war"

~literal apiwar

I have no factoid called "apiwar"

~be g[r]eek

Feta is to cheese what Ferrari is to cars.

~api wars

I guess the factoid 'be api barbie' might be appropriate:
Javadoc is *hard*!

start api war ?

darn it~

~smack jottinger

~start api war

but inside toString I need to throw checked exceptions

I guess the factoid 'backwards compatibility' might be appropriate:
the operative word in "backwards compatibility" is "backwards"!

it doesn't let me

damn it

We already told you, you can't

~ide war

jbuilder 0wnz

there~

why do you want to do that?

~literal ide war

reply(netbeans|eclipse|idea|jbuilder|vi|notepad|jedit|emacs) (rocks|is cool|sucks|is shit|0wnz|is teh suckz)

ernimril, i created two classes of exceptions, ApiCheckedException and ApiUncheckedException

forget be jottinger

I forgot about be jottinger, jottinger.

ernimril, for my api

no, why do you need toString() ?

hm.. ernimril, i'm using in it some reflection

for what? why not use some other method instead?

be jottinger is reply(There are no stupid questions, only stupid people.|Darn you all to heck!|I hate you.|I don't hate you, just everything about you.|Everybody dies.|Everybody dies, and that's GOOOOD.)

Okay, jottinger.

~be jottinger

There are no stupid questions, only stupid people.

~be jottinger

I don't hate you, just everything about you.

yay!

~leave
:|

would developing a locally focused (why bother competing with the big guns) add value and what sort of content would be necessary?

where do i put the applicationContext.xml, web.xml, xfire-servlet.xml; normally they go in war/WEB-INF/ but in this case mvn is looking for it in /home/username/workspace-3.3.0/ApplicationName/target/ApplicationName-0.0.1/WEB-INF/web.xml which gets wiped on every mvn clean

a locally focused… missing noun?

ernimril, http://rafb.net/p/FznwLr39.html

erm, yeah, i meant to say something along the lines of "focused on local happenings" as opposed to internationally viable

that does not say anything?

Narada put resources in project/src/resource under mvn

src/main/webapp/WEB-INF

g[r]eek: I'm still missing a noun… you mean a locally focused site?

ernimril, i need some format in toString

Wha… *anyone* can tell the bot to leave?

resources even

[TechGuy]: don't ask me, I didn't code the damn thing

*doh* yeah, a site

ernimril, i'm checking if the values of the fields are set or not

like a mini-tss - a place to share technical articles and the like

g[r]eek: I dunno, it can be useful, you just need to be aware of what people in your area need

ernimril, if not append NOTSET.. otherwise append value.

using toString and expecting it to do what you want is not good, if you need a method that returns a string that is well formed, then add a getWellFormedString() in some interface and make your class implement that interface

BTW, l10n is one of the requirements for the new TSS

[TechGuy] yeah…. The author frequently gets asked to leave too.

and pass the more popular ones upstream to your site etc

Do that in the constructor or whereever you create the object.

umm is it src/resources or src/main/webapp; i'm getting conflicting answers
this is a service not a webapp; do i still need to put it there

resources.

Hi, Is there a channel for JSTL or is this one good for that too?

Throwing an "I don't have X, so I'm useless" exception in toString() is quite - nasty. Stupid?

Maven in fascist about some things.

like it would be interesting to have smaller technical blog sites that can be moderated, and the most popular articles get fed through to tss for potential publishing

anyone know of a plugin similar to firebug for ie?
(off topic i know)

if it is a module it will land on classpath:

well, if it's war host pacakge, webapp makes little sense ;9

g[r]eek: yeah, could be

but that kinda defeats the purpose of writing with a specific community (locality) in mind
interesting idea though. i'll give it some more thought

src/main/resources right? i put it there but it still complains; anything else i need to do

is it necessary that I create ApiUncheckedException ?

an example that comes to mind - i'd be very interesting in reading articles from indian companies that provide outsourced development services

if it is there and you have a build that is correct it should be fine.

gawd excuse my english

ernimril, but I'm using String class alot

g[r]eek: That is how they would begin.

good point

you can use String, but you should not rely on toString() to return what you want

I see. but getWellFormedString() will return a String no?

since I do not know what you are trying to do it is kind of hard to tell y ou…
yes

how come i can't cast an object i created with Object object = new Object[]{new Object[]{something}} like Object[][] test = (Object[][]) object; ?

reflection is in most cases the wrong answer

=(

how can I read from URL and avoid java.security.PrivilegedActionException

g[r]eek: no worries

thanks that worked; resources didn't

sign your applet…

g[r]eek: what you're talking about can be done, but it'd be very difficult
not technically, mind you

ernimril, it's not an applet
ernimril, http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

ok.. webstart run in a similar sandbox, so sign your app then… or are you using some other sandboxed environment?

I'm writing this

Good morning.

ernimril, I'm using a proxy server… maybe that is the problem

if tss somehow spawned regional sub-sites, each with their own editor in chief for supervisory purposes, and each allowing the moderation of locally produced articles, with the best being fed through to tss global. something along those lines

you have not really said what you try to do or how, provide a test case…

doAsPrivileged

what about log4j properties etc; same place?

Yup

at least that way we wouldn't have to worry about guys like Gao

fmarceau, oh, let me read about that

g[r]eek: haha

AccessController.doAsPrivileged(subject, action, null);

g[r]eek: I don't like your idea, I'd be irrelevant and my goal is to BE KING OF ALL OF THE EARF

you obtain the subject via the LoginContext (JAAS)

editors can be female

ernimril, in to many toString functions of my classes i'm returning MyMethods.outString(this.getClass(), this);
s/to/so

of course they'd be moderated into position too

fmarceau, login?

jottinger's techno-harem

I do not care what your toString-methods return, I know what I expect of toString…

ernimril, i'll take your approach as the first solution to the problem.. [interface]

http://www.jaasbook.com/

because they are different types

but I'm not logging in anywhere ^^;

note that if you could describe your problem on a high level, then maybe you could get better directions…

then, one day, when anyone needs a technical article, they can search global tss for things like "java 1.5 jboss 4.0.5 thisThatException" and some bloke in panama will have written up a solution

joedj, is there a way to nest arrays and then cast back?

as it is now you say like "my toString-method does not work"

wait this is beginning to sound like google.

g[r]eek: heh

http://java.sun.com/docs/books/tutorial/networking/urls/readingURL.html
only the URL is different

ernimril, I have a class with so many fields (and it extends another class with 5 fields too).. and i needed to output the fields in toString if they're not null.. using if/else so many times kind of suck so i decided to use reflection..

does that example work for you (when it is as on the website, no edits)

fmarceau, I'm not sure if jaas is what I want since I'm not really trying to log in anywhere

only if you create it like new Object[][]{new Object[]{null}}

ernimril, collecting the non null fields in a buffer and printing them..

bbl

joedj, if you have to specify the [][] then how can it be done dynamically?

ernimril, this is mainly why i had to use reflection in toString

ok, that does not need to throw any exception….

joedj, is there a way to use reflection?

you don't have the choice since you're not gonna change the policy file on each machine the applet will run on

it is not what I would do, if a field is null, then I want to know that

InvocationTargetException, IllegalAccessException
hmm.
ernimril, you could know that.. but there are so many fields

1) do not use reflection 2) catch the exceptions internally and handle it

http://pastebin.ca/647461

if you have many fields then chances are that your class tries to do too much

fmarceau, I don't have an applet

ernimril, i'm setting the non null or empty fields to NOTSET

use reflection to do what, exactly?

instead of "null"…

err
i'm setting the null or empty fields to NOTSET
i meant to say that.

joedj, a function based on a counter that can nest arrays and return something that can be cast to the n demensional array that was created, i don't see how though if one has to specify the [][]..

ok, it looks like you need to tell java to use your web proxy then

euh sorry… i though i've read that

NOTSET instead of null, NOTSET instead of empty.

Which one of the java datastructures is a sorted list. I for instance want a sorted list of Integers. Then I want to do: instanceName.getFirst()

ernimril, and as I said earlier, I get [for both urls] the page, but before that I get a huge pile of exception info
ernimril, how do I do that?

It should also have a map type structure, with key=value pairs, and sorted by value.

ernimril, methods 2) seems what I need.. but in that case ignoring a new interface.. and not covering all the exception in ApiException.
method*

Oh, heck, who knows… Something like this?

you google, I do not use a proxy so I am not sure… (I think you do something like "java -Dhttp.proxy=…. " or similar)

~tell fifo_ about javadoc SortedMap

fifo_, please see java.util.SortedMap: http://java.sun.com/javase/6/docs/api/java/util/SortedMap.html

isn't there a list of java datastructures in the docs?
I can't find such a page

ernimril, isn't there a way to tell an application to use a proxy from within the code?

why do you care about dynamic when you want to use a cast like (Object[][][]) anyway?

I would probably still question your use of toString(), it is not a method that you should use to format data for the end user
you can probably use System.setProperty to do that…
but you still need to google for the correct property

joedj, because you just said when i create it i can't just use an array of an array of array, etc.. i have to do array[][]{array[]{}} etc… how do i do that without knowing how many demensions it starts with?

ernimril, but my toString calls outString(this.getClass(), this), and inside that I use StringBuffer to form the output.

thanks, ernimril, now I know a bit more what I should be looking for

again, why do you need to use toString?

how do you do the cast without knowing how many dimensions it starts with?

joedj, the person outside the function would do the cast on the returned object

ernimril, because mainly i'm dealing with Strings.. and it's a function of Object.. overwriting it is nice..

heh, assenta is really cool but is absolutely slaughtering MS outlook performance… and outlook wasn't that great of a performer in the first place

why do you need to use Object? why not use SomeInterface with a well defined method that returns a string?

too much work!

ernimril, so back to your solution # 2

I still have very few clues about what you are trying to do, but I guess that it is what I would do

you can do it with Array.newInstance
e.g. (int[][])Array.newInstance(int.class, new int[]{10, 20}) creates a 10×20 2-dimensional array

joedj, ah ok, thanks that helps a lot

man i love maven; it's so much less work compared to ant

mvn rocks for sure

mmm mant.
er
mmm, ant.

ernimril, fmarceau, I tried both the -DproxySet=true… and System.getProperty().put("proxySet", true);… but I still get the exact same exceptions

Is there an easy way do a lookup on a collection using it's hashcode?

huh?

ernimril, ok well now getWellFormedString() calls my static function that performs the reflection stuff and i'm able to throw ApiCatchedException in it. nice.

I have an object X, which has a field Y. I want to be able to lookup X in a collection using either X or Y, because X returns as hashcode Y.hashCode().

no, fifo_

dmlloyd :/
So I would just have to create an instance of X everytime?

seems like you need to set proxySet, proxyHost and proxyPort, did you set all 3=
s/3=/3?/

How heavy is instance creation?

ah, I think I know what's the problem

it depends

ernimril, yes of course, that what the "…" was there for

fifo_, quite cheap if the objects are small and don't live long

ok, I am out of options, google more and see if you can find anyone else that has that problem…
(since it works well for me)…

I have a set of objects (each associated with a connection). The object only contains a channel and an Integer field (used for sorting by activity). I want to be able to do a lookup on a SortedSetThisObject, using the channel. I figure by your statement this would be cheap/fast?
These lookups happen often

maybe you want a Map

dmlloyd, it has to be sorted

the use a SortedMap

I basically want to retrieve the least active channel
dmlloyd, thats what I am using
dmlloyd, oh

a LinkedHashMap works for doing LRU type things
works well

dmlloyd, but SortedMap sorts by Key.
dmlloyd, LRU?

least-recently-used

LRU…oooo

ernimril, is there a way to "disable" exception messages?

I wonder if that would work

catch the exception and ignore it..

ernimril, can't do that

(but if you ignore it then put a good comment in the code)
most sorted maps can take a comparator to sort by

PrivilegedActionEdception can't be caught from the body
or something
I tried that earier

so you can sort by the value

How do I make ant tell me what my current working directory is? I just want to echo it right now.

"java.security.PrivilegedAction is never thrown in the body of corresponding try statement"
ernimril, so I don't knwo what to do

i have downloaded as2ant_2.2.zip and apache-ant-1.7.0-bin.zip from sourceforge I am trying to build as2ant which has inbuilt swfmill mtasc and things like that. but when i run ant from it bin as ant build in as2ant dir i get swfmill error . i think i need some advice on build.xml . i am on
command line without access to eclipse. and i cant sudo apt-get

ernimril, but the comparator supplies the key. So unless you have a field in the key, which contains a reference to the value - you can't. or am I missing something

you are correct

i have changed build.xml to build flowplayer.swf
can anyone have any pointers

I guess that the main reais is for when the key does not implement Comparable
s/reais/reson/

Anyone know how to get ant to echo a pathelement? I just want it to spit out the string for the directory

is this correct? public class NITFItem extends Item implements WellFormedString

anyone

b0r3d, yea

damn not

Assuming that Item and WellFormedString exist/are imported… yeah.

So I have the SortedMap. Htf do I query it to get the 2nd/3rd from the top?

but WellFormedString has getWellFormedSting(), and in NITFItem I'm not implementating it, eclipse doesn't complain!
implementing*

does Item implement it?

hell yeah

then thats why :P

err not.
hmm. NITFItem extends Item too.

and then your "implements WellformedString" is superflous

Use javac. Nuke eclipse from orbit. That's the only way to be sure.

hehe

meh.. silly people..

This isn't working.

I think I have to put implements WellformedString explicitly for the subclasses

b0r3d, what do you mean?… if its superclass implements it it is not needed..

subclasses always implement whatever the base class implement

but I need a local implementation of the subclasses

then just override the method?

oh no, everything is screwed.
lol

ehm, …

And the SortedMap/Set doens't update itself, nor provide an update method.

why is it screwed?

It relies on the structure it builds when the object is added to the list

if you mutate the key objects in a map you are in big trouble

ernimril, yeah - not if the hashCode stays the same
but the SortedMap doens't even use the hashcode for some reason
at least - in a HashMap i mean

no, it uses compareTo only…

System.out.println(_n2.getWellFormedString()); doesn't return anything anymore
no exception no nothing

ernimril, which one does? the SortedMap?

b0r3d, and what class is _n2? and from wich inheritance does it get its implemenetation of getWellFormedString?

TreeMap (the easiest way to get a SortedMap)

hi .. this is very basic question but i dont understand why is Interger i = new Integer(10) same as Integer i = 10;

loesh, NITFItem extends Item which extends Entity. I have implements WellFormedString for each of them.

it is not the same

i think he's asking why they're not the same

they both contain 10

"Integer i = 10" is sytactic sugar for "Integer i = Integer.valueOf (10)"

b0r3d, ok, but which class actually implements the methoid?

they both contain 10, one uses the shared Integer instance, one is a new created
so they ought to be equals but not ==

loesh, all.

thanks

it's nice just to sit here and read what people like ernimril writes.. and learn a little java :P

b0r3d, ok, then if _n2 is a NITFItem the method getWellFormedString() in NIFTItem should be called when doing _n2.getWellFormedString()
so how does that implementation look?

loesh, public String getWellFormedString() throws ApiCheckedException { return MyMethods.outString(this.getClass(), this); }

Can anyone tell me how to make ant echo a path? I have a path with a pathelement set to . and I'd like to echo it so that I can see the path on the screen….

try echo

I need to convert HTML file to text file

yeah, did that

html is text…

it just prints out ${path.element}
I Want it to print /home/user/path

b0r3d, ok, and then what does MyMethods.outString(…) do?

you can try this, but it only works for well formed pages: String plainText = page.replaceAll (".*?", "");

I tried that, it doesn't print out the actual path, it just prints out the name of the variabble

ernimril, html has all sorts of tags

loesh, http://rafb.net/p/t6nj6o52.html,

or use a html-parser to get all text-nodes

does echo not support variables?

i would be willing to bet that programmers are the backbone of most companies in the world today

can you only echo string literals? that sounds useless.

?

ernimril, plus there are many characters in the HTML like "ü"

[echo] ${some.path}
again

they are harder tro translage

loesh, i uses reflection to get all the values of the class and append the value if set otherwise NOTSET.

hearing this I just love make more :-)

or in this case it returned : [echo] ${path.element}

are you sure the property is set?

no kidding

I use make for all my projects

loesh, it's going into an infinite loop and get killed by JVM or something..

b0r3d, yea i see..

loesh, why?

thtas probably because it calls getWellFormedString

yeah, I declare a path with the id="some.path" and inside i create a pathelement and set it to .

do you get a stackoverflow?

lol
no nothing
the program just terminates

after you check that its not the getClass method, also check that it is not getWellFormedString ….

loesh, I can make it not call getWellFormedString
yeah that's it.. let's see.

because that would give you an infinite recursion

http://pastebin.com/m4fed11d8

thanks man you're the best

it works?

property name="output" refid="path.ref"/echo message="${output}"/

loesh, yes it does

nice

ah! so it has to be a property? echo won't work for pathelements?

so it seems

so do I wrap my pathelement in a property?

http://ant.apache.org/manual/CoreTasks/property.html

i have downloaded as2ant_2.2.zip and apache-ant-1.7.0-bin.zip from sourceforge I am trying to build as2ant which has inbuilt swfmill mtasc and things like that. but when i run ant from it bin as ant build in as2ant dir i get swfmill error . i think i need some advice on build.xml . i am on
command line without access to eclipse. and i cant sudo apt-get

loesh, i thought something went wrong with eclipse for instant.. heh

b0r3d, well if you are uncertain, allways try running stuff from the commandline

the property type doesn't support a nested path element…

eclipse is very nice but well it might mess things up..

what do you mean? it says so right in the docs

http://pastebin.com/m3c14b577

why do you need it to work that way?

haha

what's wrong with declaring the path, and then referencing it by ID

I just want to echo the directory. That's all. I don't care how it happens.
I need to use the directory to make a decision later also.
so it'd be nice if I could branch based on which directory I'm runing from.

path id="duh"pathelement location="."//pathproperty name="dir" refid="duh"/echo message="${dir}"/
though for the record I think that's just going to print "." :-)

Thannks… don't understand why you have to use a refid, but that works great!
no wait… I DO understand why I have to use a refid… learn something new every day….

Is it essential to declare enum as public ? I am trying to access enum Type from my class but enum has default accessor type

What is the best way for me to read a file using ANT?

hello, i want to learn java programing and development.. I do not have a programming background at all though I am very good at web design and web development. I heard that java is the way to go if I want to learn programming and I have already started with the tutorials on the Java website
and I was just wondering my being new to programming is there a better guide or another source i should seek out to learn java or should i stick to the w

$diety I hate this policy of not beeing allowed to delete files from projects after first commit to the release tree

Nope.
You're doing the right thing.
You may want to find a book that covers object-oriented programming in a language-neutral way. To understand the concepts.

crap… Been thinking about this… Since getting a resource from the classloader means you can't use a File object, is there a way to ask the classloader (or Tomcat in general) for the directory path of the deployment root, so I can build a File object?

ok cool, someone had told me i shold get "java for kids" or "java for dummies" books but the website seems to cover things quite well

Nah.

I've got a config file in WEB-INF that I want to periodically check the file modification time to see if I have to reparse it

As a non-programmer, you should be more concerned with OOP basics than Java calistenics.

[TechGuy]: or you do some ugly hack to inspect the url you have…

any ideas on where i can learn that stuff? Books? website?

This is in a background processor thread spawned from an init servlet. It's not called from a URL

Books.
Some websites may cover it well. Google for object-oriented programming concepts or similar things.

[TechGuy]: getResuorce gives you an URL, it was that url I meant that you can inspect, if it is a file:///foo/bar/webapp/… it is quite easy to get a file (, but ugly)

indeed

nivekc1, maybe not the right level, but there's a series of books called "How to think like a computer scientist"
nivekc1, and there's one for Java too

Was just trying to think of different ways to get to a file modification time

oh also I am a Windows free user (I hate windows) is it going to be ok going ahead with this in Linux?

nivekc1, the best part of that book is that it's entirely free, in PDF format

thanks ill try that out

Sure.
daredemo++

daredemo has a karma level of 1, pr3d4t0r

Wrong nick complete
You're mean

Hrm… something must be wrong with my keyboard today.
Have a nice day

http://greenteapress.com/thinkapjava/

I won't any more
You ruined it you meanie! *throws fit*

ie blows….

cool thanks! and just to clarify on my last question there this is ok to go ahead with being that I am a Linux user and will not even consider Windows

sure

java works fine on linux

nivekc1, I think youre safe [Mac user]

public class Err{ public String name; Err(){} public void getName(){return name;} private int hour; } Why will this class not compile.. I am doing practice test and I do not have java installed. Thanks

Install Java

http://www.innovation.ch/java/java_compile.htm

great you guys have been very helpful, I'm sure I'll be back later after I begin reading and i'm stuck in a "huh?!" part lol.. thank you.

thanks thats gr8 erni

nivekc1, it also helps if you have a "problem" to solve
nivekc1, if you just read the books… I find it hard to learn, I have to have something real to solve

what do you mean?

How do you add an external resource to a jar through ant? such as a configuration file?

grumblefuck
Monday mornings.

nivekc1, like "OK, I need to get the files from a server; how do I do that? to save on my computer"

oh i see
I was told to begin a project, and as i learn new tings update my project as i go and then once i am finished i should have a working program
sound right?

nivekc1, exactly

that and get a nice IDE to start
such as eclipse

O_O dont start with using an ide

~newbie ide

newbies shouldn't use IDEs. http://weblogs.java.net/blog/editors/archives/2007/02/you_better_get.html and http://weblogs.java.net/blog/gsporar/archive/2007/02/tools_that_do_t.html

what the bot said …

you can also make small projects, and write class files for those small projects and then make the final project that uses the class files from the smaller test/projects

what they should use Emacs, VI?

totic, well yea, or something simpler…

no..

any editor is fine

with the two Integer objects? or perhaps an Integer and an int?

totic, any text editor

Just the jump to learn Vi or emacs should scare them enough

then go for a simpler one
or well both emacs an vi are extremely easy to use at a basic level
open emacs and start typing your code
and he said he vas a linux user, my bet is that he should be familiar with at least some decent text editor…

loesh, but I find it always going crazy [since I press control key in wrong places and times]

daredemo, hehe yea but eventually you learn to do it right…

~tell gaillard_ about autoboxing

gaillard_, autoboxing is http://java.sun.com/j2se/1.5.0/docs/guide/language/autoboxing.html

[krustofski], thanks

loesh, like opening a new buffer in the same window and you can't see the original anymore and you get a heart attack since you last saved in the morning

haha i see that any text editor will do right? ill just keep to my basic text editor in ubuntu i use it for html coding should be good enough?

daredemo, oh well emacs might not be the best choice if you are not willing to take some time and learn it…

for learning, that should be sufficient

nivekc1, the added value of some text editors is that they close "(" and "{" and so on

oh i see

loesh, I finally learned it this summer

yea and well it is a nice benefit to have one with syntac highlighting, makes it easier…
daredemo, yea i picked it up not that long ago either…

such as python?

now i use it for all my coding..

loesh, had tried it many times before, but got seriously lost, but since the new version has a Mac native version, it was much less scary

well i basically took the time to go trough the tutorial

nivekc1, python?

and i try and look things up as i stumble upon them..

loesh, my first trouble was that I didn't understand the tutorial :P

it is a programming text editor that is made for linux and can be found in the default repositories

hehe..
python is a language?

loesh, it was talking about modifier keys and whatnot, and I "didn't have such key" feeling

yea it is a bit strange until you get used to it..

nivekc1, python is a very good programming language [because I use 3D app called Blender and all scripting has to be done in python in there]

How do you add an external resource to a jar through ant? such as a configuration file?

update the jar

but at build time?

im not talking about the language there is a text editor call python too made for programmers it does what you said closes ( and { and what not after you select the language your using

add that resource to fileset

thanks everyone for your help, i have to go to work.. bye

a stupid question, does java have a way to run .java without compiling .class?

erm… no
you can certainly compile on use, if you need, but… ick

jottinger, well, is there a compiler for mobiles? :p

in an interface what attributes are allowed ?
public / private?

none
everything is public

like this? fileset dir="${classes};${basedir}/default.xml" /

though … maybe protected is supported.
~tell totic about tias

totic, Try it and see. You learn much more by experimentation than by asking without having even tried.

is default.xml a file?

I already did and it didnt work
yes

does not work

well there you go

heh

public String name; did not work either..

it accepts method definitions

only?

I thought that would be an easier way for you to say no, it has to be like "blah"

I sometimes find myself in a bus… and can't take out my laptop… so, I wonder if there would be any way to use java on a mobile [nokia], use in the sense of writing code and testing

String name = "I can never be changed because i'm a 'constant'";

yes?

target name="build" depends="compile" description="package the .class files as a .jar file"
jar destfile="${basedir}/jars/${ant.project.name}.jar" update="true"
fileset dir="${classes};${basedir}/default.xml" /

/target
crap
sorry..

String name;

http://rafb.net/p/3lwMBx97.html
that whave I have now
it works without the xml file
I am using gaim

because an xml file isn't a dir.

right…

and fileset

You're not being the pedantic kick-ass this morning?

[TechGuy]: i'm cranky enough that any such displays would likely be unfairly punishing morons in here for the offenses of those in the office.
8^)=

how would i cache jdbc access transparently if there are no pojo domain objects; can't use ehcache because there are no pojos as such and not using hibernate; any ideas

~coffee cheeser

yum

use hibernate.

i can't; this legacy db schema is horrific to say the least; and we don't have the time to model it; it's quite big

Heh

how are you accessing the tables? (I mean, are you using a DAO?)

uh, you want to cache it without modeling it? somehow, that doesn't make sense.

Hm. I'm tentatively impressed with IDEA

yeah there wasn't a data layer in the previous implementation by someone else; but i am rewriting it so now it has dao interface and jdbc implementations

why?
then memoize based on the primary key. And, BTW, I'm so sorry.

haha

Just the UI so far.

Could you elaborate a bit I don't understand what you proposed.

in the dao… have a map of primary key/object

First impressions of it seem more usable than those I've seen previously. I'm very prepared to change my mind though.

and never ever let anyone access the DB except through that map
and never use more than one process to access the DB
if you violate those restrictions, you might as well… use hibernate, because you'll be rewriting it at that point

haha

thats what ive done
Narada im in your boat

and you'll pardon me, I'm sure, but I think Gavin did a better job than either of you will

well i havnt rewritten hibernate (its way more advanced) but i have a nice OR mapping framework that allows me to write nice litte apps pretty quick

Couldn't he use ibatis and map the old cruft?

they said they couldn't model, or some crap like that… plus, ibatis won't cache

jottinger sometimes its easier to ryo framework than fight with the server guys to get some new thing installed like hibernate

to clarify by primary key to objects you mean an arbitrary key to access that result set and the result set?

two strikes then….

I'm familiar with it

im sure you are

there are no domain objects in this case; just maps and strings

If I have a path like '/path/to/file' how can I tell java to give me back just 'file'?
It's a string..

~javadoc File

cheeser, please see java.io.File: http://java.sun.com/javase/6/docs/api/java/io/File.html
cheeser, please see java.io.File: a href="http://java.sun.com/javase/6/docs/api/java/io/File.html"http://java.sun.com/javase/6/docs/api/java/io/File.html/a

rellis, or you can split the string, and take the last item from the array

not GOOD ones, but…

cheeser/daredemo: thanks

what do you mean by primary key; are you talking in table context?

yes

gwt++

mele-: it's pretty nice, innit

Very nice see the GWT-Ext?
http://gwt-ext.googlecode.com/svn/trunk/site/samples/Showcase/www/com.gwtext.sample.showcase.Showcase/Showcase.html#foo

i've seen most of the extensions

mele == gwtTr0ll

Very clean and nicely done
joed

mele-: spent half a week with the Author of GWT in action

Where at?

MN, Code-fest

Nice

objects; …

get a free copy?

whats the wasiest way to convert JSPs to JSPX?

Signed even.

any interviews with him?

yes

yeah there was never any doubt on that nor will there ever be

anyone?

Mixing GWT with other frameworks isn't hard

Nope.

unclean feet cannot touch the balls.

Wicket++

RootPanel.get(String) makes it easy

~jottinger++

would an ehcache interceptor work on the daos for example

jottinger has a karma level of 136, joed

Taoist?
has been studying Tao Te Ching

mele-: Jew.

with a touch of I Ching

I prefer the Ka-Ching

Not the book of change?
Cao Cao says Study the land and screw the girls.
Master Sun says fight now not later!
Sun Tzu++

joed, i think it was you who helped me an hour or two ago but it might have been joedj, anyways do you know if there is any way to put objects with the array returned by Array.newInstance?

Well, Go rin no sho did not really say that

heh
you've read the book of five rings?

Yeah, a few times.
Several years ago now.

hah!
jottinger:
Yes - Starship Trooper
(on radioparadise
apropos of this mroning's convo

haha, yeah

Avg. Rating: 7.5 (Total Ratings: 173)
lamers voting a 1 on this. what idjits.
http://www.radioparadise.com/content.php?name=songinfo&song_id=30931

*objects in an array with it being returned by Array.newInstance is what i meant sorry

I need to find a new streaming radio station. Live365 got tired

they probably don't realise how it influenced the industry, such that morons like britney were made possible

RadioParadise good for soundtracks?

not for soundtracks, no. [TechGuy], try radioparadise for a day or three. give it a try. it's by far the best music station i've ever listened to.
'eclectic radio'
the guy who runs is (bill goldsmith) is awesome. a total music buff, and not a young wanker who thinks Coldplay is DABOMB.
http://planet-geek.com/archives/000666.html

waitasec, waitasec
coldplay isn't da bomb?

no.

How can I find the last element in a string array?

dafook!
arrayname[arrayname.length-1]
bomb…

Nifty, thanks.

rellis, that works with all arrays [not just String[]]

cool

although it relies on the ability to determine how long an array is!
so be careful!

Yeah, I have to get into some halfway-tolerable recent music. Soundtracks have burned me out

jottinger, unless the string is null, would there be problems? I mean, rellis is splitting a string to get an array
jottinger, unless the string is null, would there be problems? I mean, rellis is splitting a string to get an array

[TechGuy]: the guy who runs this mixes it up. he's got a huge range of music. anyone who'll play some classic REM, then josh shikaburo, then Beethoven… ahhhh
he also _NEVER_ hits shuffle.
-ever-
he organizes his playlists very very very carefully.

perhaps something like this? http://www.theserverside.com/news/thread.tss?thread_id=20180
hmm wait it costs and it's a driver replacement; not ideal

after I include a file in a jar, do I have to extract it to use it? (I just want to pass it into the a java file as its configuration file)

k. I practically skipped the 90s and most recent years. 3/4 or more of the rock music I just passed up, couldn't really listen to it.

heh
you didn't miss much
i really do credit RP for introducing me to stuff i would -neve-r have heard before.
nickel creek being a good example.

nickel creek is a really good band

nickel creek?

yeah
instrumental band, bluegrass IIRC

hey vulture c++ geek
;p
is that him? not sure ;/

vulture!
Yeah, that's him.

true, hehe.

Yeah…
It's also a bird.

anyone know of any good references for history tracking within a database?

you mean, like a DB journal?

How long does it typically take a JSR to get adopted into the core language API after a final approval?

MarkT-: 8 months at BEST
ooo, core language is even longer

look at generics
i think it was the last to go in

yeah, closures will take even longer

closures will be in java 7, won't they?

maybe

language changes are ssslllooowwwww
not necessarily
java justifiably resists language changes… 1.5 was a surprise with that

blah

I was talking about a JSR that's just an API, not a language change.

jottinger not really sure what you mean. essentially i need to track for example an account record and its various "states" so whenever it gets updated i have all previous versions

MarkT-: which one?

the system i have right now is alright, but wonder if there might be a better way that i just cant find

why not use explicit versioning?
hibernate et al support that out of the box

actually an aop interceptor that caches on method signature should work

because i cant use hibernate =\

JPA?

atleast at this time

a lot of jsr's are just API's.

MarkT-: I'm familiar with the JCP, dude.

Or were you asking which jsr _I_ was referring to specifically?

yes.

yes. duh.
8^)=

sorry… (slow)

no worries.

JSR 231

haha
that one will be a LOOOONG time if ever
progress has been rapid on it, though… but as a core API? Probably never.

Why do you think, jott?

OpenGL isn't something the platform can rely on.

http://www.forbes.com/home/technology/2007/08/02/recruiting-silicon-valley-tech-cx_bc_0803talent.html

~jsr 231

aditsu, jsr 231 is http://www.jcp.org/en/jsr/detail?id=231

opengl is fairly ubiquitous… I can't think of a single graphical platform that isn't obsolete and doesn't have it.

groan. Ya know, screw this tracking of file modification time

heh

i'm not sure why there needs to be a JSR for that.

MarkT-: not knowing what you said, you said it.

I'll just reparse the config file at every iteration (30 seconds). It's not that bad

so many of those JSRs are more product requests than actual infrastructure issues

would having opengl bindings actually help java?
i seriously doubt we will see a game in opengl anytime soon, and what other industry would use it?
er not opengl games but java games

anyone have a guess at the most popular java gaming platform?

JEE?

hahaha! No!

JME!!!!

cell phones?

dingdingding

ah.

MarkT-: ever see a cell phone with opengl?

opengl

Puzzle Pirates

ever see a cell phone with directx that you could afford?
me neither!

directx is a windows-only thing.

puzzle pirates

Oh wait, you haven't answered yet
MarkT-: note that there are handhelds that run windows….

my desktop can intercept radio waves.. does that count?

okay…but it's a noteworthy title written in Java

sure it is

opengl is cross-platform. directx isn't.

dosnt matter

Doesn't matter why?

the gaming industry relies on the windows platform

/ignore Aradorn
not all of it.

that's the _current_ state of things, yes.

the big studios do

Like Blizzard?

like id?

Oh, except they have a Mac build of their games.
You lose again.

well, I don't really want to drift from the topic being about java here… so I'll refrain from arguing.

build platform != runtime platform

anyhow.
What's up all?

MarkT-: in any event, opengl isn't likely to become part of the java distribution.
the jre is too bloated as it is, anyway

the jogl bindings are pretty easy to use.

Not opengl itself… just the api.

no need to make it worser.
that has 0 to do with it.

they are adding a whole bunch of stuff in java7. Some of it's pretty cool.

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.


Blog Tags:

Similar posts: