i cant seem to find a save-restore [or similar] system in Graphics2D how does swing recursively render widgets

they get a little defensive about that
pardon me, but duuuuuuuhr

I was thinking of doing something to my java applets to make them better on the web. Can an applet be rewritten to function in javaFX, and what is the benefit? Or is there something else I should consider?

javafx is an applet env

Does it start faster than an applet or is it the same? I saw it compaired to flash somewhere

not sure
I really need to look into javafx, don’t I

The Art, Philosophy, and Science of Object-Oriented Programming” ?

I’ve been putting it off because it always seems like such a half-baked idea

I can’t imagine it would be any faster to start up than an applet. Could conceivably be a little slower but probably not much.
The script seems pleasant.

does it? compared to what, and why?

Which script in the first place?

JavaFXScript (previously known as F3 before the marketing guys got ahold of it).

javafx has its own scripting language

Compared to say, java web hosting + XML. Seems to do a reasonable job of integrating declarative GUI design in with the scripting language and has some cute features for array/collection manipulation, etc.

I’ll have to look into it more
I have to admit that javafx is way out of my normal problem domain

It’s definitely not new, revolutionary and amazingly awesome. Just… pleasant. Integrates a few things nicely, reasonably nice languages and has some cute features.

whats that output stream that counts the num of bytes written?

which cute features?

DRMacIver, but do you think that we can use javafx instead of swing?

It’s been a while since I’ve looked at it – I don’t actually use it. The main one I remember is that it has some neat comprehension/query stuff for dealing with arrays and collections.

hmmm

Well, it works with Swing as far as I know. There shouldn’t be any problem using Swing components in JavaFX.
And type inference. Type inference is nice.

heh

“Exception in thread “main” java.lang.UnsatisfiedLinkError: mouseGesturesBox.UnfocusedKeyPressedWrapJNI.isKeyPressed(I)Z” does this mean Java can’t find the .dll or the wrapped method?

hello

hi

Netbeans 6 is yet a beta version /;
?

Clown-MG: yes, it hasn’t been released yet.

jottinger thanks

version 5.5.1 is the released version.

ok
i got it

DRMacIver, uhm maybe but I give a rapid look at it and seems nice but I don’t find a way to put dynamic content

i´m a java newbie

on such component like tree or list

well I’d use eclipse anyway ;P

Clown-MG: avoid IDEs until you grok the language some

~tell Overlook217 about tool

Overlook217, A tool is only as good as its user. Tool.

jottinger what do you recommend?

avoiding IDEs until you understand java some.

Like I said. I don’t use it myself. Wrong person to ask.

Thanks 4 info

i disagree. I think eclipse api hosting has been a mighty help-along for me

compared to what?

i’m a newbie but my java project – http://redick.googlecode.com – has been a pleasure in conjunction with Eclipse

bit of a blue devils fan, huh

java is very much a language where you need to be able to browse large trees of source and docs to use and Eclipse is well-suited for it. Clown-MG – download Eclipse from http://www.EasyEclipse.org

and what else have you used?

no I dont like duke or college bball that much

just redick, huh

I have 8 years of Perl experience. all done without IDE
jj is nice

so you’ve used… eclipse for java, and what else?

jottinger i have been using Delphi Ide during last 12 years

I like NetBeans

I don’t really consider this a positive thing though.

Clown-MG: irrelevant

Other than the fact that Netbeans consumes 120MB at any random time, its nice

Eclipse is a pure joy to use
and debugging with eclipse is amazing

again… compared to what? command-line?

doing java servlet hosting without ide its easy if you use ant or maven

compared to 8 years of debugging using print statements

AH yes

so you’re comparing a one-eyed man to a kingdom of blind peasants?

Perl is fine without an IDE. In Java you really need one..

When I started using an IDE with GDB.. it was.. heaven

Great. If it works for you that’s awesome. But advising others to pick the same choice should only be backed up by experience

I stopped all that printf at random parts

and it is my experience that I am speaking from

yes. But others have lots more experience… and have tried alternatives.
some of those people agree with you. More don’t.

clearly opinions vary even amongst the experienced. as amongst us newbies… i’m just putting in my 2 cents

it’s a personal preference; there’s nothing wrong with eclipse in any absolute sense.
But when you’ve tried nothing else, making a recommendation seems kinda iffy to me.

Experience in terms of java combines with IDEs? Seems like you never used BlueJ, NetBeans, JBuilder, IntelliJ etc. blaaa.. Some even don’t exist any more (thank god), but that was the point here: Recommending something after evaluating several choices is better than saying “X works for me.
Pick it.”

all you’re saying is “use an IDE, I do”
jbuilder’s gone, jdeveloper isn’t
bluej should be

i tried Netbeans hosting for awhile
i downloaded intellij but saw nothing in it for me.. eclipse host is free with tons of plugins
intellij costs a lot of money

heh, free means so little when you’re a professional

yea, programming does pay well doesn’t it

intellij paid for itself in time after about two hours

wow

eclipse is worth every penny, though
so is netbeans
(do the math. really.)

Hmm.. Not if your boss doesn’t pay for it. I used it a while (and really like it), but I’m not going to spend my own money on my productivity tools

dont you have some code to write? this discussion is going nowhere

is an IDE integreated into Websphere?

my boss didn’t pay for it. Not unless you consider the career advancement I got for being, like, productive.

No, actually I don’t.

no. But there’s an IDE that accompanies Websphere.
of course, I can get intellij for free now
since I work on various open source projects

I’m not yet entirely sold on the “IDEA is the bestest thing ever!!” school of thought.

Good point. I need to find one to a) have a new pet project and b) get my hands on that ide again

But it’s definitely worth the license fee.

and for make guis with SWING hosting you do all by hand?

Aye

Matisse for eclipse is a good choise
s/choise/choice

what makes IDEA something I should look at over Eclipse?

of course, matisse for netbeans is an even better choice, since matisse is a netbeans package in inception
IDEA actually helps you code. Eclipse enables you to code.

but Visual Editor on Eclipse is a PAIN

The interface is noticably nicer to use and the refactoring support is a great deal stronger in a number of areas.

yeah, eclipse steals refactorings from IDEA all the time

refactoring? how does that work. I dont use that in Eclipse.

