<< 27-August-2008 : bevinbot on ##java at freenode [download] [back] >>
 
 
time nick message

00:00

<Fanook>

no, I thought you were doing something like new A<?>(), which is obviously illegal

00:01

<mapreduce>

My real case is that I have a List<Parameter<?, ?>>, where the first ? is the input type to the parameter, and the second is the output type (what value it really stores).

00:01

<mapreduce>

In most cases that suffices but in one case I would like it to be a List<Parameter<?, Option<?>>> because all the parameters happen to be optional ones.

00:03

<mapreduce>

One option is to subtype Parameter, to get OptionalParameter<T, R> extends Parameter<T, Option<R>>, then I can have a List<OptionalParameter<?, ?>>. I am hoping to find a better solution.

00:10

<lilwik>

Hey look, a bug in JScollPane when used with JList: http://pastebin.com/d3f66311e

00:11

<Obeliks>

lilwik, so, what happens? :)

00:12

<mapreduce>

Thanks anyway.

00:12

<lilwik>

Whenever you press the down key, the scroll pane lurches upwards.

00:12

<lilwik>

It jumps as high as it can while keeping the currently selected element in view.

00:12

<lilwik>

For no apparent reason.

00:13

<waz>

waz yawns

00:13

<lilwik>

Darn Swing and it's bugs.

00:14

<cheeser>

closures!

00:14

<Obeliks>

no problem here

00:14

<Fanook>

don't start that again

00:14

<cheeser>

haskell kicks java's ass!

00:14

<waz>

Scala

00:14

<waz>

ftw

00:14

<cheeser>

hathkell kickth java'th ath

00:14

<Obeliks>

lilwik, what java version, what os?

00:14

<cheeser>

thtupid lithp.

00:14

<lilwik>

Obeliks: you're saying this only happens for me?!"

00:14

<Obeliks>

no

00:15

<Obeliks>

I'm saying it doesn't happen here

00:15

<Myoma>

haskell doesn't have closures

00:15

<Obeliks>

that's quite a difference ;)

00:15

<lilwik>

Obeliks: Windows XP, Java 1.6

00:15

<cheeser>

Myoma: it's joke for waz.

00:15

<cheeser>

8^)=

00:15

<cybereal>

lilwik: it sounds like you have the cursor at the top and the scrollview scrolled to the bottom, then you move the cursor by pressing down and then it scrolls to make that visible

00:15

<waz>

joed: we still have your haskell book I think

00:16

<lilwik>

cybereal: I wish that were the case, because that would be correct behaviour.

00:16

<Obeliks>

no problem on linux, Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-b02, mixed mode)

00:16

<lilwik>

So HotSpot has fixed the bug already, while Sun hasn't?

00:16

<cybereal>

lilwik: hotspot is sun's vm

00:17

<Obeliks>

ah yeah

00:17

<lilwik>

Does anyone else have the bug?

00:17

<Obeliks>

happens with 1.6 though

00:17

<Obeliks>

regression ftw ;)

00:17

<lilwik>

Darn it. I just switched to 1.6 to get the new Swing features!

00:17

<cheeser>

lilwik: you realize that HotSpot is a piece of software and Sun is a company so comparing the activities of the two is, well, silly.

00:17

<Obeliks>

I've had some other problems with 1.6

00:17

<lilwik>

I need a work-around.

00:17

<Obeliks>

I think I'm waiting for 1.7 or openjdk ;)

00:18

<waz>

openjdk will be magical

00:18

<lilwik>

Can anyone find this bug in the bug lists? I've been searching, but I can't find the right keywords.

00:18

<cheeser>

it will bring closure to the language debates.

00:19

<waz>

you take a language and make it open source, there's no way anything bad will remain in it!

00:19

<waz>

just look at eclipse!

00:19

<Obeliks>

ah yes, the eclipse programming language

00:19

<Obeliks>

I know it just too well ;)

00:19

<lilwik>

I've tried disabling the horizontal scroll bars, but it doesn't fix it.

00:20

<lilwik>

I think I need to ensure that the horizontal size of the list always exactly matches the size of the view.

00:20

<Obeliks>

waz, did you know there's also a prolog interpreter called eclipse? :)

00:20

<waz>

now there's something useful

00:21

<flippo>

There are too many prologs to keep track of.

00:21

<Myoma>

eclipse is very good

00:21

<Myoma>

for CLP

00:21

<waz>

Myoma: compared to what?

00:21

<waz>

CLP?

00:21

<Myoma>

compared to nothing, it's good on its own

00:21

<Obeliks>

http://www.eclipse-clp.org, yes

00:21

<flippo>

For Completely Lost Productivity

00:21

<Obeliks>

wow, they're still updating that

00:21

<Obeliks>

I didn'T know that

00:22

<Obeliks>

I think a professor of mine was mainly involved in its development

00:22

<conan>

