Hi Im not trying to start religious war but looking for example at this article about comapration between Java

_^_: OKi.

Can enum types be used in a switch/case?
grr…

Yup.

_^_: so what instead of swing?

JCurses!

I dunno. I like awt, but tons of people seem to think it doesn't have enough features

Hahahaha

Telepathy!
_^_: AWT's features are fine.

I like my gui's in Cocoa

_^_: The real problem with AWT is its lack of portability.

What do you mean ?

_^_: If you write, test, and debug something under Linux, chances are very good that your masterpiece will look like shit under Windows Vista AWT.

Everything looks bad under windows vista

_^_: Actually, I find the UI quite pleasant.

The vista interface is so shiny it makes your programs look dull

_^_: Very OS X like, circa 2004.

that's when they copied it from OSX

Vista is cooler looking than my programs :'(

actually, I still haven't seen Vista

http://www.youtube.com/results?search_query=Windows+Vista

Osx 2004 is rather descriptive, I'll take you to best buy.

heh

~tell _^_ about questions.

_^_, I guess the factoid 'smart questions' might be appropriate:
_^_, smart questions is what you need to ask to understand a smart answer. See http://www.catb.org/~esr/faqs/smart-questions.html

Hrm…
~tell _^_ about questions

_^_, I guess the factoid 'smart questions' might be appropriate:
_^_, smart questions is what you need to ask to understand a smart answer. See http://www.catb.org/~esr/faqs/smart-questions.html

Meh.
_^_: OKi, here you go:
http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=mono_triste

I haven't asked you any quesions

why the hell isn't it working

2] _^_ | pr3d4t0r: What VM option makes swing not use an assload of memory

wrong employer.

I can't recall the factoid.

That was too long ago to be ridiculed by your pictures

~switch enum

I guess the factoid 'switches' might be appropriate:

You don't make your quips in a timely manner.

svm_invictvs, switch is http://java.sun.com/tutorial/java/nutsandbolts/switch.html

_^_ we had no GC so far, still valid.

screw it, else if.

Not still valid, you've lost all references to it
think like PhantomReference here
It's there, but you can't get at it

enum Foo { A,B,C } Foo f = Foo.A; switch(f){ case A: break; case B: break;}
?
WTF

purty.

TheDebugger!
How you doin', girl?

I ain't a girl.. Just kidding..
Taking the nick of my loved one..

you're not just a girl?
you're a boy, too, maybe?

pr3d4t0r is neither of them

how do your write ctrl+z as escape char?

well, yeah, he's unique, thank god

lol
Let's hope he can't reproduce.. :P

d00d.
Major plug on eWeek.

oh?

I gotz da covah.
Look at the /topic elsewhere.

I am going to find the person who is responsible for c#'s datagrid bool column and fillet him

I thought it was going to be an article - not *the* article. 10-pager on open-source, Java, Wicket, Mule, etc.

Hi. I'm not trying to start religious war, but looking for example at this article about comapration between Java and C#, as a beginner in Java, I would like to ask what really is better language and which one will prevail, will GPL-isation of Java help?
http://www.25hoursaday.com/CsharpVsJava.html#conclusion2k7

very nice!

Java already prevails.
It doesn't go on-line for a few days. Thanks
I started getting calls around 90 minutes ago, when people looked at today's mail.

C#

C# is designed like shit

yes but there are numerous sayings about its VM much faster than JVM

no
they are both equally slow

I don't use C# so I don't know

If you want some data instead of the wankage that you're likely to get from either camp, I can provide you some hard data.
C# is no among the top 5 languages used in production today.
Java is no. 1.

C# Is like hosting with java support with pointers and random crashes

c# has better generics, some think it has a better dev environment. Java is cross-platform, vastly better documentation/tutorials, i think it has the better dev environments

There are 5 times or some more Java programmers than C#.

java's also like 7 years older than c#

Java is no. 1 for the top used production language? What is this world coming to
Oh please

http://www.tiobe.com/tpci.htm - here's some real stats.
_^_: Dude, you're starting to irritate me.

ok, but what about performance, is it really (that much) faster than Java
?

no

No.

~pastebin

http://papernapkin.org/pastebin

no. they're both JIT runtimes

C#/C++

When it comes to raw machine execution, Java is about 3 to 10 times slower than C++.
Most applications, however, are I/O bound either against the screen, the file system, the web, etc.

no I don't mean about blocking but pure execution

And spend relatively little time screwing with pure processing speed.

I've read in that article something about JIT diff between C# and Java

Pure execution… think around 2.5 to 3 times slower than C++.

java's is more mature, yes
but not much
but don't forget the algorithm factors heavily