and IDEA can refactor even broken code
okay, suppose you write a block of code, then realise that it should be broken out into its own method

I particularly like the refactoring support as I’m currently aggressively refactoring.

“extract method” is a common refactoring

I rather like the live templates as well.

yeah, I keep forgetting that $other_ide doesn’t have the same ones
drives me nuts

New Class and then paste the code over there

try refactoring it instead
it may surprise you at how capable it is, even in eclipse

and how about developing web apps? I guess IDEA has support for making that easy too?

yes
good support for the whole java ee/j2ee stack

To be honest, the refactorings I use the most in any IDE are “extract variable” and “rename”

Alt+R
ups, Alt+Shift+R

The only code I’ve wanted to seriously apply extract method to was so mangled as to be intractable.
(And I don’t have to deal with that code anymore. Switching jobs++ )

hello there

jottinger please, wher do i must to start ?
*where

Clown-MG: the java tutorial
really

hehe

Clown-MG, #java-br

Hi! Using a Servlet 2.4 engine, can I access a session bean used in a JSP from a class implementing HttpSessionListener?

joaop obrigado
thanks

the sun java hosting tutorial got me going

(i.e. I have a jsp host page which uses a session bean to store some information, and as soon as sessionDestroyed() is called in the session listener I wrote I’d like to clean up a few things in my session bean containing the session data)
thanks in advance for any hints/pointers/google-keyword-hints

of course you can
I’m a little bit confused as to why you think it can’t

simply by retrieving my session in sessionDestroyed I guess, but how do I get an object containing the specific bean I use then?

are you not storing a reference to it in the session?

well, I think it should be possible, I just don’t know how
ah, that would be wise of course
how would I do that ideally? a hashmap containing a reference to the bean?

erm
why not session.putAttribute(“refToBean”, beanRef);

ah, that sounds much better
thank you very much

i hope today goes by fast
ok i either need to score a 3rd monitor or i need workspaces for windows

get rid of windows ;-)

wish i could
i was actually told they would never allow a mac on the network

hey people! and especially java programmers )
is there anybody having experience with CA?
certificate authorities for SSL?

jchauncey, O_O strange place… how about a linux box?

doubt a linux box would fly either, the it guys here only know how to fix windows machines =
~tell progreSSive about anyone

progreSSive, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will.
bprogreSSive, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will./b
ubprogreSSive, Instead of asking whether anyone works with something you need help with, please save time by asking your actual question. If someone knows and wants/has time to help, perhaps he/she will./b/u

well, the problem is, i have created a certificate (a not trusted one ), and my client, while connecting to my web-service, is throwing an exception “javax.net.ssl.SSLPeerUnverifiedException: could not verify peer certificate:”
do you, people, know how to overcome this?
or how to add the certificate to the trusted-certificates list?
i’ve tried everything, i’ve read all the documentation on the “keytool”, added the cert. to my java cacerts trusted list, but still the same problem )
or maybe you will suggest me any verified and cheap CA to buy a trusted certificate from!?
so, any suggestions??
here you go.. silence

hm, this is weird

foos = someobject.getFoos(); for (Foo foo : foos) {..} compiles, but for (Foo foo : someobject.getFoos()} {} complains that it expects type Foo instead of Object and points at the getFoos() call

and I cannot reproduce this with a simple example

?

yes, otherwise the first example wouldn’t compile, right?-)

is it a typo that instead of a “)” you have a “}” at the closing end of your foreach,

no, and that would mostly likely cause a syntax error
the parens match properly, too

okok, just checking.

show us the actual code and the actual error. put it up on the pastebin.

yes, I’m in the process of minimizin this

getFoos most likely returns a Set rather than a SetFoo
The compiler will implicitly cast to a generic type in a number of cases, but the foreach loop isn’t one of them,.

yes, that’s what I thought – however it’s specified to return SetFoo
specified in the source, I mean

Oh well. I’ll wait to see your code before I comment further.

ha

Does anyone know which virtual keycodes in KeyEvent are the two Windows keys?

couldn’t you write a small application that print out the codes for pressed keys and just check?

I missed the fact that someobject is an instance of BarT, but the someobject variable is only typed Bar
for some reason the genericity of the type causes the error, but I don’t understand, how

Logi, that doesn’t tell me the name of them

I’ll post the test case

Bonjour.

Mixing erased and unerased types is black magic. Don’t do it unless you Know What You’re Doing.

Oh, there’s a VK_WINDOWS in Java 5, that helps

indeed – I guess I should read up on the rules again too

is there some book which teaches me J2EE and websphere ?

hi all. Can somebody recomend me a good introductory book about j2ee. I already know java well. thanks in advance

http://rafb.net/p/FoMN2W33.html if someone wants to see the error for himself

hehe, we make a tag team

ah, right

yes DaBonBon… would you like to go to the bookstore with me

Found them in the Java 5 docs, I was looking at 1.4.2, thanks

it was nothing
literally

if you’re in india, cool !

i’m in Uruguay

:-/

Can anyone tell me why, when Sun adds new API’s to the language, that Sun does not typically rewrite internals of existing functions to utilize the newer ways of doing things?

so, any preferred books on j2ee ? using websphere would be an icing on the cake
MarkT-: err.. few sun employees you’ll find over here, i think

MarkT-: Laziness, backwards compatibility, sheer size of the existing API.
MarkT-: Also I would guess that the people adding shiny new things are not the same as the people maintaining the existing APIs.

http://www.amazon.com/Beginning-Java-EE-Novice-Professional/dp/1590594703/ref=pd_rhf_p_2/103-3820306-5643832 and http://www.amazon.com/Sams-Teach-Yourself-J2EE-Second/dp/0672325586/ref=sr_1_18/103-3820306-5643832?ie=UTF8&s=books&qid=1187790523&sr=1-18

I’ve been perusing the source code for the JDK, and I’ve noticed that even long-since deprecated functions are still being called by other ones in the library.

thanks I will take a look….

MarkT-: of course, backwards compatibility

MarkT-: Feel free to submit a patch.

~openjdk

cheeser, openjdk is http://openjdk.dev.java.net

hello, is there some lib to make managing ssl/network connections easier? (trying to program a daemon that listens on a port and waits for our door opener to ask if access is granted – this happens over a ssl secured connection)

any hits
i really wish i could find some websphere + j2ee book :-/

can i ask a weird question about inheritance?

sure

MarkT-: Anyway, I don’t mean to belittle your concerns. It’s annoying. But there’s not really a good answer other than “because” in most cases.

ok, say you have a class with a method, say it’s called “sharedMethod()”

(Well, unless Sun have Deep And Important Reasons which for some bizarre reason they’ve neglected to tell me)

it’s used by the subclass, and it calls another method called “uniqueMethod()” which the subclass overrides

you work for sun ?

the superclass has its own uniqueMethod() it calls
when sharedMethod() is called from the subclass, will it call the overrided version of uniqueMethod() or the original?

MarkT-: The deprecated stuff isn’t going away (unfortunatley, as some may say). So changing wel-tested working and known good code just becauses it uses a deprecated method doesn’t sound like a good way to psend ones time.

it will call the overriden method

No

when sharedMethod() calls a method it’ll call the superclass’ method, because it’s a method of superclass

with ‘public class FooT extends Foo’, I can demand that ‘T’ is a subclass of Foo

that’s what i think though .. i guess trying yourself is the best solution

(i.e: it will use the method that belongs to “this”)

ahh, thank you

can I also do something to demand that ‘T’ implements some interface?

The “for some bizarre reason they’ve neglected to tell me” part was sarcasm intended to convey that I’m not exactly privy to their inner decision making process.

hehe ok
because if you did, i wanted to ask you for a book on j2ee :P

is there an easy way to do what i’m trying to do, have a common method call different methods based on its class?
i guess i could test for class.name or whatever

interfaces /

interfaces! ahhh

~tell tobins2 about inheritance

tobins2, inheritance is http://java.sun.com/docs/books/tutorial/java/concepts/inheritance.html , http://java.sun.com/docs/books/tutorial/java/javaOO/subclass.html and http://java.sun.com/docs/books/jls/third_edition/html/names.html#104101

have a common interface that declares that method, and all your classes implement it, DRMacIver ?

you can call a superclass method like this: SuperClass.this.method1()

It makes extending a class that might want to override and extend the newer way of doing things more awkward

err, i meant tobins2 and not DRMacIver

???
Either you seem to be confusing inheritance with inner classes or I’ve missed something serious…

thanks, that’s a good idea, i never use interfaces really, this will be a good chance to learn them
bthanks, that’s a good idea, i never use interfaces really, this will be a good chance to learn them/b

tobins2:
any hits ?
found any suitable books ?

On a slightly related note, is “Real Soon Now” slang for “when hell freezes over”?

i’m searching open books now. But i don’t use websphere…
if A extends B then, in the context of A you can say B.this.method()

ok, but if you find any suitable on ee please tell me

is that the same as super.method() ?

yes is the same and you can do super.super.super things

this.this.this.this

No you can’t.
You’re confusing inner classes with inheritance.

I’m taking a look at http://java.sun.com/javaee/5/docs/tutorial/doc/

This only works for enclosing classes.

yeah i tried it too, but it was a bit slow and not captivating

oh then tobins2 nevermind. sorry my bad
yes and they use “Sun Java System Application Server Platform”

See, yet another sign of the need for proper closures

~tell MarkT- about rsn

MarkT-, rsn is real soon now, otherwise known as ‘never’.

MarkT-: They were supposed to fix the NIO API to use covariant return with the advent of Java 1.5. Guess what we’re still waiting on…
bMarkT-: They were supposed to fix the NIO API to use covariant return with the advent of Java 1.5. Guess what we’re still waiting on… /b

in emule I have found IBM_WebSphere_j2EE_app_devel.pdf

can you please download it and pass it on to me ?

is that a free pdf?

if it’s not too large

it’s about 11mb

http://www.google.com/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=FFW&q=IBM+WebSphere+j2EE+app+devel&btnG=Search

I don’t know/care

i do. any warez in here and i’ll ban you.

when you cancel() a TimerTask, does that block until the TimerTask’s run method completes?

take a look at: http://www.gayanb.com/free_j2ee_books.php

Can’t be bothered, as it doesn’t really affect me. I rarely use NIO. I just use it as a commentary on Sun’s slowness.
If I were set up to contribute to open JDK I probably would. But I’m not, and I don’t really feel like doing so.

thanks cheeser

then stfu with the whining. 8^)=

thanks sgx___ , i’ll see if i can find that book on emule myself

I’m “observing” rather than whining.

ed2k://|server|85.17.52.92|5000|/ is the server I used

ok, looking

ah. semantics is the game is it?
8^)=

Yep. Semantics is the study of meaning. And your meaning is wrong.
bYep. Semantics is the study of meaning. And your meaning is wrong. /b

How to hide String in java so that ppl won’t see the content of the string when decompile.

you don’t
so don’t put passwords/private keys in your code

but I want

~tell poguy about sol

poguy, sol is Shit Out of Luck – in other words, no chance.

Uh…

well there are some java .class file obfuscators
try those ?

nope

Try the Java Cryptographic Extensions.

you can’t obfuscate data values in code like that.

You can use symmetrical block encryption for that.
~tell poguy about JCE

http://java.sun.com/products/jce/

So here’s what you do: write a Java class that encrypts/decrypts the code, and a custom class loader for the rest of your application. The custom class loader will load your sensitive classes and decrypt them in-memory.

but you’ll still need to keep that key external to your system.

Yeah, but he can provide some external way of authentication, like a password (lame) or a biometric reader (better) or a combo pack.

that too much

Well, you wanted obfuscation, you have to be professional.

oh, i thought there existed some .. no idea

You also have to set the JVM extended options so that no memory swapping to disk occurs.
Check these out:
~tell poguy about JVM options

poguy, JVM options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html

Otherwise you risk exposing the keys or plain text to the public — not a good thing. So keep the whole thing in RAM.
You’ll need some JNI extensions to disable the OS from mounting external file systems, like USB, Firewire drives, or USB keys.
That will prevent someone from introducing a sniffer for your sensitive data in the system.

or you could just ship them a custom built machine with a custom OS and VM with no external interfaces.

Last, disable all networking for your application through a firewall. You don’t want any data going out.

i mean, to be *truly* secure.
8^)=

for … write a Java class that encrypts/decrypts the code, and a custom class loader for the rest of your application. The custom class loader will load your sensitive classes and decrypt them in-memory…. WHERE do you hide the key?

in your pocket?

In your pocket, in your head, use your thumbs or retinas, etc.
Lots of ways to keep the key secret. Technically, though, you’ll need TWO keys: something you know and something you have.

on a CD that is also encrypted and password protected and locked in a vault

jchauncey++

jchauncey has a karma level of 1, pr3d4t0r

I see you’re getting it. Another security expert is in da haus!
May I send you a private message?

at my college the person in charge of maintaining the socials had all kinds of crazy things he had to do to keep them safe
sure

Well, I’ve seen your work here and I’d say it’s pretty secure.
jchauncey is very modest.

Just your everage paranoid geek

He’s better at security than me.
The class loader will be easy.

it’s the C2 certification that’ll kill you.
8^)=

Also, encrypt the classes AFTER jar compresses them.
That reduces redundancy in the plaintext and makes your code less vulnerable to an attack.
So this is how it’d work:

Sensitive.class

just sue people with the dmca if they reverse engineer your code /sarcasm

I think that would be a good /topic for a thesis.

agreed

what’s the C2 certification ?

and throw in a one time pad for added security
just make sure your build the perfect random number generator

   Heh

wow, great to see what sarcasm a simple question can induce .. regards, poguy
bwow, great to see what sarcasm a simple question can induce .. regards, poguy/b
bye, bbl ..

Well to the rest of us, that looked like joed laughed and was booted….
Well to the rest of us, that looked like joed laughed and was booted….

Heh

well just booted, not excommunicated

He liked it!

Yeah at the “perfect random number generator”
Yeah, I needed to wake up.

Anybody there know whits Free Java Dev. program I need to download on my linux ? sorry for my bad english

It was whatever characters you generated — they messed up my display

Hehe, it was actually just from a normal Colloquy window

cute.

Anybody there know whits Free Java Dev. program I need to download on my linux ? sorry for my bad english

heh

Long live irssi!

[TechGuy]: irssi doesn’t do split windows like WeeChat

The JDK? java.sun.com

~tell Selveste1 about downloads

Selveste1, you can find the latest JDK and JRE downloads at http://java.sun.com/javase/downloads/index.jsp. Look under “Previous Releases” for older versions.

Hrm. I’ll have to ping my one friend on that.

[TechGuy]: Check out WeeChat. Very nifty.

But slightly buggy.

[TechGuy]: irssi/vim = WeeChat/emacs

irssi splits windows very nicely

Not horizontally, only vertically.
You can’t split your windows into quadrants in irssi. Only into bars.
s/bars/bands/

indeed. that’s not enough for you?

instead of vim/emacs wars we are now going to enjoy an era of weechat/irssi wars :P

haha
cgi:irc !!!

I think I’d go bug-eyed trying to track channel quadrants in irssi

No.

pr3d4t0r, lawl!

~pastebin

http://rifers.org/paste

wait, who won the vim/emac war? definatley vim right…

don’t go there

the flames still burn

See pr3d4t0r’s post at http://www.rifers.org/paste/show/5304

http://www.rifers.org/paste/content/paste/5304/image
That’s what my irssi window looks like.

dear lord…

Can someone explain why my jar file doesn’t run?

with event listeners how do you get the flow of your program in one place, seems silly to have them all get back to the main class somehow when they could just do their junk and pass on to the next class in the flow… whats the norm?

shing`: only if you explain what the error is

whaley, there is no error, it doesn’t do anything.
I tried a basic Hello World program, running in console, and nothing is outputted.

Hm

shing`: does your manifest file define a main class?

whaley, on the last page of the Eclipse export window, it said Select the Class of the Application Entry Point if thats what you mean.

shing`: yeah, if you are using eclipse, that would have done it.
shing`: you are running your jar via a command like `java -jar yourjarfile.jar` ?

whaley, I just double click it in windows

Oo

whaley, java -jar works in console, but is there a way I can get it to display a console when I double click it

shing`: run it via the command line, so you can actually see any output… chances are your console window is just dissapearing after the program exits

whaley, java -jar works in console, just typing test.jar doesnt

shing`: that’s expected

console windows don’t apply when running a JAR with javaw (e.g. “double-clicking them”)

oh.

~[TechGuy]++

[techguy] has a karma level of 43, whaley

~[TechGuy]++

[techguy] has a karma level of 44, shing`

ty

thanks for that… we would have gone in circles because i haven’t encountered that before :-(

interfaces only have method signatures?

First “tech guy” thats actually been able to fix anything for me

Yes

so are they just an OOP best practice, not really usable for getting rid of redundant code?

They’re an OOP core tenant for enabling design contracts and allowing for replacable multiple implementations of a contract

you won’t get code reuse by using interfaces… you will get polymorphism, however

ahh, thank you, i believe that’s what i need, polymorphism

Perhaps you are rather interested in writing an abstract class

if i’m understanding correctly i have somewhat polymorphism through class inheritance, but do interfaces add like more capabilities to that?
if i understand it, an abstract class is one that you don’t need to instantiate
like Math
Math.random()
i don’t think it’s what i need but i may be missing some of its value

not more… just the equivalent effect of just being able to refer to an object by its Interface and not its concrete type – analagous to the same relationship between super/subclasses

i’m having an issue with overriding a method that’s called from a superclass method
i think the superclass method is calling the original method, not the overriding one?

is the method static?

hey, has anyone read “Java For Artists” ?

no
would that help?

did you put @Override on your method
no

i have a stack overflow that is happening when i need 6000 level recursion.. can i increase stack size?. or is there really an erro rin my method that makes it run forever?

don’t put static on things unless you know what it means.
~tooldocs

cheeser, tooldocs is http://java.sun.com/j2se/1.5.0/docs/tooldocs

i already fixed it by not using recursion (but there is a corner case that i am ignoring)

@Override? i never heard of it?
i’ll google it thanks

Sorry, you don’t know the secret code

=(
tis ok

man, OOP seems like a simple concept at first until you get into these crazy things

Anyone know when “Consumer JRE” will be released?

concepts, no matter what domain really, seem simple until you actually try to apply them

i’m just glad i’m finally learning some of the things in java i missed in the past 5 years of using it

heh multiplication is a simple concept, but try telling someone how to multiply 2 two digit numbers. It is a lot harder than it seems

things like reflection, interfaces

always better late than never :P

.. interfaces ?

Damn girl….

so how exactly did you survive without interfaces ?

abstract classes

lots of ways
it’s a tool i never had so i got along without it

You don’t need interfaces really.
They’re nice to have, but not indispensable. More robust languages than Java do without them.

certain parts of the language seemed just crazy to me, interfaces was one of them

thats kinda like saying its nice to be able to extend classes, but its not “really required” since copypaste!

in javascript, closures were crazy to me
confusing
java is so much nicer than javascript
except for Swing

oh, why is that ?

Swing?
i don’t like it
but then again i don’t really have a use for it
everything i make in java is on the server side
maybe i should use the GWT

meh, i rather have swing than make my own windowing system.

in JSTL

but there seems to be no cookie for me

requestScope.set…
iirc

I mean I want to check if this set contains a given number
not set something
c:if test=”${mySet.contains(123)}”adaf/c:if

requestScope.set.contains(…)
though i’m not sure EL supports stuff like that.
thankfully i haven’t had to do JSP work in a year or two now.

yeah I want to avoid jsp “scriptlets”

haha, JSP is my favorite

but I don’t see any other way
it’s pretty crippled

and you don’t like swing? you’re messed up.
use a taglib.

haha, maybe it’s gotten better, i haven’t used swing since like 2004

cheeser, which one

uh… you know you can write your own, yes?

plus back then i was a noob
now i code a lot better, but still learning

cheeser, yes I know but I only need “contains” in one place

so?

custom tags are so sweet

so I’m probably do a scriptlet anyway

that’s what i love most about JSP

it’s your funeral

?

cheeser, huh?

if you do, you deserve the hell you’ll create for yourself.

There is nothing to love about jsp

scriptlets are bad bad bad

right

is there a Graphics2D equivalent to cairo’s save/restore functionality?

haha, back in 99 winamp and napster made me so happy

good lord there’s some java work in phoenix

phoenix?
there’s nothing to love about swing

yeah, I’m supposed to be hiring a couple guys, but I took a look and I’m competed with a ton of companies for people right now
s/competed/competing

there’s nothing to love about applets
well, some things

im more skilled in html/css so doing jsp work appeals to me more than swing =\

awe come on, the were fun in 96/97

same here
i love HTML/CSS
and getting more proficient with javascript
i think my problem here is that i was trying to be cheap and save a class
instead of having 1 class inherit from another class
i need to make 1 base class
and 2 subclasses

or maybe even an interface!

haha

haha, i could try
i still don’t really grok it though
you have method signatures, but what’s the good?

the fact you get the type, without inheriting the implementation
since that can be baggage

if i have a base class it’ll be better than an interface though, no?

it may or may not be usefull or useless

because then instead of method signatures i can have actual methods
and those methods call other methods which are just empty in the base class

indeed, but also you force everyone to inherit form your class

tobins2, you can only extend one class but implements alot!

ahh, right… if i needed multiple inheritence
this is a very small program though

With full code coverage…

i won’t need to inherit more than one class
wait, will i run into the same problem here, even with a base class?
i’m getting so confused with this one point, it’s silly

what is your problem ?

method A() is inherited but the subclass, method A() calls method B() which has 2 different implementations in the subclass and superclass

i can’t seem to find a save/restore [or similar] system in Graphics2D.. how does swing recursively render widgets [if it is given a single G2D for each OS level window or associated image buffer, and has to draw several widgets in it] without this?

which version of method B() is called from method A() in the subclass?
*by the subclass*
i just need to do a test
start a new project

well think about it this way

and do public class Monkey extends Animal
yes?

its just new layers on top of eachother
obviously you cant modify the layers before it, since if you did, they would break.

i’m not sure i understand

you can just override

you can’t override the method and expect the new method to be called
someone suggested that
@override?

hi! does anyone know if there is some method to check if a JPA query is valid or not? (I mean the syntax is valid)

the new method wont be called from the superclasses, since they have their own method.

IDEA validates that for me.
and if you’re using Hibernate and named queries, hibernate will validate at start up

yes but from inside the subclass, it won’t call either right?
it’ll call the superclasses version still?

if you arent overriding, it inherits it.

if the superclass calls a method that’s overridden, it’ll call the overridden version.
but only if the object is of the overridden type.

hmm, this is confusing

i.e., an A will only call A’s methods.

yeah i know, but I’ve meant dynamic queries

B will call B’s method?

but if you override something in B, those calls will use B’s versions.

ahh, that’s what i need it to do

in practice, I find little use for named queries :/

but i got scared
unsure of it

Hi i’m new to java ! I’m looking for functions that will scan or dir the files over a certain directory?

in practice, then, perhaps you should take a look at how your structure your system.
8^)=
~tell alexseif about javadoc File

alexseif, please see java.io.File: http://java.sun.com/javase/6/docs/api/java/io/File.html

~tell alexseif about io

alexseif, io is http://java.sun.com/tutorial/essential/io

but now, do i need to use @override or do i just write the new method with the same name and params in the subclass?

cheeser im starting to think you have that stuff scripted

using @Override tells the compiler to verify the original method exists

what do you mean?

Thank you , I’m just finding it hard to browse through the documentation while I’m still a rookie, I already looked through java.io

ahh thanks

i mean we use the hell out of named queries.
only rarely do we not use them.

alexseif, new File(dir).list();

gr8 thnx!

my problems with named queries: no way to adjust the sorting dynamically, no way to filter dynamically

i still think i should go with a base class and 2 subclasses just to make this code cleaner
it’s too confusing

what is ?

having one class inherit from another and they’re both in use

is there a site where I can browse the functions ?

i’d rather have a base class that is not used with the common functions

arnt named queries safer as well?

what functions?

seems clearer to me

yes

java functions in general

Howdy

java has no functions

sorry, methods

http://java.sun.com/javase/6/docs/api/

but to browse you want, yes the classes and interfaces

yes

java has some of the best docs of any programming language

I’m sorry I said I was a rookie

thankfully that passed
or are you still a rookie O_o ?

I don’t understand
he he

~tell alexseif about RBI

alexseif, RBI is http://java.sun.com/docs/books/tutorial/reallybigindex.html

Anyone know when “Consumer JRE” will be released?

Runs Batted IN

hmm, where can i read up on what “mainloop:” does ?
never encountered that before..

how can I chmod a linux file from java?

yes I read that stuff, I guess I’m just used to C++ and php

mainloop: ?
bytecode stuff?

cheeser, im not sure to be honest..
it is present in a run() method i am reading..

Sounds like bytecode
oh wait…

I’m thinking turning over to JAVA for job opportunities any pointers

run() {mainloop: while() {}}
basically

EWWW
labeled breaks, continues, gotos, etc

I’m using netbeans and the java doc from the official site
and I have the java 2 complete reference

alexseif, that’s good, the javadocs are nice

nay, java has no pointers.

netbeans is my personal fav too, but lots of people like eclipse and intelliJ IDEA

dont use an IDE when learning java..

lies. Use ide when learning java.

learn java using console and an editor…

yeah, that’s how i learned

I guess I’m not familiar with packages and classes yet
but the RBI someone passed is helping

just dont use ide when learning how to compile, and how to use buildsystems :P

maybe get a lightweight java editor with syntax coloring

or rather make sure you understand what the IDE does for you if you insist on using it..

Will java ever see optional parameters like lisp has? Would it even be worth while?

ahh, like javascript too

I have eclipse but the netbeans seams more powerfull

Woflborg, well i can argue that codecompletion dont really teach you how to properly use the methods,

emacs!

i found netbeans to be simpler
i like it, and it’ll help you learn, but you may at times find yourself fighting it

yes it sorts out somestuff I’m not familiar with
problem of every IDE and lazy human

if you run into trouble with it, you might consider going to command line to compile

how do you mean, it displays generally the javadoc page for the method.. what else could one need to learn how to use a certain method ?

no offense

Woflborg, depends on your ide i guess but sure if yolu actually read the javadoc then its decent

I agree with loesh but I don’t jave time for that

a good newbie ide to use is jgrasp
if your just starting out

one thing people often run into with netbeans is that when you have files you want to write or read from, it puts it in a directory like Program Files/netbeans
which is stupid IMHO
it should go in the root directory of the project

no my problem is with examples

That /is/ craz
y

i could argue that if people arent reading what the javadoc says, they are going to meet quite a bit of errors in a hurry..

yeah you can change it but i always forget where the option is

since I don’t know the building directories stuff well enough I don’t know how to preview an example in the netbeans

read the doc

in that case you should really compile on the command line

I downloaded a couple of source code from source forge, but I use the notepad to see them

do you know how to use javac to compile .java files to .class files?

yes I tried it a couple of times
but not enough

isnt that more of a question of not knowing how to use netbeans, how would it help him to gain more knowledge on manipulating projects in netbeans… by using commandline ?

well it won’t help him learn netbeans, but it’ll help him get examples running faster

I know you javac from .java to .class
and then java your class

yeah

but that doesn’t set as much directories

how do you mean set as much directories?
like you have inner folders you want to compile?

he probably means it doesnt work like the build system in netbeans..

ahh probably

well in netbeans you have like 6 folders after you compile and run
and is the source code from the stuf I dowloaded
I try new existing project and errors come out
undefined symbol and stuff

netbeans is simple enough, you just have to plop the code in the default package or plop the package in if it’s in a package

indeed, its simple once you understand what packages and such are.

I gues I’ll get the hang of it in a while
ok here is a question

i have a project started in java 1.4 and use xerces/xalan/xml-apis, java5 supposedly uses them, which jars can i get rid of?

when you start to make an application and you want a form you use a class or package

a package is basically like a folder
i’m not sure what you mean by “a form”

form with buttons ( desktop applications)

oh, that would be a class inherited from javax.Swing.JFrame or whatever
you need to use Swing most likely to make GUIs

heya soulreaper_

yes i know that netbeans opens up a package and then I make a seperate class from the wizard with a form
but the main class is in a package

what ftp clients do you guys use?

anyway thanx a lot

winscp

ahh, i never used any of the GUI creation tools

ssh

i don’t really make desktop apps

how can I set permissions (equivalent of chmod) on a linux file from java?

Runtime.exec(), jbellis

no native alternative?

same here, SSH

that *is* native.
but no, there is no pure java approach

k, tx

on linux i use gftp

filezilla

hi Sou|cutter

ooh, i have to try firezilla

on linux (its still a beta, but it works fine=

i try to try as many mozilla and google products as i come across
i heard a rumor a while ago google wanted to buy opera, did that ever happen?

http://filezilla-project.org/nightly.php

who would want opera

opera’s ok
better than IE

ie is magically looking more and more like opera by the year..

most browser are better than ie

new ie is ok though

hell, even ie has tabs nowdays

but i prefer firefox

does IE 7 block google adsense ads?

It don’t have to be good, just to be better then IE

hmm, maybe that’s another reason to switch to YPN?
if it doesn’t also block those
it doesn’t even block them nicely, i just have white squares on my black page
hmm maybe that’s another reason to switch the background to white?
haha, no, i’m silly
love web dev though

Do anybody knows to this program netbeans ? it looks god !

You want my job? I hate it.

sure, i’ll take it
i’m unemployed now

Well, I hate the front end sort of stuff…

almost done with my B.S. in comp sci

I like designing custom components and such

JSF?

About to start mine
No framework :-(

ahh, hardcore
i like it

I tried to push JSF on them, but couldn’t get them to adopt it

but lately i’ve grown respect for frameworks and leveraging the work of others
soon i’ll be cured of my NIH syndrome
Not Invented Here

hehe

I’ve been exposed to the code NIH-syndrom has generated at my current employer, and that has effectivly cured me of any such tendencies

wlfshmn++

wlfshmn has a karma level of 7, cheeser

haha yeah, that’s one thing they can’t teach you in college
but hopefully from my own projects i’ll be almost cured of it by the time i actually enter a work environment

opera was a good option on linux for quite a while, before mozilla really started up
It was that or netscape

I’m so glad we have firefox now :-)

I did it the other way around.. I’m taking up college again after wokring for a bundle of years

I need to hurry up and make my first million before I get too old… I’m already 20!
I should have made it 2 years ago…

ahh, that’s probably better, get a lot more out of classes that way

wanna know the secret to getting that million?
i learned this from warren buffet.

haha, sure

start with $1B and buy an airline.

haha

at my school they stress us out so much with programming that a lot of what you learn is just time management and how to deal with pressure

valuable skills though

but being from the working world you’ll already know that and can focus on the real learning
yeah probably the best things i learned
so it is real learning
but on my own time i learn more about code than i do in class

I would like to say I choose this order due to some smart choices, but frankkly, I was just sick of school, did an attempt to get motivated, spent a yea rin college, realized I couldn’t take it, and went to work instead

you probably got into at a good time, during the tech boom?
i got into computers only in 2002
so school was essential
at first i was only going to go for an associates degree

college is for fundamentals and sciences. specific languages and such are going to be obsolete, or have changed singificantly, before one graduates anyway.. it’s not like I currently use a single sliver of my specific language skills I had when I started working, in todays
projects

but i loved it so much i transfered, essentially lost 2 years of my life, and now i’m almost done with bachelors

I started working in 2000, before the worst of it hit, and the job remained stable although the company got resized and bought up

yeah when i was a freshman in 2003 they taught us java, now they teach them python
also when i took web programming in 2004 there was no javascript, the teacher hated it, the next year came the AJAX craze and he started teaching that
or was that 2005?
i don’t know, but i was like ahead of my time
i used some cool javascript tricks in my project before AJAX was a buzzword

well, there, “web programming” sounds like a typical course that maybe shouldnt’ be taught at uni, or as an elective at most, sinc eit sounds like it’s going to have a short expiration date

actually i think it was internet programming
but it was all about the web
JSP, XML
HTML CSS and XHTML

imagine looking back at your transcript in ten years and thinking “Which of these skills are still usefull to me today?”

no javascript though
that was one of the best classes i took
that, software engineering
which was like databases + web stuff
yeah, databases too, i learned a lot from that
useful stuff
but all the assembly language stuff i doubt i’ll ever use again
in my last semester i’m taking compiler design

if web-related techniques are used as tools to teach more fundamental skills, that is fine though.. it’s just teaching narrow skills I dislike..

i get to learn how to use javacc

anyway, I should be heading home…

ok later man

must you use javacc? oh i guess so for your course… I like SableCC personally

yeah, they tell us what tools to use
i might actually drop the class, it’s scary

~hotspot

g[r]eek, hotspot is Sun’s JVM http://java.sun.com/docs/hotspot/
g[r]eek, hotspot is Sun’s JVM a href=”http://java.sun.com/docs/hotspot/”http://java.sun.com/docs/hotspot//a

i might take principles of programming languages instead
which is like java prolog python and SML or whatnot
supposed to be easier
lots of little projects instead of a few huge ones
also i can start learning that stuff now
prolog
such a pain
write a text calculator in java that parses expressions
without using expr
or whatever
then change it to use postfix notation

there isn’t an expr() in java.

oh, that’s javascript
eval() ?
i forget
i’m confused
anyway
computers are fun
programming is the best thing to me
it’s like a game
the best game ever
it’s like second life but better

computers are not fun, and programming isnt either… wait till you get in the real world

~punctuation

joed, punctuation is hey, everybody loves it when you correct their punctuation, so give a helping hand!

hehe, hopefully it’ll stay fun
you got burnt out on it?

I can think of worse professions than computers/programming.

not burnt out yet, havnt been out of college long enough. So can I, and I have done them. But staying in a cubicle all day sucks and having managment that has no idea what is good design can drive you insane.

good days / bad days just like anything else

that way it’ll always stay fun?
maybe it’s how prostitutes feel about sex

hahaha
i’ll have to get employment some time.. and it’ll probably be programming.. so maybe it won’t be fun for long

lot’s of suckier jobs out there
*lots

i’m seriously thinking of moving to a cheap apartment and getting a part time job that gives me health insurance and just programming as a hobby / second job

yeah i wouldn’t mind that kind of lifestyle
i’ll probably be doing something like that soon [sharing accomodation with a few friends, working in some kind of shop, or maybe computer repair]

that would be awesome
do hardware work during the day
programming at night
ever see the movie Primer?

nope

you should really see it
it’s one of my favorite movies

[remember to reserve some time for partying and juvenile activities!]

haha, smoking pot and programming all night
doing LSD and writing LISP code at Berkeley
all night LISP coding sessions, fueled by LSD

bahaha
that could be interesting
coding stoned gives surprising results

haha i like it
i don’t like smoking around people, i get nervous

guys please take this conversation in private

but when i have work to do all by myself it’s perfect

once i wrote the foundations of a UI toolkit stoned, woke up the next day, thought “wow.. does it actually work?” and it was all fine

haha, nice

g[r]eek: hey it’s a genuine coding technique!

we were only off topic for a couple minutes
we’ll get back on

so.. does anybody know how to do cairo-like save/restore with Graphics2D? or how swing gets around the lack of it?
[3rd time lucky?]

cairo-like?
is cairo a program?

it’s a graphics library
[written in C]

cairo is a software library used to provide a vector graphics based, device-independent API for software developers. Cairo is designed to provide primitives for 2-dimensional drawing across a number of different backends.
ahh ok
i don’t know much about that stuff, sorry
i know how to generate PNGs
using Java
but that’s all

haha
i’m pretty into 2D graphics at the moment

do you know anything about 3D graphics?
specifically UV mapping?
actually, i found the formulas i need i think

none at all really [except a little raytracing]

ahh yes
i was trying to make a web-based program to take a 2D image and turn it into a UV map
for use in Second Life and other 3D environments
but screw it
maybe you can just save the ColorModel or whatever that holds the pixel data?
or are you looking for a quicker solution?
bah, i cannot help you, sorry

a quicker solution.. save/restore is just a way to save information such as clipping and current colour, then restoring it later.. it’s mostly of use for GUI toolkits i guess [where you have objects inside objects inside objects]
damnit, why can’t java be smalltalk
i want 1) closures, 2) spare memory and 3) java

guys – who has experience with webservices?

hi pr3d4t0r
pr3d4t0r, still doing some cobol, no?

actually he’s hunting aliens after that grand opening …

lol

Cobol – C w. Object Business Oriented Lexicon.

gimmeh random program idea

a program to generate random program ideas

Aftermath_ a program to read all directories on your harddisk.
and list it neatly

just tree /F

but its not .html

that’s an idea :o

No.

Aftermath_, create a class name Ideas, then a random method like math

thanks a lot

I haven’t touched COBOL since 1987 or so. And back then I learned only one instruction: CALL.

hoho

lol

pr3d4t0r, he he, was kidding my friend, lol
JavaCobol

oh I am afriad to google that

me 2

It’s “too”, not “2″.
~tell freddysatellite about aolbonics.

freddysatellite, aolbonics is talking like a retard using speech as if you were on AIM or using single letters for you, are, you are, you’re, see, etc. Talking like this is frowned upon in ##java and may result in you being silenced. You have a full keyboard so use it. We don’t care if you talk
like an idiot with your friends but we don’t want to sit through stuff like this: http://forums.oracle.com/forums/thread.jspa?threadID=499980&start=0&tsta

~tell freddysatellite about Java literacy.

http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=469758086_051b1dd752

pr3d4t0r, i support that
came from other channels that encourage that

dude, my boss
he’s a nice guy
but for 2 months this new guy started
and doesn’t hvae an email address yet
and he needs it to do his job

haha!

and my boss has been told at least 6 times that he should set it up. Every time he’s going to do it right away.
he doesn’t understand the concept that 2 people working on is better than 1. if I were a boss, i’d prioritize the tasks that prevent others from doing work of anything else

*yawn*

Kill him and take his job?

that’d work
but the email password would die with him

I have a more laidback approach to chatting… I can socialize no matter the IQ of those I interact with… http://www.teralaser.net/cm/displayimage.php?pid=148&fullsize=1 :P

i’d set it up myself if it didn’t have a password

you allow small creatures to crowd around you and fornicate with each other?

Offer doing it for him?

Yeah, I know … their tails shows they are not doing it really, though…

haha, didn’t notice that
The girl in black does though

~persistent

joaop, I have no idea what persistent is.

~persistence

joaop, I have no idea what persistence is.

heh

i guess i’ll do that
is tss down?

hrm really slow

ah now it’s fast

i have a stack overflow that is happening when i need 6000 level recursion.. can i increase stack size?. i cut down some of my ussage by making sure i had less invakes per use.. but now i reached a new thing i need to process a little larger

~tell dmiles_afk about jvm options

dmiles_afk, jvm options is http://blogs.sun.com/roller/resources/watt/jvm-options-list.html

you can increase the stack, but 6k frames? that sounds a bit ridiculus? can you not rewrite your code?

thanks awesone url
i rewrote a little but to use a local variable for the “next” operatoin.. but there is one that i just cant seem to do that with

hi everyone
after an ajax call, how do you read the POST variables in java
i usually do get requests, so i jsut do request.getParameter
but this doesnt seme to be working for POST data
how do i read post data in java

ok -Xmx1024M -Xss16k -Xoss16k seemed to actually make it come earlier .. strange

post calls should work regardless with getParameter. Make sure your action is set to the right url

k thx

also you could try iterating over all the values sent to see if it is sending a null value or what exactly is happening

i think my params string might be wrong
cus in firebug it just shows the parameter string instead of listing the params in the post tab
the syntax is field1=value1&field2=value2 ect.. rite?

right
are you using input tags to submit data?

no im reading the data manually before sending it
and verifying it
with a submit butotn
the submit butotn does an ajax call instead of a form submit
cus the data requires some maniuplation before sending

ok so you are building a string and then sending that string to some processing page?

yea

using a jsp page to do the processing?

no the processing is done by a java page, im using struts

ah k
ive just always used a hidden iframe and submitted the data to a jsp page which is why i was asking

yea i dunno i think its definitly my params string syntax is off

Hello
Do you know how I can have a list of all nodes with jaxp?

it would look something like this something.jsp?param1=value1&param2=value2

you’re doing an ajax call because the data needs manipulation before sending? Why don’t you do that in your controller?
or in your model, depending
doing it in ajax is *probably* dumb and might be a security risk since I could use a program to send the data directly

~spring

joaop, spring is a Java/JEE Application Framework – http://www.springframework.org/

how do you run a .jar file?

~tell pianoboy3333 about jar

pianoboy3333, jar is Java ARchive. See http://java.sun.com/tutorial/jar and http://java.sun.com/javase/6/docs/technotes/guides/jar/index.html for more information. Also
see fatjar

“java -jar foo.jar”

I just downloaded azureus as a jar file, but I’m not sure as to how to run it
ok thanks

but that only works if the jarfile is runnable…

ok

Is FileInputStream.read super inefficient, even with a large byte[] buffer? I’m seeing 4000ms to read 5MB locally (w/ a 128KB buffer) which seems horribly slow

ok… it’s not runable, now what do I do?

read the docs for the program…

thanks

FileInputStream.read(bigByteArray) is efficient

there a way to use a tray icon in java?

nope

reading 5 MB ought to take about .4 seconds if your hard disk has a speed of 60 MB/s (about normal for standard desktop), if the file is buffered you can get way faster results though…

not that i know of

so you see why i am puzzled

~tell AustLaw about javadoc SystemTray

AustLaw, please see java.awt.SystemTray: http://java.sun.com/javase/6/docs/api/java/awt/SystemTray.html

4s seems a bit long, yes…
since I do not see what you are doing it is hard to say what other silly thing that is taking time…
you may also want to look at the SystemTray info javabot gave…

i stripped everything else away
byte[] buffer = new byte[128 * 1024];
int bytesRead;
while ((bytesRead = fileInput.read(buffer)) != -1) {}

read the topic regarding pastes…
test case in pastebin?
how do you time it? the jvm statup time can be something like 3-4 seconds…

currentTimeMillis, so jvm startup is outside timer

how should one adjust the preferred size on a JPanel that they are drawing on since it won’t have a layout manager?

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

Comments are closed.