any hibernate experts around? sorry for asking on here, but #hibernate is empty and this is doing my nut in. shows a summarised version of my model http://rafb.net/p/hgx9Ty51.html HQL does not seem to be aware of the JoinColumn so I cannot constrain the relationship of TaskPresentationElements.names and IL8NText - where I want to constraint langauge to en-UK. Any ideas?

00:22

<lilwik>

No one has any ideas about how to work-around this problem?

00:23

<waz>

Myoma: yeah but compared to Idea is sucks

00:24

<lilwik>

What is hibernate?

00:24

<Myoma>

I've never heard of Idea

00:24

<Myoma>

what is that ?

00:24

<schnippi>

lilwik: an object relational mapper

00:24

<waz>

a java IDE

00:24

<Myoma>

I am not talking about an IDE

00:25

<waz>

heh

00:25

<waz>

waz remembers why he left this channel

00:25

<schnippi>

lilwik: java objects <-> relational database rows, generally spoken

00:25

<Myoma>

waz: Was that a joke I just missed ?

00:25

<waz>

apparently

00:25

<Myoma>

ok rewing

00:26

<Myoma>

waz: AH hilarious

00:26

<waz>

you didn't miss it?

00:26

<cybereal>

~~Myoma drools

00:26

<javabot>

Myoma, http://www.jboss.org/drools/ is a business rule management system (BRMS) and an enhanced Rules Engine implementation, ReteOO, based on Charles Forgy's Rete algorithm tailored for the Java language.

00:26

<cybereal>

Myoma: might be interesting to you

00:26

<Myoma>

thanks

00:27

<conan>

oh btw I'm the Drools lead

00:27

<conan>

Myoma: there is a #drools on irc.codehaus.org

00:27

<pr3d4t0r>

javabot: conan++

00:27

<javabot>

conan has a karma level of 1, pr3d4t0r

00:27

<pr3d4t0r>

javabot: conan++

00:27

<javabot>

Rest those fingers, Tex

00:27

<pr3d4t0r>

javabot: r0bby--

00:27

<javabot>

r0bby has a karma level of 17, pr3d4t0r

00:27

<pr3d4t0r>

javabot: Gracias.

00:28

<javabot>

Por nada, pr3d4t0r.

00:28

<pr3d4t0r>

javabot: conan++

00:28

<javabot>

conan has a karma level of 2, pr3d4t0r

00:31

<r0bby>

pr3d4t0r: I've almost stopped gaving a fuck about the karma, and more care about being highlighted everytime you get your panties in a knot

00:32

<r0bby>

r0bby bends over for the kick :>

00:32

<cybereal>

r0bby: unhealthy panty obsession?

00:32

<linxeh>

~~lilwik testcase

00:32

<javabot>

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

00:32

<r0bby>

cybereal: nah

00:32

<cybereal>

cybereal inserts red hot poker into r0bby's brown eye

00:32

<r0bby>

r0bby screams

00:36

<pr3d4t0r>

r0bby: Getting you all riled up is more fun :)

00:36

<strategy>

javabot: robby--

00:36

<javabot>

robby has a karma level of 3, strategy

00:36

<strategy>

whoops

00:36

<strategy>

XD

00:37

<pr3d4t0r>

javabot: r0bby--

00:37

<javabot>

r0bby has a karma level of 16, pr3d4t0r

00:37

<pr3d4t0r>

strategy: ^^^

00:37

<strategy>

i know i know, i was hoping someone wouldnt notice and would be like "OMGWTFBBQ HOWD IT GET TO 3?!?!"

00:37

<strategy>

but what the heck

00:37

<strategy>

javabot, r0bby--

00:37

<javabot>

strategy, I have no idea what , r0bby-- is.

00:37

<strategy>

ok i suck at this

00:37

<strategy>

-_-

00:38

<waz>

javabot: strategy--

00:38

<javabot>

strategy has a karma level of -1, waz

00:38

<pr3d4t0r>

strategy: Tsk, tsk, tsk...

00:38

<strategy>

WOOT!

00:38

<pr3d4t0r>

pr3d4t0r left for real this time.

00:38

<strategy>

I'm better than #1, i'm #-1!

00:38

<strategy>

Thats like.. a platnum medal

00:38

<ojacobson>

strategy: $nothing ?

00:38

<strategy>

ojacobson, What/

00:39

<ojacobson>

strategy: long story.

00:39

<strategy>

Uh-huh...

00:39

<ojacobson>

there's a system where object references begin with # followed by an int, and globals start with $

00:40

<ojacobson>

in that system, #-1 is the reference indicating "no object" ($nothing, for convenience)

00:40

<strategy>

So effectively, i'm null...

00:40

<strategy>

~strategy--

00:40

<javabot>

Changing one's own karma is not permitted.

00:40

<javabot>

strategy, you have a karma level of -2.

00:40

<strategy>

Ok, that was funny.

00:40

<linxeh>

~linxeh

00:40

<javabot>

linxeh, I have no idea what linxeh is.

00:40

<linxeh>

heh

00:41

<linxeh>

~linxeh--

00:41

<javabot>

Changing one's own karma is not permitted.

00:41

<javabot>

linxeh, you have a karma level of 4.

00:41

<bimbo>

hello, I'm about to create a project that will use a database, so I was thinking I could embed an hsqldb to it, it's a desktop application, but I don't know about hsqldb's performance, anyone got experience with it?

00:41

<linxeh>

err, I do ?

00:41

<strategy>

~linxeh++

00:41

<javabot>

linxeh has a karma level of 5, strategy

00:41

<strategy>

Hm....

00:41

<strategy>

I Can't belive my karma is only -2..

00:41

<linxeh>

bimbo: depends on your application. javabot uses hsqldb afaik.

00:42

<strategy>

It should be atleast -5 by now.. XD

00:42

<strategy>

linxeh, it does?

00:42

<pr3d4t0r>

bimbo: Take a look at db4o.

00:42

<pr3d4t0r>

bimbo: It may be a better choice for embedding a database.

00:43

<waz>

really left eh?

00:43

<Myoma>

is it possible to make a hash table based on a String and int ?

00:43

<pr3d4t0r>

Myoma: Sure!

00:43

<bimbo>

pr3d4t0r: hmm better performance?

00:43

<Myoma>

how?

00:43

<pr3d4t0r>

Myoma: Use a hash map, though.

00:43

<r0bby>

linxeh: actually i think cheeser uses either postgres or mysql

00:44

<Myoma>

ok

00:44

<Myoma>

HashMap<String/int> or something

00:44

<bimbo>

I'm using hibernate for the persistence layer so any supported db would suffice

00:44

<pr3d4t0r>

bimbo: Yeah. And it's intended for embedding.

00:44

<strategy>

Myoma, trmplates use <one, two, three> i think

00:44

<strategy>

templates*

00:44

<pr3d4t0r>

bimbo: And you won't have to dick with Hibernate.

00:44

<linxeh>

r0bby: yeah, but the download version is with hsqldb at least - http://javachannel.net/wiki/pmwiki.php/FAQ/Javabot

00:44

<pr3d4t0r>

bimbo: Are the data treated transactionally?

00:45

<pr3d4t0r>

bimbo: If not, Hibernate just adds unnecessary complexity.

00:45

<r0bby>

linxeh: I know, i wrote that

00:45

<pr3d4t0r>

bimbo: And useless overhead.

00:45

<linxeh>

heh :)

00:45

<linxeh>

what extension is that for the history on the wiki ?

00:46

<r0bby>

hrm?

00:46

<r0bby>

linxeh:?

00:46

<linxeh>

its got some kind of clever diff thing going on, compared to normal mediawiki

00:46

<pr3d4t0r>

OKi, gotta run now.

00:46

<ojacobson>

linxeh: learn to read URLs

00:46

<pr3d4t0r>

bimbo: Good luck -- let me know if you want help later.

00:47

<ojacobson>

linxeh: there's an important clue hidden in that one. :)

00:47

<linxeh>

linxeh sighs

00:47

<hunterp>

Guice is like XML-less spring

00:47

<pr3d4t0r>

hunterp: That sounds *nice* :)

00:47

<jamescarr>

hey guys.. I have this crazy boolean statement that I whittled down from an 8 branch if/else if statement that returned the same thing

00:47

<r0bby>

linxeh: prior to me adding that, there was no FAQ regarding that

00:47

<linxeh>

ojacobson: its not a standard action....

00:47

<jamescarr>

can you help me whittle it down more?

00:47

<hunterp>

pr3d4t0r: you've not seen guice?

00:48

<r0bby>

it's not mediawiki

00:48

<linxeh>

oh :)

00:48

<jamescarr>

if(!x || (x ^ y) && !z)

00:48

<pr3d4t0r>

hunterp: I don't do web stuff ;)

00:48

<pr3d4t0r>

hunterp: But I'

00:48

<linxeh>

my bad then

00:48

<hunterp>

pr3d4t0r: spring != springmvc

00:48

<pr3d4t0r>

ve seen the morass of XML in Spring so if it's not there, it's good.

00:48

<pr3d4t0r>

hunterp: Yeah, I know.

00:48

<jamescarr>

hunterp: lol... I've argued the same

00:48

<hunterp>

http://www.javabeat.net/articles/29-introduction-to-google-guice-1.html

00:48

<jamescarr>

hunterp: when I started at a job once...

00:48

<pr3d4t0r>

hunterp: I just do infrastructure. More fun. Machines talking to machines.

00:48

<jamescarr>

someone asked me "do you prefer Struts 1 or Spring?"

00:48

<hunterp>

wicket

00:49

<bimbo>

pr3d4t0r: thank you, I'll take a look at db4o, indeed hibernate will add much overhead to it

00:49

<linxeh>

r0bby: ok, I see, its pmwiki - thanks :)

00:49

<tazle>

~pr3d4t0r++

00:49

<javabot>

pr3d4t0r has a karma level of 470, tazle

00:49

<Fanook>

jamescarr: well, you only get past the first condition if x is true, so you don't need the xor

00:49

<pr3d4t0r>

pr3d4t0r bows.

00:49

<tazle>

not hacing to deal with users is such a plus

00:49

<hunterp>

~hunterp++

00:49

<javabot>

Changing one's own karma is not permitted.

00:49

<javabot>

hunterp, you have a karma level of -1.

00:49

<r0bby>

linxeh can read\

00:49

<r0bby>

YAY!

00:49

<pr3d4t0r>

tazle: Yeah, but I have to deal with IT idiots.

00:49

<jamescarr>

Fanook: sorry.. that one didnt pass the unit tests

00:49

<jamescarr>

Fanook: if(!x || (x || y) && !z)

00:50

<linxeh>

r0bby: :P

00:50

<Fanook>

again. you only get past the first condition if x is true

00:50

<pr3d4t0r>

tazle: They must pray to St. Adolph Eichmann every night or something.

00:50

<strategy>

right.. "short circut" operators

00:50

<linxeh>

sorry, I had the window small enough that pmwiki.php wasnt in view, and the skin and feel felt like mediawikis monobook. sorry for breathing.

00:50

<r0bby>

linxeh: that FAQ still applies, javabot uses JPA -- JPA can use any db; but hsqldb is the default if you choose no other

00:50

<strategy>

so you can do if(x && x.isValid()) and if x is null that wont crash

00:51

<Myoma>

do you mean x != null && x.isValid() ?

00:51

<r0bby>

strategy: yeh

00:51

<linxeh>

r0bby: yes, I know, I run javabot, I use JPA with hsqldb, oracle and postgres on other projects.

00:51

<strategy>

Myoma, i think if x will work fine

00:51

<Fanook>

no. unless x is a boolean

00:51

<Myoma>

I have compile errors with it

00:51

<jamescarr>

I use db4o

00:51

<strategy>

hm ok then

00:51

<tazle>

pr3d4t0r: sometimes I wish our companyt had IT people to work with, so far it's small and has too many geeks

00:51

<jamescarr>

I dont constrain myself with relational databases anymore

00:51

<pr3d4t0r>

tazle: Heh.

00:51

<Fanook>

at which point, you don't have an .isValid() method

00:51

<pr3d4t0r>

tazle: Want a job?

00:51

<pr3d4t0r>

tazle: :)

00:52

<strategy>

Fanook, well, isValid could check if the user has set all of the fields or something

00:52

<tazle>

pr3d4t0r: I'm not sure I can handle two along with the studies :)

00:52

<strategy>

however, if(x != null && x.isValid()) won't throw a NPE, since if x is null, the isValid() won't run

00:52

<strategy>

i think.....

00:52

<pr3d4t0r>

tazle: You might.

00:52

<strategy>

strategy shrugs

00:52

<Fanook>

strategy: correct

00:52

<jamescarr>

bah

00:52

<strategy>

Yay

00:52

<r0bby>

:P

00:52

<pr3d4t0r>

tazle: We have intern positions. And for some stuff I don't mind if you're a remote guy.

00:52

<jamescarr>

any language that introduces a concept of null is rubbish imho

00:53

<Myoma>

jamescarr: that is ridiculous

00:53

<pr3d4t0r>

tazle: And "intern" here means real work, not shit work.

00:53

<jamescarr>

pr3d4t0r: you have remote positions!?

00:53

<pr3d4t0r>

tazle: Ask b3nn3tt.

00:53

<pr3d4t0r>

jamescarr: Entry-level. Real work you may want to be here.

00:53

<jamescarr>

pr3d4t0r: I could use a bit of side cash... if you have jobs that can be done remotely, let me know ;)

00:53

<pr3d4t0r>

jamescarr: OKi.

00:53

<b3nn3tt>

tazle: i will agree intern means work

00:53

<pr3d4t0r>

jamescarr: Send me your resume eugenex AT leapfrog.com and eugenex AT cime.net

00:53

<tazle>

pr3d4t0r: ask me again in two years or so, once I get my M.Sc done and am not bound to the school no longer

00:53

<Myoma>

I really need a way to get java documentation

00:54

<Myoma>

:(

00:54

<strategy>

Myoma, you can download the javadoc locally

00:54

<pr3d4t0r>

tazle: :)

00:54

<r0bby>

~download

00:54

<javabot>

Find current releases for Java at http://java.sun.com/javase/downloads/index.jsp and a comprehensive archive of current and older releases of various Java related products at http://java.sun.com/products/archive/

00:54

<cybereal>

~~Myoma api

00:54

<javabot>

Myoma, api is http://java.sun.com/javase/6/docs/api/

00:54

<Myoma>

I forgot to do it

00:54

<strategy>

so you can access it locally*

00:54

<jamescarr>

pr3d4t0r: will do.. do I need to be availble during the day (besides being able to reply to email and what not)?

00:54

<Myoma>

I'll bookmark it

00:54

<pr3d4t0r>

tazle: I'll have a different company by then. Just hang out in ##java :)

00:54

<cybereal>

cybereal thanks Xcode for automatically download java documentation for him

00:54

<tazle>

pr3d4t0r: I'm not about to stop that anytime soon :)

00:54

<pr3d4t0r>

jamescarr: Let me see what's up with your resume first. I wanna go home!

00:55

<pr3d4t0r>

jamescarr: We can chat here later tonite or tomorrow or any time you see me here.

00:55

<pr3d4t0r>

tazle: Heh.

00:56

<jamescarr>

pr3d4t0r: heh.. dont hold your breath.. I'll send it later

00:56

<pr3d4t0r>

jamescarr: OKi.

00:56

<ojacobson>

cybereal: wow, xcode has a useful java feature?

00:56

<waz>

weird eh?

00:56

<pr3d4t0r>

jamescarr: The web guys here are looking for a few good men.

00:56

<jamescarr>

pr3d4t0r: my resume is badly out of date as I havent been job hunting

00:56

<pr3d4t0r>

jamescarr: And I just interviewed a moron -- they're hurting.

00:56

<cybereal>

ojacobson: I can't say I'm a huge fan of using it as a first class IDE for java but, I do like its docs browser and it's cheap to leave it open :)

00:56

<waz>

VCs demanded I give them one so mine is current :)

00:57

<jamescarr>

so I'll need to update it.. it doesn't even have any of the java web frameworks I use on it ;)

00:57

<pr3d4t0r>

jamescarr: Anyone in ##java would've kicked this guy's arse. All he knew was Struts.

00:57

<jamescarr>

yuck ;)

00:57

<pr3d4t0r>

jamescarr: API monkey.

00:57

<jamescarr>

we're in the process of weeding out our struts 1 code ;)

00:57

<pr3d4t0r>

jamescarr: Couldn't figure out Runnable or Observable. Basic Java 1.04 shit.

00:57

<jamescarr>

hehehehe

00:58

<cybereal>

ojacobson: I did manage to get my existing project up and running in xcode though

00:58

<pr3d4t0r>

jamescarr: No Java 5 shit either.

00:58

<cybereal>

ojacobson: which I found easier to do than in netbeans

00:58

<cybereal>

ojacobson: so fwiw, it's usable, if you were really hell bent on not using another IDE :)

00:58

<ojacobson>

cybereal: you can't do good work with cruddy tools :)

01:00

<cybereal>

meh, as good as any programmer's editor plus a decent project resource management interface

01:00

<cybereal>

but I still use eclipse

01:00

<waz>

which makes you suspect

01:01

<cybereal>

waz: and makes you a fanboy

01:01

<cybereal>

so I guess we're even

01:01

<waz>

good retort!

01:07

<Myoma>

is 9 parameters for a method a lot of parameters?

01:07

<strategy>

Depends on what you think

01:07

<strategy>

Imho that's quite a bit

01:08

<cybereal>

Myoma: if the method needs 9 parameters then it's fine

01:08

<cybereal>

Myoma: but you can consider classifying those parameters

01:08

<cybereal>

for the purpose of preparing them then executing your method against them

01:09

<Myoma>

h mmm

01:09

<Myoma>

I might be able to do that and the whole thing gets a lot neater

01:09

<cybereal>

it would be especially useful if a common use would be repeatedly calling the method with mostly the same parameters

01:10

<strategy>

ye

01:10

<cybereal>

Myoma: but to be certain, there is no special maximum number of parameters. The paramter count is the wrong metric to be concerned with. Consider relationships, usage scenarios, classification, etc. but not specifically the count.

01:10

<Myoma>

I will! thank you

01:12

<vick>

Hello. After adding a button in a BorderLayout at PAGE_END or a button in one of the cells in GridLayout, can't i resize the button to be smaller ?

01:12

<vick>

or before that is

01:14

<Fanook>

first off, GridLayout ignores all component sizes

01:15

<vick>

Fanook: what about BorderLayout ?

01:17

<Fanook>

second, BorderLayout stretches the NORTH and SOUTH areas to be the widthc of the container

01:17

<vick>

well that sucks

01:18

<vick>

the thing is, i don't know why but when i used GridBagLayout it fucked what i'm doing

01:18

<vick>

or maybe i did that :P:

01:18

<vick>

was trying to adding a JScrollPane along with a button, button seems ok, JScrollPane seemed incredibly small, tried fill = BOTH didn't work

01:20

<Fanook>

that's how it works. If you want your button in the top to stay a certain size, put it in a JPanel

01:20

<Fanook>

and yes, GridBag is impossible to work with

01:20

<cheeser>

pansy

01:20

<waz>

Tablelayout

01:23

<nuloop>

any velocity wizard here ? i've a public class which is not available in velocity templates. any othrt think to check after the method and object visibility ??

01:23

<vick>

waz: TableLayout ?

01:23

<vick>

Fanook: What would you advise then ?

01:24

<waz>

~tablelayout

01:24

<javabot>

waz, tablelayout is a layout manager that provides all the power of GridBagLayout, but is simple and easy to use: https://tablelayout.dev.java.net/

01:24

<shubuntu>

hey guys, does anyone by any chance know how to find the screen resolution and bitdepth (not using lwjgl)

01:24

<vick>

it's not part of the jdk tho, right ?

01:24

<waz>

no

01:24

<vick>

sucks

01:25

<waz>

why?

01:25

<waz>

you're only allowed to use jdk code?

01:28

<vick>

waz: not really

01:28

<waz>

then what's the problem?

01:28

<vick>

waz: it could be done using jdk stuff :P

01:29

<waz>

not as easily

01:29

<waz>

tablelayout is clearly better than any of the jdk layout managers

01:30

<flippo>

Darn, I figured out GridBagLayout for nothing?

01:31

<waz>

you can still use it if you're a glutten

01:31

<vick>

lol

01:31

<waz>

or because somehow it's better to use something in the jdk

01:31

<waz>

cause as Calendar proves, them Sun boys know java

01:32

<flippo>

The hard part of gridbag for me was discovering what each of those parameters actually meant, in a real situation.

01:32

<flippo>

Once I understood them, it was easy to wrap them for the situations I needed to support.

01:34

<vick>

flippo, what would you do in my case tho ? :P

01:37

<waz>

use c#

01:38

<flippo>

vick, doesn't sound like a layout problem even. Sounds like a button with a minimum size.

01:38

<vick>

flippo, no the jscrollpane is very small

01:39

<flippo>

It's to hard to guess what your code looks like.

01:39

<flippo>

[too]

01:42

<waz>

they joys of gridbaglayout in the hands of the young!

01:43

<flippo>

If there's one constraint that isn't understood, that's where the problem will hide.

01:48

<vick>

flippo: very simple, gridx = 0; gridy = RELATIVE; and add the jscrollpane then the button :P

01:48

<vick>

flippo: when i do it in a gridlayout, everything looks ok except the button looks extremely huge, and if i do it in gridbaglayout the jscrollpane becomes extremely small

01:50

<waz>

at least you're using the jdk provided manager!

01:51

<pr3d4t0r>

bimbo: Yo'.

01:51

<pr3d4t0r>

bimbo: I'm sort of here.

01:51

<vick>

heh

01:51

<pr3d4t0r>

bimbo: Ping if you need anything else.

02:21

<Ububegin>

~jone

02:21

<javabot>

Ububegin, I have no idea what jone is.

02:22

<Ububegin>

hei guys, what is the name of that java decompiler...

02:22

<Ububegin>

~jad

02:22

<javabot>

Ububegin, jad is either a Java decompiler - http://www.kpdus.com/jad.html or a MIDlet download descriptor - http://en.wikipedia.org/wiki/JAD_%28file_format%29

02:25

<Ububegin>

~java decompiler

02:25

<javabot>

I guess the factoid 'needs to be updated: http://javachannel.net/wiki/pmwiki.php/main/javaonubuntu' might be appropriate:

02:25

<javabot>

Ububegin, needs to be updated: http://javachannel.net/wiki/pmwiki.php/main/javaonubuntu is no longer valid

02:25

<Ububegin>

~decompiler

02:25

<javabot>

List of Java decompilers: http://www.java-decompiler.com

02:28

<qiang>

can someone recommend one or two good opensource projects in java (webapp)... haven't touched java since university and am trying to relearn java. :)

02:28

<Algonquian>

~java ee

02:28

<javabot>

for a tutorial on java ee see http://java.sun.com/javaee/5/docs/tutorial/doc/

02:29

<Algonquian>

the tutorial zip comes with a couple of demonstration projects that follow with the tutorials

02:30

<qiang>

Algonquian: thanks. i will look at that.

02:31

<waz>

enjoy, much fun trying to figure out decompiled code :)

02:34

<qiang>

other than that, can anyone mention one or two well-written small java open source projects?

02:41

<GreySkyze>

apache commons

02:42

<r0bby>

cute

02:42

<r0bby>

http://java-interview-faqs.blogspot.com/.../securing-your-code-techniques-beyond.html

02:44

<Tamutnefret_>

Heh, using an obfuscator along with reflection is a good way to accidentally break all sorts of stuff.

02:45

<pstickne>

If you leave the reflection exposed (clear strings, etc) and a good compactor/obfuscator...

02:46

<Myoma>

is switch/case better than if/else if when you are jsut comparing ints?

02:46

<Myoma>

if(choice == 0) { ... } else if(choice == 1) { ... } ...

02:47

<GreySkyze>

better how?

02:47

<Myoma>

what are the advantages and disadvantages

02:47

<Tamutnefret_>

if/else is more flexible, e.g. mapping a range of choices to a single action is very difficult in switch/case

02:48

<pstickne>

use the one that is easier to read

02:48

<Fanook>

Myoma: a switch is just a consise way of doing a large block of if/else

02:48

<Tamutnefret_>

Of course, the fact that switch/case is limited also helps to make it clearer what it is doing

02:48

<GreySkyze>

there's not a performance boost by using one ofver th eother afaik

02:48

<GreySkyze>

it's mostly just clarity, which makes most sense for the application

02:48

<pstickne>

.... with fall-through behavior for a limited branching case ...

02:50

<Tamutnefret_>

Though I would hope that you would use named constants instead of something like "case 23: "

02:50

<Fanook>

spoilsport

02:50

<Myoma>

TWENTY_THREE ? :p

02:51

<pstickne>

Myoma: I wonder if there's been a wtf... ;)

02:51

<Tamutnefret_>

I once worked with someone who did stuff like that :-/

02:51

<pstickne>

haha

02:51

<pstickne>

why?

02:52

<Tamutnefret_>

He heard from his lecturers that using numbers directly in code was bad, and they should be named constants. I don't think he quite understood why. On a lot of other things as well as that.

02:53

<Tamutnefret_>

(I was doing a project in association with a university)

02:55

<Tamutnefret_>

Also that "do {...} while" was worse than "while { ... }", so there were a few cases where the whole loop body was duplicated before the loop :-/

02:55

<Myoma>

yeah there is too much dogma people get force fed about programming

03:00

<waz>

such as?

03:01

<onats>

hello, when i do this: ClassA classa = (ClassA) classb; does classa get a copy of classb?

03:01

<onats>

or is it referring to the same object?

03:02

<Fanook>

same object, different view of the object

03:02

<Fanook>

~casting

03:02

<javabot>

type casting is a way of changing the type of a reference (it NEVER changes an object), or a sloppy way of converting between different primitive types. (Type) expression type-casts the result of expression to Type.

03:03

<schnippi>

does this result in an unchecked conversion too?

03:03

<onats>

Fanook, so when i modify classa, does it affect classb?

03:05

<Tamutnefret_>

Yes, it's just a second reference to the same object.

03:05

<Fanook>

schnippi: possibly

03:05

<cybereal>

wow the new vmware fusion is way more mac-like

03:06

<cybereal>

cybereal impressed can't wait for official 2.0 release

03:06

<schnippi>

Fanook: when the class of classb is no subclass of ClassA ?

03:07

<Fanook>

schnippi: huh? that's a ClassCastError

03:07

<schnippi>

hehe

03:08

<Fanook>

when you cast, you're telling the compiler "trust me, I know what I'm doing, even if I don't"

03:08

<as_df>

I have FutureCar extends ElectricCar extends Car extends Vehicle extends java.lang.Object. I want to write ElectricCar and read Vehicle from a Set<?>. How do extends and super at the same time?

03:10

<Fanook>

why would you have a Set<?> ? Why not have a Set<Vehicle> ?

03:10

<schnippi>

Fanook: so when will a warning be fired if casting?

03:10

<as_df>

Fanook: because Set<ElectricCar> doesn't extend Set<Vehicle>

03:11

<as_df>

Fanook: Set<ElectricCar>, on the other hand, extends Set <? extends Vehicle>

03:12

<Fanook>

you know that you can put ElectricCar objects into a Set<Vehicle>, right?

03:13

<as_df>

right, but let's say I have a function addElectricCarsAndDriveCarsAround(Set<Vehicle>)

03:13

<r0bby>

Vahicle electricCar = new ElectricCar(...);

03:13

<r0bby>

now add that

03:13

<as_df>

people wouldn't be able to pass their Garage<ElectricCar> to my method!

03:13

<Fanook>

I'd say you have a method that's doing too much

03:13

<r0bby>

BAM

03:14

<r0bby>

as_df: your Garage should take a Vahicle as its generic parameter

03:14

<as_df>

but then people would have to convert their sets of ElectricCar to sets of Vehicle before using my method :(

03:15

<as_df>

I mean, generic wildcarding lets me do Set<? extends Vehicle>

03:15

<Fanook>

which is why your param would be a Set<? extends Vehicle>

03:15

<r0bby>

as_df: no, Vehicle electricCar = new ElectricCar();

03:15

<r0bby>

but yeh

03:15

<as_df>

Fanook: right, but what if my method also wants to add cars to the set, but future cars aren't available yet

03:15

<as_df>

then I want Set<? super ElectricCar>

03:16

<Fanook>

no...

03:16

<r0bby>

as_df: ElectricCar extends Vehicle

03:16

<as_df>

r0bby: yes I'm aware of polymorphism; this is a question about how to get generics to bind both ways

03:16

<Fanook>

as does Car

03:16

<GreySkyze>

as_df isn't setting an upperbound there

03:16

<GreySkyze>

so that doesn't matter

03:17

<Fanook>

you don't need to set a super bounds. Anything that can hold Vehicles can hold Cars or any subclass of Car

03:17

<GreySkyze>

.

03:17

<GreySkyze>

he wasn't...you use that for a lower bound

03:18

<Fanook>

i never get the upper/lower bounds correct, which is why i use extends/super instead

03:18

<GreySkyze>

as_df is correct but it's also a rare case that you would be doing what he's suggesting

03:18

<Myoma>

I refactored my code and it doesn't work now

03:19

<GreySkyze>

<? super ...> is setting alower bounds where <? extends ...> is an upper bounds

03:19

<Fanook>

GreySkyze: and he STILL doesn't need a super bounds.

03:19

<Fanook>

he's passing in a Set<? extends Vehicle>. Car is valid for that bounded wildcard

03:19

<GreySkyze>

right

03:19

<Fanook>

heck, ? extends Car still leaves that valid

03:19

<as_df>

http://eugeneciurana.com/pastebin/pastebin.php?show=32535

03:19

<GreySkyze>

and that's also an upper bounds

03:20

<as_df>

so the question is how you'd make someMethod works, seeing it's both reading from the collection and writing to it

03:21

<r0bby>

r0bby facepalm

03:21

<Fanook>

as_df: you don't, iirc

03:21

<as_df>

I don't? :(

03:22

<GreySkyze>

good quote: "It would be so nice if something made sense for a change."

03:23

<Fanook>

as_df: you're passing in a Collection<SomeUnknownType>. The compiler can never guarantee you're adding the correct type to it

03:23

<GreySkyze>

what

03:23

<as_df>

what

03:23

<GreySkyze>

GreySkyze wants what Fanook is smoking

03:24

<vick>

hello. When i do getSelection it returns the ButtonModel of the button that is selected among the group or null. Shouldn't that give me true if i equate it with the selected button and false otherwise ?

03:24

<as_df>

here i updated the pastebin to be more clear

03:24

<as_df>

http://eugeneciurana.com/pastebin/pastebin.php?show=32536

03:24

<cedrichurst>

hi, i'm trying to access classes obfuscated jar file where certain class names share the same name as packages... for instance, there's a class called foo.a and also a package called foo.a

03:24

<GreySkyze>

you know what sucks, generics aren't in pre 1.5 jvm

03:24

<GreySkyze>

fail

03:25

<Fanook>

as_df: why are you adding a car to a vehicle?

03:25

<cedrichurst>

and so when i try to create new foo.a(), i get foo.a cannot be resolved to a type

03:25

<GreySkyze>

as_df: can't I pass an Integer into methodTwo

03:25

<GreySkyze>

if i want

03:25

<as_df>

a collection of integers? integers aren't a superclass of electriccar

03:25

<as_df>

? needs to be super ElectricCar

03:25

<Fanook>

GreySkyze: you want what i'm smoking? see http://eugeneciurana.com/pastebin/pastebin.php?show=32537

03:25

<GreySkyze>

as_df: ok

03:26

<as_df>

so no, that'd be a compiletime error

03:26

<GreySkyze>

as_df: no i didn't fully understand how the <? super ...> worked

03:26

<GreySkyze>

as_df: so it has to be a parent class of it

03:26

<as_df>

you can give me a collection of car, vehicle, object

03:26

<as_df>

right

03:26

<GreySkyze>

ok

03:26

<r0bby>

technically i'd make Vehicle an interface

03:27

<as_df>

what

03:27

<r0bby>

you heard me

03:27

<GreySkyze>

haha

03:27

<Fanook>

Fanook scrounges about for his copy of Effective Java

03:27

<GreySkyze>

Automobile == interface

03:27

<GreySkyze>

AutomobileFactory == clas

03:27

<cedrichurst>

any suggestions?

03:27

<r0bby>

GreySkyze: no, Vehicle == Interface

03:28

<r0bby>

AutoMobile concrete class which implements said interface

03:28

<GreySkyze>

that's just a different name

03:28

<as_df>

what

03:28

<as_df>

a) how does making Vehicle an interface fixing anything

03:28

<r0bby>

GreySkyze: no

03:28

<as_df>

b) why is Vehicle an interface

03:28

<r0bby>

a Motorcylce technically is a Vehicle

03:28

<as_df>

I'd argue public abstract class Vehicle implements Drivable

03:29

<GreySkyze>

is a motorcycle not an automobile

03:29

<r0bby>

as_df: because it just makes sense to me plus you're supposed to program to interfaces anyways

03:29

<GreySkyze>

fyi i'm horrible at naming stuff, i fail at english

03:29

<r0bby>

so it teaches you good OO design

03:29

<r0bby>

GreySkyze: do i need to beat you up?

03:29

<GreySkyze>

r0bby: yes plz, k OED says an automobile typically has 4 wheels

03:30

<as_df>

the rule of interfaces is you shuold be able tto put '-able' at the end

03:30

<as_df>

Vehicle-able doesn't make any sense

03:30

<as_df>

what makes something Vehicleable

03:30

<r0bby>

as_df: wtf?

03:30

<GreySkyze>

what rule is that?

03:30

<r0bby>

are you on a crack

03:30

<as_df>

it's the 'general rule of thumb'

03:30