But I bet that C# is a lot slower than Java.
For the same algorithm (that's what we tested against).

I meant about this:
While the java platform supports interpretation of byte code or byte code being JITed then run natively, the .NET platform only supports native execution of C# code because the IL code is always natively compiled before running.

yet the coding of that algorithm also factors in

the word that bothers me is "always"

That's FUDdy.
Some shitty JVMs, like IBM's, really have that problem.

Sun's?

hm… jottinger and pr3d4t0r have the big boot on…

HotSpot (Sun's) is pretty good about preemptively compiling stuff before passing it to the iron.
And you can get some fine-grain control about the JIT from some command line options, I believe.
~tell zendo about JVM options.

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

and hotspot also does a good job of figuring out when it can do better

Ah.
Look at the chart.

Ok, so to conclude, Java is definitely faster than C#?

There are 7x more developers and projects using Java than C#.
I can tell you also that nobody, not even Dell, uses Microsoft C# for their main line of business mission-critical stuff.

… in general

technically? maybe, depending on machine, phase of the moon, etc. in practice, not noticeably
i know one…

All the way through, or only the front-end?
Dell's front-end is all Microsoft for various reasons. The middle tier and above — not so much.

Sorry for doubt, but how much is this table http://www.tiobe.com/tpci.htm relevant?

Very relevant.

i know the system is still backed by a mainframe, but the management of quote offerings is either already c# or moving there (and for insurance, i'd consider that mission-critical)

If you can afford it, compare against Gartner or Forrester.

I've never seen it before, and I know that there are other tables about jobs, that's fhy I'm asking

currently, we're partly c#, partly c++, maybe still some smalltalk somewhere

Ok, then I'me satisfied with answers, even though I asked only Java side
Thanks, especially pr3d4t0r

There is a ##CSharp channel too

java and c# are close enough that if you learn java, you can pick c# up very easily, just need to watch for gotchas

Any time.

except at supper
never at supper
but any OTHER time
and at breakfast, not then either

He, he, he…

or at dinner

:*

any time! except breakfast, lunch, dinner.

supper isn't dinner ?

or when we're busy.
_^_: depends on where you are.

I'll keep that in mind

hm…
in SWT does Widget.checkWidget() check if the current thread is the EDT or not?

hello, I'm trying to run the prefuse example application, but javac throws java.lang.NoClassDefFoundError

Dude?

yes?

Bevin or Qooxdoo for Wed?

actually, I'm not even sure if I need to run javac, do I?

Qooxdoo

The last few videos did OKi, not stellar.
OKi.
The last huge one was Heinz.

sokay. It's like a baseball game: knocking them out of the park is good, but you win the game on singles.
You people from SF should know that.

mediocrity is the new failure

Heh.

you have a classpath problem
~tell tovmeod about classpath

tovmeod, The class path tells Java or the compiler in which jar files and folders to look for classes. Use the -cp/-classpath run-time options to specify the class path. Also see http://java.sun.com/javase/6/docs/technotes/tools/solaris/classpath.html and http://mindprod.com/jgloss/classpath.html#ANACHRONISM

public class Flasher implements Runnable { //no, not what you think it is….
lol

~svm_invictvs++

svm_invictvs has a karma level of 11, Fanook

svm_invictvs++

svm_invictvs has a karma level of 12, pr3d4t0r

Stop wanking and come work for me.

greatest class declaration ever

If Gavin and I didn't suck so much at volleyball I'd still have a video camera

Do you use visual editor tool, or write your own java ui code?

ok, now I'm runningjava -classpath prefuse.jar Example
and it still throws the same exception

I write myown.

looks like it can't find the Example class

heh

using swing?

is Example in a package? if so, you need to specify it

##swingers-in-arkansa

no is a file
it is in the same folder

Because i am considering use eclipse's RCP.

Example.java wich java compiler creates a Example.class

i think java web hosting -jar example.java

right, did you declare a package for the file? (did you put package asdf.qwer) at the top?
that's only if you're trying to run an executable jar

does not he?

and it's not Example.java, it's package.for.Example

yes

no no package declared

oh, sorry

what class does it say it can't find?

this is the error:
Exception in thread "main" java.lang.NoClassDefFoundError: Example

I instantiate a java.sql.Date with java.sql.Date.valueOf(String s) function, if I print out using ToString all goes well, but when I use getDay,getMonth,getYear methods I got wrong values, for instance if I set the date to 2000-01-01 with the methods getXXX I get 100-00-06

actually I'm not sure what to do, I don't have much experience with java

java -cp prefuse.jar;. Example (if you're on *nix, use : instead of

should I create a package?
I have a bat file (I'm on winxp)

why are you using deprecated methods?

which is:
Cj2sdk1.4.2_14\bin\javac.exe -classpath prefuse.jar Example.java
java -classpath prefuse.jar Example

right, add ";." after prefuse.jar, like i did above. there's a chance it's not looking in the working directory for your class
uright, add ";." after prefuse.jar, like i did above. there's a chance it's not looking in the working directory for your class/u

I thought windows included . for search path

Fanook, what methods should I use to simply set/get a java.sql.Date?

btw, should I deploy it as a jar file?

~tell magowiz about javadoc Date.getMonth(*)

magowiz, please see java.util.Date.getMonth(): http://java.sun.com/javase/6/docs/api/java/util/Date.html#getMonth()

go read, like you should have done in the first place
deploy where?

no, I mean to the end user
the application
how it is usually done?

generally, yes. .jar and java webstart are the preferred methods of deployment in java

ok, so how I generate a .jar

~jar

Fanook, 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

use the hosting with jar command available program

as to your question about classpath host auto-including ".", i think that doesn't happen when you explicitly declare the classpath

is there a way to create a executable file with all dependencies

~fatjar

Fanook, fatjar is a jar file compiled from several other jars, see http://fjep.sourceforge.net/

I mean so the user doesn't ahve to download jvm

um, i think webstart can do that

a fat jar ??
what the fuck

_^_: baby got back, you know ?

_^_: a .jar that incorporates the dependencies into the jar instead of having them alongside, and that was unwarranted

Sorry
Yes, most certainly

thanks for what?

just for being here.

well, i do what I can.

This is just me, but don't you think a project big enough to require that has so many dependancies that doing so just wastes disk space ?

O_o

Oh, and MY comment was unwarrented ?

if anything, it saves space, as the .jar can share bit patterns across libraries
your profanity was unwarranted

I can see saving bit patterns, but what about the linking in all dependancies parts ?

~obscenity

cheeser, obscenity is the crutch of inarticulate motherfuckers.

~javabot++

javabot has a karma level of 110, _^_

what about it? they'll all be on the classpath, so it doesn't matter

Oh there it goes…

Wait, by 'dependancies' do you mean parts of the VM the user needs, or 3rd party libraries ?
program *

libraries

I guess I'll shut up then.

any java app is dependent on the VM, so it's pretty much assumed your consumer has it or will get it

hm…
I also just relized I did SystemException sex = new SystemException(); … throw sex;
lol

"fdag"
hmm

catch (SystemException sex) {} finally { unmount(); }

heh

A perverted programmers fantasy, that.

no…
catch (SystemException sex) { cum(); } finall {unmount();}
lol
I'll stop.
hm…
Am I still silenced?

no
but it would be nice if you were

oh
pft

in SpringMVC, i have an object I want to pass via a link, not a simple scalar, how can I do that?

you can't pass an object via a link
you could… but it's rather stupid

it's not when i have all the information i need in an object that i'm only reading the title out of
i want to open the SAME object, in a different view, with more details
there is no simple scalar identifire to pass on the URL
identifier

pass it in the session then
or use another means

maybe that's what i'm missing, i built this thing from scratch, havn't configured any session stuff
but even then, i'd need to stuff an object into a session via a link somehow…

not via a link
rethink your design
you're doing it wrong if you think you need to do it with a link
~tell lunk about wrong

lunk, http://www.adrinael.net/wrong10.jpg

ok, so what's right?
and it's not that I think it, it's I want to.
if i'm so wrong, what's right?
figured.

pass the data via another means
again
session
or an id-in-the-link from which you can retrieve the object
you figure out the rest

like i said, id in the link is out, good job.

~lunk++

lunk has a karma level of 30, joed

then what are you expecting?
if you can't use an id in the link, you've got the session as the remaining alternative
and how the hell does lunk get a ++?

~comfort pfn with man love
lol

poker time

lol
so much anger

tehe
pfn beats his wife and dog
pfn is basically a country song

hahahaha
~mohadib++

mohadib has a karma level of 90, lunk

you gd hacker
talk less and code more chatty mc chatterson

i am a tourist now days

http://www.hanhuy.com/poker/pt
a blow-by-blow of my poker hands…

i only like blow-by-blow with chicks dude, sorry

Hej.
Say something.
If you're still silenced I'll lift the /ban.

he's not as far as i can see

Nope.

anyone know of a good online book to get me started with java, although im not new to programming (python mostly)

~book

1) Sun Java Tutorial at http://java.sun.com/docs/books/tutorial 2) Bruce Eckel's "Thinking in Java" at http://www.mindview.net/Books/TIJ

awesome, thanks

Has anyone here used a good java data structures text that incorperates generics (java 5.0 and above)?

. . .
What are "java data structures text" ?

I am going to kill something…

Yourself

Fanook:

~bomb _^_

~kancho _^_

Is that your final answer ?

I guess the factoid 'clackwell standard answer' might be appropriate:

i.e. Data Structures Text Book

Consider posting a test case to the pastebin - http://eugeneciurana.com/pastebin

datastructures are irrelevant of language

larl\

Learning data structures is orthogonal to learning Java or generics.

But their implementation is not.

There are no "structures" in Java, just objects

Learn parameterized types (generics).

don't learn implementations. learn the theory behind why and how the data structure works. then you can use them in any language

I think that might be the case going from c++ to java, but not java to c++.

That's the case in every language.

no, it's true regardless of language

The language doesn't matter

If you grok data structures, nothing stops you from implementing an AVL tree in COBOL, for example.

*shudder*

^

In other words, I might know how to implement a linked list in java, but that does not mean I know how to do it in c++. Hence why it is important for me to get a book which impelments the data structures I know in java.

Then you didn't learn data structures.

linked lists are easy in any decent language

You probably just copied an implementation.

What do you mean by learned?
Perhaps our definition is not the same?

Like I said earlier: if you understand the concepts behind a data structure and how it works, you can implement it in any language.

Oh god, here we go with the philosophical discussions again

_^_: It's not a philosophical discussion at all.

_^_: those are the fun discussions

~tell _^_ about STFU.

_^_, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded
_^_, a href="http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded"http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded/a
_^_, a href="a href="http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded"http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded/a"http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded"http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=ded/a/a

The definition of learning isn't a philosophical discussion?

Well pr3d4t0r, I can implement a linked list in java but I would like to see its implementation in java using generics.

Cool. Give me a sec.

a generic linked list? What the hell ?

not just a liked list…

I have one for the book on Java 5 I was writing, but it's a stack. Will that do? That'd save me from typing.

sure…

sounds like homework

pfn?? homework

new book on java5? anything like the new edition of Effective Java that (last i heard) was scheduled to come out next year?

lol

oh, right…was writing…that one

homework? What the hell ?

I took and passed Data Structures a long time ago

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

musashi0011, right…

It was a book I wrote in 2004.
Manning and I parted company before we nailed it 100%.

yeah, you mentioned it before

I'm working on another book at the moment.

besides if it were hw don't you think my request would be a little more specific? ( aside from the fact that 70% of schools in the US haven't even started their fall semester.
thx Pr3d4t0r

Sure.

Where can I get me a piece of that ?

_^_: Of what?

really? Everthing down here started today

That parade

a linked list in "generics"

_^_: Move across the street to the University of San Francisco's main entrance, like I did.

Private or Public

gotcha

musashi0011, especially considering there is java.util.LinkedList
and it's "generic"

To his credit, he was asking for a book, not the code.

my uni, all public schools, and at least the private at which my mother teaches

That's why I gave him the sample.

ok

that…and a linked list wouldn't be data structures class, it'd be Comp Sci 2, before data structures…at least here
that…and a linked list wouldn't be data structures class, it'd be Comp Sci 2, before data structures…at least here

I don't think I've seen a decent Java data structures book to begin with.

In NY only Public started today private jvm j2ee hosting after the holliday

as for fall quarter

~tell _^_ about java data structures

I imagine a bunch of schools on the semester system start this week

_^_, I guess the factoid 'java string comparison' might be appropriate:

The only one I saw that sort of works with that is the Schaum series in Java, and that one is pretty retarded: all it does is tell people how to use the collections classes, not how to implement them.

_^_, http://www.leepoint.net/notes-java/data/strings/12stringcomparison.html

fuck…anyone ever played with AT commands sending SMS? The GSM encoding table doesn't work at all for me, just cuts off the chars…

needs more acronyms

USF is private. They started last week.

some schools incorperate Comp Sci 2 and Data Structures

Zn4p, that's not java…

So I had the hottie parade for a week now

ahh…that's interesting, at least at my university we do linked lists in CSCI 2 as a warmup, then move on to data structures

Where is that picture of pr3d4t0r ?

I know, but I'm using Java for the app I'm just desperate for a solution, don't know where to ask really

Zn4p, try howardforums.com

few hotties in CS unfortunately

Oh, right here. This guy http://eugeneciurana.com/galereya/view_photo.php?set_albumName=MediaKitPhotos&id=2_Eugene_eWeek, who calls himself 'pr3d4t0r', has watching the 'hotty
parade' outside his window for a week

bah, go to the local sorority parties… screw having girls in the major, just girls at school is good ’nuff

i had 2 classes on data structures and algorithms. First class covered lists, stacks, simple sorting, big-Oh. Second covered trees, graphs, more complicated sorting, more big-Oh, proof by induction

I lived through an anomaly in 1985 - 1990, when I was getting my CE degree.

if you can find it, i highly recommend Shaffer's "A Practical Introduction to Data Structures and Algorithm Analysis". It's served me quite well.

We had several hotties in engineering.
I don't think that will ever happen again

I wished they did that at my school

was your program initially part of Math? or Engineering?

Math

Heh.
The math chicks were pretty ugly.

yea…if you take that approach, our CSCI class is really a simple data structures….sorts, linked lists and other basics…then the 2 covers trees, big-O, hashes, etc.

One had a nice arse. One of the tree in the school of math.

that's sad. usually the math-based programs emphasize the theory a bit more

So, the focus was primarily on theory (whether or not this was good is still under review).

we have a few in CSCI here….or as most of the CSCI guys like to say "they have a great form factor"

haha

wow, how nerdy

nerd humour
I love nerd humour so much
that it makes me hatemyself

as long as you ain't got bitch tits and think you're japanese, you're fine.

I hated algorithms at my school, more because of the approach unfortunately

Define 'bitch tits'

moobs

if i have to do that, you're a casualty of war.

Have I told you lately that I love your metaphores ?

maybe tomorrow i'll keep myself busy writing a double-hashed hashtable structure, cause i really don't want to fsck around with c#'s datagrid stupidity any more

Your book has two stars on amazon.com

it's still a very good book.

Where can I read about this stupidity ? I love seeing the moronic designs that come out of microsoft

_^_: google "datagrid combobox"

does javabot have a ~google command ?

Mine has 5 stars. Order it today!

is it on amazon?

_^_: not anymore

Of course.

~tesla

Nikola Tesla was the man behind many inventions, from radio to the power generators at Niagara Falls. pr3d4t0r wrote a book about a "weapon that would end war," invented by Tesla, in a modern, what-if setting. http://www.teslatestament.com

I don't just look at the current rating, but I also look at how many have rated it.

Thanks

title?

About 20 people. I don't know.
Fanook just gave you the URL to the book's site.
There's a link from there to Amazon.

can u repost, can't find it

~tell musashi0011 about Tesla

musashi0011, Nikola Tesla was the man behind many inventions, from radio to the power generators at Niagara Falls. pr3d4t0r wrote a book about a "weapon that would end war," invented by Tesla, in a modern, what-if setting. http://www.teslatestament.com

And it's "you", not "u".
~tell musashi0011 about java servlet hosting literacy.

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

what you say arse and I get busted for "u"?

yeah
life isn't fair is it?

arse is a valid english word
granted, that's in britain, but still

do get all pedantic on us!

pedantry is the spice of life in here

for the pedants among us

Your lolcats fail epicly

heresy!

true
but
it's lolcats

pedantry, here? Noooo

i wus tird of his trollin.
_^_: oh, hai.

dude, that was seriously cold

_^_: You should meet me when I'm in a bad mood.

You have a bad mood? Then what are you right now ?

_^_: Right now I'm happy and smug.
_^_: My rates went up today.

Glad to hear it

still doing quickies?

Good taking with you guys, C-Ya /me ducks as pr3d4t0r throws the grammar chair once again

grammar chair? O_O

you know that chair our grammar teacher would make us sit in with a cone on our heads when we employed grammar incorrectly.

'we' ?

yes we.
me, myself, and I

ok dude you're freakin me out now

~tell musashi0011 about aolbonics

musashi0011, 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&tstart=0

_^_: don't fuck with the pr3d4t0r, you will _ALWAYS_ lose. Probably shouldn't suck up, but eh it's gotten me this far.

That is great…
aolbonics…

He is in a good mood. I am exploiting it. Don't let him know that though.

_^_: he won't be if you keep pushing his buttons.

then what good would those buttons be?

But the buttons are so shiny
watch, I'll make a christmas tree *push *push
yeah that lost its humour pretty fast

How do you go from Class.forName() to an actual object ??

newInstance();

javadocs

~javadoc java.lang.Class

_^_, please see java.lang.Class: http://java.sun.com/javase/6/docs/api/java/lang/Class.html

Thanks _
_^_

Yes ?

thanks

sure

hello, I created a app that reads from the standar input, even when the readLine is in a different thread it blocks the entire application
does it make a difference that the System.in is piped?
I'm able to read fine, but when I read to wait further messages it blocks the other thread

is the other thread waiting to read from stdin?

no
it supposed to create a window
it only does it when I close the pipe

~show us

Paste the code (and any errors) in the pastebin where we can see it. See ~pastebin for options.

hm

hah, you are reading from stdin in response to a user event right

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

you can't do blocking I/O on the event dispatch thread

no, I open it using pipes, from other app
I create another thread to read from the stdin

line 34; what is that for ?

don't extend Thread…implement Runnable and create a new Thread

I tried to put sleep(), but it seems to be ignored

Hey

if I implement runnable it supposed to work? all the examples I read say it is the same

and what is yeld()?
no, it's just better coding practice

hm…
What is pr3d4k4t?

what does the prefuse.Viewer do?

pr3d4t0r

pr3d4t0r as a l0lcat

ah

pr3d4k4t??

i'm quite surprised that code even compiles. neither InputReader nor Thread have a method named "yeld"

http://icanhascheezburger.files.wordpress.com/2007/01/2000869536009464266_rs.jpg

yeld is from the Thread class
is inherited

no, yield() is from Thread

sorry
it didn't, and was running the old version
now with the yield calls, and catching sleep exception it is able to create the window
bnow with the yield calls, and catching sleep exception it is able to create the window/b
but still
it is a separate thread

the problem might be in some other class
I mean theres a ton of stuff your using that isn't in the paste

just the prefuse package
all my code is in this file

anyone know if there's any research/implementations for using Java-style classes [e.g. a modified VM] but applying the actor model [each object having it's own thread, kind of]?

why would you do that…
google should probably come up with answers for that as well

you mean like, for example, Scala?

Anyone know why when parsing a string of input from the user, one enter key press on my keyboard will put a \r and a \n back to back? not just one or the either?
*other?

because you're on windows

Hmm? This behavior doesn't occur on linux?

~newline

ernimril, newline is What is the newline character? http://jqa.tmorris.net/GetQAndA.action?qids=62&showAnswers=true

^^^

reading, thanks
That's pretty silly that each OS does it differently, but nonetheless, that answers my question, ty

http://papernapkin.org/pastebin/view/1433

dude.. Fanook.. a chessboard is 8×8
and doesnt have weird squiggles onit

not chess…shogi

come again

asian chess-style game, pieces move a little differently, you can drop a captured piece instead of moving
basian chess-style game, pieces move a little differently, you can drop a captured piece instead of moving/b
still need to add transparency to the piece images, but it scales as you resize the frame, staying in ratio

Fanook, bunch of jlabels or is that just drawn on there?

drawn
doing labels would make animations a PITA

animations?
this should be interesting
maybe the pieces come to life and battle in an epic karate battle

heh, not yet. planning on simple translations for now, maybe a flip for when they promote

http://pastebin.ca/673120 i got epic pwnd der

Hrm…
Do you guys know who Bob Sinclair isÇ
?

~tell pr3d4t0r about Bob Sinclair

pr3d4t0r, I guess the factoid 'webobjects' might be appropriate:
pr3d4t0r, webobjects is A powerful rapid application development environment. http://www.apple.com/webobjects/

ok that was completely off the mark

~books

http://java.sun.com/docs/books/tutorial/information/download.html

~book

1) Sun Java Tutorial at http://java.sun.com/docs/books/tutorial 2) Bruce Eckel's "Thinking in Java" at http://www.mindview.net/Books/TIJ

~seen whats_in_a_name

5 PM whats_in_a_name parted the

!seen whats_in_a_name

5 GMT, saying 'oh hi pr3d4t0r. i just got back from masterbating. yeah what am i apologizing for? i may, but i need to know what im guilty

!seen slava

0 GMT, saying 'pr3d4t0r: if you want, you can revert my

is it possible to do a switch case of an enum?

java 5 enum? yes, it uses the ordinal() iirc

possible faq? - where is stream_get_contents hiding in java? or am i seriously expected to write a loop to read a file into an array?
*into a string
(or into a byte array first and then convert it into a string, which seems even sillier)

new Scanner(yourInputStream).nextString(".*");

wow, a regex scanner; i think i prefer the byte array; lol;

s/nextString/next

erm

omg

it would actually try to find that regex in the file, no ?
which would be insanely slow

you asked. that's the quick and dirty way. the better way would be to loop

.* will match the whole file anyway, nothing to be slow

depending on the optimzations

MyEnum x; switch (x) { case MyEnum.A : … }

it isn't good to have to rely on optimizations to get good code

_^_: you realize half of java relies on good optimizations…
and Sun's VM rarely lets you down

My hunch is to use one of the byte-array-*-streams to store the stream contents, the toString() it; but that seems heavy handed….

actually i want to scan the file for a regex in the end… lol.. but i wanted to have a general method for reading files first, as i might want to buffer them to do other things aswell

lol Fanook — i program JEE and have to rely on IBM JVMs as well (websuck — er, web sphere)

System.out.println does a scan of the input string 3 times for \n and \r before submitting it to FileOutputStream.write

well if you can stomach it, use a LineNumber Reader to get the input line at a time

but yes I agree suns VM is a work of art

**one line at a time

if you're just reading strings, use a Reader. let it handle the conversion to String

and i don't see why i'd split the file into lines or anything and concatenate them again…

Welcome to strongly typed programming

right; well if you have that type of syntax, whynot just use a reader like fanook sugested and use a regex scanner — since you are planning to regex the resultant string anyway, why not do it as it is coming in from the dtream?

where half of your time is spent converting between data formats

i want to download an html file off a webserver, and then scan it for a few regexps
lol

where half of your time is spent converting between conceptually equivalent data formats **

because i want to scan for more than one regexp for example

oic

it's funny how there's a getContent() method… but it seems to be some esoteric nonsense

lol

i.e. it can return a string, but only for .txt files

right. it can return byte data for an image as well
or a zip, or whatever the content is

it's a text/html file off http…

so what does it return for that?

an inputstream, lol

lol — oic

Exception in thread "main" java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream cannot be cast to java.lang.String

lolol

use toString();

so i end up with the same as when i use openStream()

PEBKAC.

muwhahahaha

I dunno what it means but I'm probably going to get kicked

i can use toString on a stream to read it's contents? that would be the answer to my question above…

~pebkac

Fanook, pebkac is Problem Exists Between Keyboard And Chair

oh I get it
it's an acronym for an insult

i believe we also have PICNIC

profound

Basically…

~PICNIC

_^_, PICNIC is Problem In Chair, Not In Code.

lol — havent heard that one before
so i guess the answer is "

that one is misleading
it might make you think the chair itself is the problem

yes, not_me, you have to write the loop"

instead of the occupant
or you could use byte b[] = new byte[is.available()]; is.read(b);

there's an available() method on InputStream? lol; learn something new every day;

toString just describes the object, as expected…

Scroll up

to where?

4 lines

_^_: but as it's a http download, available() might not be the whole file yet
or will it wait until all data is read?

does the http inputstream have some method for waitTilComplete() or somesuch ?
wait
it has contentLength

contentLength is not necesarily defined

make a new byte[contentLength]

especially it's usually not defined for dynamically generated pages

Then treat it how you would any other inputstream that you have no size information about

actually it's a funny thing with http that servers might send more or less data than indicated with Content-Length

IOW, "write the loop"
?

i'll use php instead :P

oh you sick sick person

i remember back in my first semester java class, we were given a class for reading files into string to use for an exercise…

lmao

that class had a tiny little problem:
it would create a new string object after each read, to concatenate the new data

ouch

wow

so in the end it took a couple minuted to read a large text file

tel me the solution didn't use "String.concat()"?

*minutes

or
read the file
wait nevermind
I read what beltorak said wrong

does anyone know what this means? The enum constant MMRegistration.RegistrationErrorsEnum.REGISTRATION_VERIFICATION_URL_MISSING reference cannot be qualified in a case label

i think a stringbuffer would be apropriate

or a byte array that you read the entire file into then make a string from

hello friends

hello

StringBuilder if java 5 (( non-synchronized ))

or a byte array that you read the entire file into then make a string from

this stuff makes me wanna puke…

what aspect of it ?

lol _^_;

lemme guess

_^_: that reading a file into memory is harder in java than it is in C

it isn't

it's the same loop, just with ten extra classes

lol

it's not… but in C# it's even simpler BTW

FileInputStream fis = new FileInputStream("file"); byte[] b = new byte[fi.available()]; fi.read(b); fi.close();

_^_: NOWHERE does it say that available() is the exact size of the file
"intavailable() Returns an estimate of the number of remaining bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream." — http://java.sun.com/javase/6/docs/api/java/io/FileInputStream.html

if you want a file into memory, create the new File and get it's size?

well

i have an InputStream of unknown size, not a file

the you need a loop — nothing aleviates that

That's true, but it works. That's the fastest way to read the file into memory. You never asked for it to be the correct way

lol _^_

lol
nevermind dropping the one or other byte, as long as it's fast!

the correct way would be File f = new File("file"); FileInputStream = new FileInputStream(f); etc
Can you tell I sometimes program in assembly ?

assembly sure is more fun than java

yeah

lol
in some ways

and the speed is incomperable
but you can forget about portability

I'd hate to build a distributed application with transparent LDAP / AD based security in assembly tho….

you can't do shit involving security from assembly

sure you can
it's all machine code in the end

not Java style security

its still all machine code in the end

java style security is based on stack walking
Java isn't machine code
it's bytecode
and you can't run arbitrary native code on the host machine without permission

it ends up running machine code in the end….
thats the purpose of the JVM…

you can't access the host machine without permission
in assembly , there is no way to restrict access to the host machine with fine grained control
since there is no reliable stack walk or such

hello!

~tell PaulEU about welcome.

What stupid thing did I say this time

PaulEU, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome

we could argue about the semantics of this all night;

I think we have different views of Java security

6 A.M

yeah, you brought that up, my mention of security was user-level integrated with Active Directory and the Windows Login

don't mention windows talking about security

hahaha

I have a program that can overwrite the boot sector of your harddrive from any user account

2327.

woot;
how do you do that?

NtWriteFile
windows security is based on obscurity

C++ api
?

no
native api
windows driver kit
etc
you can use driver routines from usermode

so you write a 512 byte "file" to sector 0?

This is the entire code http://www.pastebin.ca/671861

Hungary, most likely.
Maybe Poland.
Sleep well, peeps.

you too
night
have sweet dreams about lolcats and banning people!

I have maybe corrupted java package, but I'm not sure.. when I run application in terminal (java -jar App.jar I have: warnings: Cannot convert string "-b&h-luxi sans-medium-r-normal–*-140-*-*-p-*-iso8859-1" to type FontStruct
what can I fix it ?

wow; thats slick; lol;

I have problem with java plugin on www websites, fonts looks be ugly :/

and any non-privalaged user can do that? I do find that hard to belive;

Change the font

_^_: where ?

changing that would break shit
~tell PaulEU about where to change the fonts

PaulEU, I guess the factoid 'channel name change' might be appropriate:
http://freenode.net/policy.shtml#channelownership

whoa that was wayyy off

ee ?

lol — yeah, i think so;

I would just like to say that some of you guys are ruining the concept of "unit" testing

_^_: is that problem with fonts on /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/jre/lib/fonts/ ?
or other ?

I think so

_^_: where are settings of fonts in home dir ~ ?
do the java have it ?

um
DO you have a Java control panel somewhere ?
Because if you do I would suggest searching it for a font option

_^_: yes, I have java control panel

where is the best tutorial for only the new 1.6 features?

your scanner method doesn't help either… it only returns the first bit of data returned by the server it seems…
return new java.util.Scanner(connection.getInputStream()).next(".*");

_^_: but there aren't any settings for fonts in java control panel

this works and looks semi-decent:
java.lang.StringBuffer sb=new java.lang.StringBuffer();;
InputStream is=connection.getInputStream(); byte[] buffer=new byte[8192]; int c;
while ((c=is.read(buffer))0){ sb.append(new String(buffer,0,c)); }
return sb.toString();

*yawn*
pastebin, please.

we've written much more than that in single lines already

hm?

this is a followup to a discussion that's a couple screens long already… so i don't think one line more or less hurts
it still creates a new string object for each buffer read tho'

Yeah.
That's why a gc exists…
I understand if you're trying to minimize garbage…

hi all, i have a problem with servlets / jsp ; i always specify very clearly response.setContentType('text/html; charset=utf-8'), but firebug tells me some servlets always send the response header only at text/html, some others as text/html; charset=utf-8

i am simply wondering while there's no builtin stream_get_contents :P

But one of the shortcomings of the language is that strings tend to create a bit of garbage…

i've written the same thing in C earlier… and simply realloc() the buffer to twice the old size whenever it's full (and it's static and re-used for the next file)

…okay?
What are you trying to do?
copy a stream to a byte array?

downloading a file off a webserver
where we don't know the size in advance
i have a solution now anyway… just ranting about java :P

read it into a ByteBuffer?

that seems better than stringbuffer indeed
nobody suggested that before

are you using nio or InputStreams?

i have a HttpURLConnection

~javadoc HTTPURLCONNECTION

I don't know of any documentation for HTTPURLCONNECTION

~javadoc HttpURLConnection

how did you manage to capitalize that?

svm_invictvs, please see java.net.HttpURLConnection: http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html

I was being lazy…
Damn
Patrick Stump is goofy looking.
I wish I had sideburns like that

where are settings of java in home dir ?

how is re-typing instead of pastting lazy?
~/.java/ ?

ok, I can't find solution for warnings: Cannot convert string "-b&h-luxi sans-medium-r-normal–*-140-*-*-p-*-iso8859-1" to type FontStruct

because I'm so hot and bothered by Patrick Stump
did you read about setChunkLength?

I see that in Java 1.6 don't have class javax.swing.GroupLayout ?

that is not relevant here… chunks are a special http feature
"when using chunked encoding streaming mode"

I see.

ups.. I did mistake

Anyone know how/if I can access JNDI DB resource from regular Java file?

You have access to the stream, no?

with getInputStream, inherited from URLConnection
see the too long paste above

Yeah…

i can rewrite to to use a bytebuffer gizmo myself, but it works for now and i am writing more interesting code

I mean, you can also used a BufferedStream.

i'd rather have a stream_get_contents equivalent, i'd be much further already
what use is a bufferedstream? i can only read lines from it

Which you can also have access to the supporting byte[] array.
I'm not familiar with stream_get_contents…is that part of POSIX sockets?

it's a ph[ function

php?

stream_get_contents returns a stream until eof and returns the data as a string
yes, php, it's a modern drug i heard

…yeah….

you've heard of glass, you've heard of dust, well this is glass dust

ah, i typoed it
i thought you were making a pun on not knowing php
but i like how, minus this crap, i actually get stuff done in java, having started my first semi-serious project a few hours ago

Kungen, not really
Kungen, include libs to access jndi server, then do a lookup

Well, C/C++,Java, Ruby…or whatever will all do whatever you want, it's just how much effort you're willing to put into it.
I just get sick of peole who get so zealous about any one thing…
I think what people tend to forget that it's all code…it's a bunch of effort no matter how many tools help you along…*sigh*

hmm I have problem still with fonts :/
http://img361.imageshack.us/my.php?image=bladjavawo6.png
where is mistake ?
fonts are ugly :/

might be a hint in here for ya; http://java.sun.com/j2se/1.3/docs/guide/intl/fontprop.html

how can i pass a parameter without using input tag? is it possible?

thx, I'll try

?
you might need to detail your question a bit more. we're not mindreaders

hehe sorry

but yesterday there were OK :/

then you changed something

in jsp, how can i pass a variable value to another jsp page without using html input tag?

use parameters on links instead
a href="thepage.jsp?idofmyentry=987234987&texttochange=mooIamacow"change my text to cow/a

ok let me fill you in on what im trying to do, first i load data from a db and put in varibles according to its column, displayed to user, and then when the user clicked on submit (fom action = same jsp page), i wish the variables is still intact
well you probably know after i press submit button, the variable is set to null

right?

put all variables in an object and place it in the session. that way you can retrieve the variables from the sessioncontext in the page
and they'll be available as long as you want

How do i get server host (like request.getRemoteHost()) having only ServletContext reference in my method?

aha, is that involving javabean?

well, make the container serializable. the one you put in the session

is there some utility (available for osx) that allows you to run applets in a stand-alone fashion without a web browser?

appletviewer

thanks

ok that's javabean if im not mistaken, thanks dude.

haven't checked it but http://www.jsptut.com/Sessions.jsp might give you some ideas

ok, thanks

heh, kinda poor feedback from that app. can it be run directly on a .class file (i only saw examples with .html files in the man page)? it seems to start and then immediately quit regardless of what file i run it on.

afaik you need a htmlpage for it

ok :/

hello
is it possible to write the bean, that uses the connection to the database from the connection pool, which also used for persistence ?

erm
what?
the bean?
the connection pool?

how do i get server host from init() method of servlet? is there a way?

no. And if you think about it, there's a good reason for that.
You can, however, figure out at request time which hostname was used to *access* the servlet.

server doesn't know where it's hosted and it can only get known about it reading http-header it received. am i right?

half right.
you can map a given web-app to a number of different urls — that's the real reason.
Therefore, there's no canonical "this is the hostname" available.

jottinger, I have the connection pool in the application server.

right…

jottinger, I want to write the bean, which calls cpesific stored procedures on server.

okay, and?

unfortunately i need it in load-on-startup servlet that doesn't work with requests. can you suggest a workaround? to get ANY of mapped urls?

get the connection from JNDI, call the stored proc…

jottinger, can I use those pool ?? and how to connect to it: via jndi ?

why do you need to?
I mean, what are you really trying to do?

jottinger, also that pool is used for JPA.

irrelevant. Just do it.

jottinger, thanks!

jottinger i need to instanciate jms mesasageListener that would log server-host and other info when message arrived.
and i need to instanciate it on startup

in your WEBAPPS?!
Um
don't do that

why?

because that's stupid
what container are you using

tomcat

don't
get a real container

stupid to use JMS in web app?

/APPLET". i then run appletviewer on it. now i get "java.lang.NoClassDefFoundError: Main (wrong name: newton/Main)". how do i make it go into the newton package?

stupid to consume jms in a web app.

jottinger, unfortunately i do not decide what to use in project..

well, tell whoever does that consuming JMS in a web app is not the right way to go.

jottinger may i talk to you in Private?

what about?

not to flood a channel
about this design issue

channel's dead anyway. Keep it public.

Can you explain plz why its not right way? consumed message forcec web app to do something. what's wrong?
forces

a webapp is a managed deployment unit. Consuming a JMS message means your message consumer will have to beinstantiated in the webapp's classloader; redeployment of that app won't be able to clean up your listener.

jottinger that's not a problem in my case. if web app is stopped, there is no more sense in those messages

but the consumer is still alive, regardless

hm
but it will be dead if broker is down?

no
the listener would still be there
listening to a dead broker

what will be changed if i instantiate consumer in non-web app then?
every app could be stopped

if you redeploy the app, then the container will clean up allmanaged objects

and consumer will be still alive? or i don't understand you

the broker's life is not the issue
startup creates a listener in webapp1's classloader
user redeploys webapp, creating webapp2

there are hooks for that

container cleans up webapp1's classloader… but whoops! A reference still exists to webapp1's JMS listener
so now you have two listeners
you CAN clean this up but you're violating the j2ee model

oh?

hello frnds

oh what

i am having a prob with loading the java applet
thi is my error http://rafb.net/p/RI1LaJ48.nln.html
can anyone help plz

~applet

I guess the factoid 'resizing applets' might be appropriate:

~aolbonics

jottinger, resizing applets is http://blog.taragana.com/index.php?p=10

~applets

jottinger, 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&tstart=0

can you tell me where the glassfish (Sun application server 7.1) stores the jndi connection to database connection pool: in the java:/comp/env ?

jottinger, applets is Check the topic, read http://javachannel.net/wiki/pmwiki.php/FAQ/Applets - Basically we try to avoid them.

glassfish is not sjsas 7.1
glassfish is 9.1, not 7.1

jottinger, sorry, but where it stores that connection ?

jottinger i see, thanks for explaination. Unfortunately i have nothing to do with this design decision..

ugh.

the site i am tring to load is actually using JVM
its from ms i guess
is their any solution for that, plz help

jottinger can you suggest any nice-enough workaround to get any of mapped urls from init() method? in practice my app will have only one

are you saying setting things up/destroying then in a ServletContextListener is bad? or perhaps you're talking specifically about servlets?

can someone tell how to get the context of the @Stateless JavaBean ?

he's setting up a JMS listener in a webapp.
why do you need the hostname?
I mean, what are you using it for?

i agree that doesn't sound like a great idea. but i'm not sure that the init/cleanup is why, afaik you can do that cleanly enough with ServletContextListener

yes, it can be done, but it's not the right way to go…

jottinger to log the event in DB. we will have several instances on different hosts. and we need to know where exactly the message was handled

jottinger's photo store
- i heart huckabees

why not use the IP of the host?
?

jottinger it's ok to use IP. how can i get it?

in i heart huckabees there's a place called jottinger's photo store i think

URL

what do you mean?

get the IP of localhost…

thanks for your help

jottinger, Would the line @Resource(name="myDB") public DataSource customerDB; return the result for me ????? the connection from the connection pool where myDB - is the name of the jdbc resource, which uses the connection pool?

is anyone out there getting enough sex?
ouch, sorry wrong room
wrong channel

hehe

have read too much bash.org

Why can Ant add a directory to the classpath of a file while you're absolutely unable to do so with the "java" command line executable? (in java 1.4, in my case)

ant is smarter?

Maybe…
But how can I so-to-speak emulate that behaviour… without ant?
Any known way?
(Compiling a little c app to do that would be an option, as long as I can statically compile the thing and as long as the license allows commercial distribution without sourcecode etc)

No idea. What do you want to do? Add a directory of classes to your classpath? What's wrong with java -cp ?

no, I want to add a few directories with .jar files and property files, xml files and image files to the classpath
at least that's what ant does and it works

"The IntelliJ IDEA integrations have been developed exclusively for ej-technologies by the leading IDEA plugin specialists at Fuhrer Engineering"
I'm sure those guys have no idea how that sounds to non-German speakers

lol

I am trying to download the JLint plugin for eclipse, but the link [ http://www.willowriver.net/products/jlint.php ] seems to be broken. Anyone who uses this and could suggest me where to download it?
otherwise any suggestion about similar tools [that work as an eclipse-plugin] will be really appreciated

oops

well, the eclipse is neat

you know how there's servlet mapping, is there applet mapping?
or maybe i just can use servlet mapping to map to an applet?


it sounds almost like you have no clue what servlets are or what applets are

would be useful, no?

not sure which

well if it sounds like that to you, i doubt you can help me

I'd love to see why an applet - which runs on clientside - should need a url mapping on the server side

it would be handy while i'm buidling it
to not have to copy the .class file
into where the web pages are
because the web pages know nothing of my java packages

erm… well, that would be a simple mapping on serverside, not a url mapping… plus, you could always use those kicky jar file thingies

ahh
could i specify the mapping in web.xml?

not simply, no, because web clients can't access data in WEB-INF

hmm

Let's get back to that "enough sex" thingy

haha, sorry about that

hi a wrote a simple java chat server listens port 7777 and a clent appplet
on localhost there is no problem
on connection
but
i try it on ubuntu server
cliet cant connect it
777
can you help me

unsigned applet can only connect to the host it's loaded from

?
i dont understand

~topicsmite thepenguin37

then I"ll just do this

And the wrath of /TOPIC descended with terrible fury upon thepenguin37. And all the people marvelled, saying, Behold, we too should read the /TOPIC, lest we be stricken. And all the people read the /TOPIC, and went away edified.

heh
or loesh will

hehe..

?

thepenguin37, read the topic.. specailly the part about applets :P

wehere i can ask it

google?

thanks

stellarium rocks

is it possible to install jboss in virtual host?

why i can not ask about applet

yes
because applets kinda suck and the channel's decided not to waste time on them

what is its minimum memory requirement?

for jboss?

yeah

depends on what services you start up

for ejb jsp and servlet

… and which container you use for each service
in other words, you need to test

is 512mb ram enough for that?

should be

this is the error it is giving…. Error occurred during initialization of VM
Could not reserve enough space for object heap

Web Hosting | Web Host

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

Leave a Comment

You must be logged in to post a comment.


Blog Tags:

Similar posts: