noob to java here so apologies Im having a problem with a jbutton background with an imageIcon attached png the

Ugh maven I really like what somebody did once and turned ant into a scripting language. The act of building a project is a script, not a description. Still, it’s nice to have dependencies handled properly in Maven.

there is another tool, which is written by cheeser.
~gosling

r0bby, gosling is a pure java build system. It can be found at https://gosling.dev.java.net
r0bby, gosling is a pure hosting with java support build system. It can be found at a href=”https://gosling.dev.java.net”https://gosling.dev.java.net/a

Sup r0bby! End of your night or beginning of your morning?

beginning.

there was a website talking about buildr as well. (maven replacement)
written in ruby

Oh well, it’s all better than make files

i do like Maven btw

well, we are always reinventing the wheel I see

True dat, caverdude.

maven.. Urgs. Crude syntax (wouldn’t care too much about that) and XML configuration (A no-go).

gcj java cc is really darn fast inst it?

erm…

well i just had a zen experience with it ;P .. 76seconds to less than 1
but i am comparing it to JDWP under eclipse.. but still eclipse was running

hi

hello

TextureLoader loader = new TextureLoader(“/image.jpg”, …);
now
where does that search?

what’s the regex to match what’s inside double quotes?

“[\s\w]*” i belive
*believe
arr no, “[.]*” could be it


[.]* is stupid

?
ok i could let out the []
but IIRC . = any_char, then * it and ” around it

I want to text inside double quotes without double quotes

ahh
“(.*)”

Still, “.*” as pattern is probably not what you want if you have the following input string: “This”, he said, “is stupid”

why not split on ” ?

Qhestion, no that would return the double quotes too

really?
hmmm

No, it wouldn’t

never tried regex with java, only pyhton…

They are probably 99% the same

im trying j3d and would like to know where to put my texture: TextureLoader loader = new TextureLoader(“/image.jpg”, …);

what do the javadocs for TextureLoader say?

wait

Why the leading /? And I’d guess (without java3d experience) that it is treated as a resource.

agreed

Argh, has anyone used Imagero to scale images?
The documents are just craap…

“Contructs a TextureLoader object using the specified file, option flags and default format RGBA”
argh, specified file can mean everything
the example i saw had absolute path

please guys

B cast(D d) { return d; }

and then i do Number n = castNumber,Integer(new Integer(5))

wtf for?

it doesn’t work

instead of ListInteger

ah

hmm…

on the serving side

sounds simpler

what are regex groupings for? ()

Urgs.
Read about regex

to edit the assigned item.

how can i convert “file://C:/data/development/workspace/j3dtest/bin/Arizona.jpg” to “C:/data/development/workspace/j3dtest/bin/Arizona.jpg” ??
i got it from
Main.class.getProtectionDomain().getCodeSource().getLocation().toString()

I want to match the value then split according to /

that should return the folder where the Main class is
that means file:/C:/Data/Development/Workspace/J3dTest/bin/, then i added Arizona.jpg and voilą, only the file:/ is too much
(i guess)

have you ever heard of something called THE STRING CLASS
:P

Qhestion, substring?

you two, i know that
but
i mean, maybe it means something that file:/ is there? maybe that could change magically?
maybe there is a method to do what i want, to handle some special cases (if there are some) ?

something like “unescape”?
hmm

I have confused with the java versions.The JavaSE 2 is the standart edition 2,the jdk 1.6 is the sdk of the java.Some books have got title : “Java 6″ .What they mean?

the version

what version ? of jdk?of JavaEE?what?

that doesnt quelm his confusion

there’s no function that returns a matched regex value?

i am confused too, whats with the 1.6 and 6 and 2
and all that

1.6

1.5

what about SE 2
is that 1.2?

forget about the 2, its not 1.2

yeah i figured as much
i guess i have a right to be confused about it then
lol

there’s no function that returns matched string according to a regex?

thanks guys

or i’ll have to stick to pattern/matcher?

Exactly

about the 2, all of them are 2

But since you obviouly don’t know about regular expressions I wouldn’t recommend using them in the first place..

harr harr i got it. solved it all alone *proud*
…..getLocation().getPath();
instead of .getLocation().toString();

In fact it is Java 2 1.x

Blafasel, i do know about regex.. just need to review basic stuff

Java 2 1.6 is also called java hosting 6
all is Java 2

I’m waiting for Java turbo edition

actually it’s not anymore.

:/

it’s JSE 1.6 or Java 6
sun marketing–

arg
I’ve been told about sun marketing paradoxes :p

Still, surely by 7 they’re going to fully drop the 1 prefix? Or is it going to stay there till they actually remove deprecated classes/methods ?
As in the occasional 1 prefix

what 1 prefix?
the ‘1′ in 1.6?

Sure the 1 is useless

it’s the version number so not really

Yeah, nearly always it’s referred to as 5,6,7 except in a few places around the tools themselves

it’s as useless as any other version number

I suppose windows 95 wasn’t 30 times better than 3.1

thats right, the 1 is allerady forgotten since java 6…

http://java.sun.com/javase/namechange.html

1.x

~java version is http://java.sun.com/javase/namechange.html

I already have a factoid with that name, cheeser

~java version

cheeser, java version is http://java.sun.com/j2se/1.5.0/docs/relnotes/version-5.0.html

now , since 1.6, its just java web hosting X

Wake me when Java is all open source and somebody makes a decent up to date version for us poor mac users
Shouldn’t be too long (not sarcastic)

1.6 will ship with leopard

Just in time for Java 7 to be out

java7 is a ways out

That is true, the only thing they’ve worked out is measurements, everything else is up in the air

wait wait wait…I’m still working on 1.4…pffff

~no, java version is http://java.sun.com/javase/namechange.html

Okay, cheeser.

I want to match the string inside double quotes

“{.*?}” I think

this returns double quotes too

dear lord.
did you try using split() ?

Did you try getting group 1 though?

System.out.println (“Found ” + _m.group ());

group 0 is the entire string, group 1 will be what’s insdie the brackets (though I may of told you the wrong brackets)
“(.*?)” is probably it

it’s ()
yup
ok

may *have* told you…

Oh don’t expect good English grammer from programmers
It’s like our Kryptonite

grammar

ummm Java3D supports .png files doesnt it?

Normal Java Image stuff does, so I would expect 3D to *have* caught up by now.

Is there command I can put in “System.out.println();” that randomly choose one variable?

cheeser, i’ll use split after getting group 1

what?

That’s a rather strange request, any variable ever?

bye
exit

because when i try to load my texture.jpg it works, when i try texture.png (opened .jpg with paint and saved as png) it crashes (ImageException)

Oops, hmm as for the png not working, have you tried opening it as an java.awt.Image or only as a texture for 3D?

only as a texture
TextureLoader loader = new TextureLoader(Main.getResPath() + “texture2.png”,
“LUMINANCE”, new Container());
Texture texture = loader.getTexture();

don’t paste here

not more than…
oops
2 lines

line wrap strikes again

you know reading a 200 meg text file takes a lot of memory

yep
hmmm… Xith3D looks nice too… should try that..
and they say “supports png” on their homepage

Jpct

whats considered a hard class reference?

is good in my opinion

Is this not valid in JDK 6? HashMapString, String
Eclipse tells me it’s only valid with source lvel 5.0

It uses generics which is in Java 5 and above, perfectly valid for 6
I think eclipse hosting is just trying to tell you the minimum source level needed

JimmyA, Any variable that I have created earlier in the program

If you want to see any variable, that’s pretty much the job of a debugger. Otherwise you have to print a specific variable, or you could have an array of ones and print out one using a random index.
unless you simply want to do { int x = 3; System.out.println(x); } ?

hey ppl
good morning
I’m finding for an API for audio/video streaming….
what can I try?

http://pastebin.com/d46f496c3

for audio I find jorbis the best

jorbis?

please help me problem with web page validation

I found the problem. I had a project sepcific source target of 1.4 for this project when Windows-Preferences has it to 6.0

thats a ogg vorbis decoder

Yes, but with mp3spi you can add mp3 support

i need to do a network based multimedia streaming application

AHhh pretty hard core, can’t help you with that

iv read something about JMF, but that api is tooooo old….

Hello.

dont use type=”submit”

else use submi() in your javascript function if validation is correct
*submit()

thanks anyway..

chnarr ok
chnarr can you make change in this http://pastebin.com/d46f496c3 and paste me

no but you should understand :p
try it
insert submit(); before return false; lines

tag

no, sorry, the contrary, insert submi(); one time at the end of the javascript function
thats all
avoid input type=”submit”
understood ?

chnarr ok i am trying

hey
i need a hand here

I wasn’t gonna be the first to make that sarcastic response

just make sure you return it in ice
he may need it later on today

yuck

BAD!

hehe

chnarr http://pastebin.com/m4ad56cc0 see this i tried what you said,i cant load a next page

ksivaji i think yo uneed to read some javascript tutorials

and I think you need to realize this isn’t a javascript channel

And have patience. Does the flower burst to seed before it has seen the bee? No. In this, as in nature, we must seek patience.

replace by document.form.submit();

chnarr ok

the problem is that on program closing I don’t see the label , I call a method that initialize the jdialog adding a pane and the label into it, then I call pack and setVisible(true) on JDialog but only the dialog with the title is shown. I’ve also set visible true to the pane and to the label

what are hard references to classes?

~weak references

I guess the factoid ‘references are pointers’ might be appropriate:
cheeser, references are pointers is http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#106237

hrm.
look up weak references

ive never heard of the term

did you add it to the container?

yes I’ve done it

chnarr ya it is working gentle man

~tell magowiz about show us

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

~pastebin

http://pastebin.stonekeep.com

well just form.submit() would be enough

ok ok

r0bby, ok I’ll paste the code

but seriously, ##javascript is your answer. They’re more qualified to help you than we are.
that’s for ksivaji.

i don’t want any of r0bby’s because i can hardly guess where they have been

i can make a pretty good guess about where that thumb’s been…

lol
~be r0bby

FileNotFoundException is a subclass of IOException; Exception won’t directly catch that.

r0bby i am just learning ,i dont think more qualified persons will help me

What would be the overall best way to get a list of child components in a JPanel that are inside a particular rectangle’s bounds?

that’s why those channels exist. But like the topic says, this isn;t for javascript help..

ksivajiactually its true that javasript probleme may better be solved in a ##javascript named channel

you’re so evil

who are “they” ??
what are you talking about ?
Cayde still dont ask anything :/ ?
weird

r0bby, I pasted my code on http://pastebin.stonekeep.com/683

I know Cayde from another channel.

ok

r0bby is my virtual pet
:p
i need to explicitly set classpath for java.io.*
do you know where it is ?

rt.jar

you don’t need to set the classpath hosting for that…that’s in the standard api…afaik; also star imports are bad. import exactly what you need and only what you need, it’s compile-time only.

why would a compiler fail to locate it tho?

Is the only way to do it to just go through all the child components one by one and test them, or is there a faster way?

what are you using?
what version jdk?

1.6 i think
well i am using GWT to compile my entire project

Have fun.

~GWT

chnarr, GWT is Google Web Toolkit, which converts Java to JavaScript. http://code.google.com/webtoolkit/

GWT uses its own compiler as well as regular compiler

as far as i can tell, you’ve added nothing to your JDialog..
unless i’m missing something here

r0bby, I added my content pane using CloseDBDialog.setContentPane(getJContentPane2()); on getCloseDBDialog method

oh okay, i see.

Is there a way that I don’t have to define “o” after each “System.out.println” ? http://pastebin.com/d3e5925c5

ok stupid question time. If I call bufferedReader.readLine(), is a new string created every time? Even if I am using a StringBuilder to hold that reference?
ug ive been looking at this code for way to long

i don’t think you can use java.io.* in the front end for your GWT app

have no idea.. check out ##swing they may know better than me;
s/;//

what about in servlet that supports it?

ok thank you anyway r0bby

as long as the GWT compiler doesn’t touch it.

not as you’ve written … you are evaluating a new expression and assigning it to o

gotcha

method?

I don’t get what you’re looking for

you can extract that as a method if it’s that important for you: o = diam(r);

~javadoc StringBuilder

jchauncey, please see java.lang.StringBuilder: http://java.sun.com/javase/6/docs/api/java/lang/StringBuilder.html

oh ok
simply

paulweb515, It’s not important. It’s just lazyness :p

thanks chnarr

~pastebin

http://eugeneciurana.com/pastebin

like this http://eugeneciurana.com/pastebin/pastebin.php?show=3869

why ?

sorry wrong ‘c’

im probably not saving any memory by doing that… ug this is a pain in the ass

thanks for a welcome
thanks

sure

hi all!

welcome

yeah, I think it’s not going to matter. Is memory really a problem with what you’ve got, or are you just trying to be tidy?

what capacity of ram should i buy in order to run eclipse and jbuilder smoothly?

1 Mo

1 GB?

I mean 1 Go, sorry

when doing a standard web application, how to have a directory where I can store application specific stuff? I don’t wanna have this as a configuration option, because then the user has to specify this for his system. Any idea? For example how to get the tomcat root directory? In there, I could create an application specific directory.

Gb, yes
GB
its the minimum if you espect to make some dev web server to run properly
though, you may be more confortable with 2 GB

What is best performance/reliability wise when uploading 10-60 files į 5mb: multiple http requests, one for each file, or everything in one big request (java application uploading the data).

I’d do multiple HTTP requests.
It would suck if you have to start your request all over again if you’re on file 49 when the system dies.

i am thinking about getting a new laptop altogether failing that i’ll do the ram upgrade

Actually, 2GB is confortable, 1 GB lets you work, but don’t think about listening to music
:p

Why does if(sname.matches(“^o-”)) fail on a string that begins “o-”?

Does it work if you add a .* to the end?
Like – does matches require that the whole string is matched? Like adding ^ and $ implicitly?

Yes…..I didn’t realize it had to be an exact match.

hi, is there a stable priority queue implementation in a free library?

~javadoc priority queue

I don’t know of any documentation for priority queue

~javadoc PriorityQueue

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

i am having a problem with feisty. I installed LAMP, tomcat, and mod_jk with apt-get install. Easy so far. I cannot find an example of what to change to enable jsp’s to run in individual websites.

yep, that one is not stable (referring to sorting)

is that using real java or gcj?

stable how?

real java from sun

I use feisty too, good one

as in keeping the order of “equal” elements

setup has been easy so far, the examples all run from localhost
but if i name a file file.jsp, shouldn’t it run?
under the website directory?

get it running in just tomcat. then worry about the mod_jk mapping

see for example Collections.sort, that’s stable and it’s explained

what am i doing wrong?
everything runs in tomcat
i put JkMount /*.jsp in the virtualhosts entry, but that did not help.

drop the /

what url do you use ?

this will be for many diff urls

ok, I guess nobody here knows

i want to use jsp. i am a web developer in a small php shop

what url do you use to test your jsp ?

localhost/example.jsp runs example.jsp. but that does not do me any good. i need to run njhomes.net/example.jsp, etc

localhost/appname/your_jsp.jsp

that was just an example, that file does not exist

where appname is the directory containing your app

i need it to run as the client’s url!!!!

hey everyone

??? what do you mean ?

localhost will not resolve on a machine on a visitors desktop

ok, replace localhost by your server’s ip…wha else ?

i can’t get my app to run from an executable jar.. it cannot find the swt classes even though the swt jar is in the classpath and the dll is in the same dir as the jar

exactly, and that is what does not work. http://myURL.com/servlets/whatever.jsp is not working. something else must be needed.

did you update your manifest to reference the swt jar?

yes. i will pastebin the manifest, 1 sec

ok, sure it works locally ?

yes.

and it can’t find the classes? or the dll?

~pastebin

http://papernapkin.org/pastebin

did you check your firewall ?
80 aren’t you ?

i am inside the firewall. cannot be a factor when both machines are on my desk
port 80, yes

did you try with ip address directly instead of url name

something needs to be changed in the virtualhosts file, and perhaps elsewhere

http://papernapkin.org/pastebin/view/1460
all of the jars mentioned in that classpath are both in the lib subdirectory outside of the jar and in a lib subdirectory inside the jar, and yet it still fails to find the swt classes

the swt jar(s) is *next* to your jar? or in swt/ ?

ipaddess is the same as if i use localhost. no good. i need the client url to work

putting jars in jars is (largely) worthless

the jar is in lib, and the dll is next to my jar

no thats wrong

your manifest says the swt jars are in swt/

i was just trying everything :/

so put them there or fix your manifest

ip address is OK

my mistake, yes they are in swt

….but you may have some local firewall running on your server….

pastebin the error

okay,

no local firewall

how do servlets and osgi fit together? can i write servlets that “use” / “are based on” osgi ?

peace-keeper: Yes

sure ? did you try a telnet on 80 port from your client ?

the firewall is a dedicated machine, i am inside of it, so is the web server

how does that work?

peace-keeper: in 3.3 you can start up the http service (based on Jetty, AFAIK)

peace-keeper: Check the osgi implementation of your choice for a http/servlet bundle.
3.3?

yes, of course i can telnet to the machines.

Eclipse != osgi

that is how i am moving the code around

would the servlet then “start up” osgi ?

in eclipse 3.3 it is implemented using Jetty :-)

but all workstation and servers may lock http port…

peace-keeper: the other way around, I think

i need to know from someone that has set up virtualhosts to run jsp’s

OSGI starts up the servlet container

so my servlet would be run by osgi, instead of tomcat ?

that’s called soft firewall

Right, osgi starts the servlet container which does the whiteboard delegation to your servlets

peace-keeper: uh, Jetty, maybe, instead of Tomcat

hmm okay, so osgi would basically replace my usual servlet container ? is that correct?

i can pull up the pages from the webserver. the jsp code on the page fails to execute

http://papernapkin.org/pastebin/view/1461 updated

peace-keeper: It would provide a servlet container.

kay

peace-keeper: Which is a different thing.. One osgi bundle would act as a servlet container. Somewhat.

what’s the error message ?

but only in the client directory. all the samples run
the tomcat admin and manager run, and can be pulled up from port 80

paste it

but the virtual hosts, like njhomes.net, cannot execute the jsp

see anything? http://papernapkin.org/pastebin/view/1461 updated

(you’re problem is kind of weird)

peace-keeper: I’d try the eclipse.technology.equinox newsgroup (it’s one implementation of OSGi+http)
peace-keeper: http://www.google.ca/search?hl=en&q=site%3Adev.eclipse.org+news.eclipse.technology.equinox+http&btnG=Google+Search&meta=

i think i am in the wrong group. is there anyone here that has set up a server to run jsp’s before?

the virtual hosts are clients, so they don’t execute the jsp, they just call it
That’s my life

peace-keeper: Other implementations are knopflerfish, oscar (now obsolete), felix and lots of others. They all can rund a http bundle that serves your servlets. How you should use them is even specified in the osgi spec – so I’d suggest downloading that.

Semper fi, and thanks

I used tomcat, jboss, websphere, weblogic, resin, is that enough ?

so what needs to be changed to enable a jsp to run in a clients virtual directory?

dbrewer_rjr brew me some whiskey

http://papernapkin.org/pastebin/view/1462 updated with dir listings

i want to put the file right next to the php files forthe same website, and have tomcat called to execute them

jsp always run on servers…
oh, you may mount de virtual directory, then specify your appDir

how? i used the following line in the virtualhost file: JkMount /*.jsp

I know that there is a netbeans channel but I would like to know someone here who has netbeans mobility running on linux. I hav library problems. It’s Java after all ..

do i need an alias line?

it’s more system relative question

ubuntu fiesty LAMPS, apache2 tomcat5
standard install, so ar

once it’s mounted on the server’s filesystem, I may help you

feisty*

far*

you’d better mount the containing directory, then reference it

mount it where? in what file?

/mnt/jsp/

anyone see anything wrong with this manifest and directory structure? http://papernapkin.org/pastebin/view/1462

better /mnt/tomcat/yourapp/
when done, configure tomcat to use external directory /mnt/tomcat/ as appDir root

please stear me to a reference

the rest is tomcat configuration

tomcat has an appdir root, it self configuyred webapps as the root. but that is not in the client directory. perhaps i need to alias that
i’m outta here. thanks for tring to help.

ok, but don’t use default tomcat root, look at tomcat’s doc how to use external appDir and you’re done…no need to aliasing

damn. why do I need a try/catch block to detect an unchecked exception?
it took me 2 hours to find the part of the code that threw a NPE

uh. it’s how you catch exceptions. why wouldn’t you need one?

but I mean I couldn’t detect where the error is until i wrapped this code into a try/catch block then i saw it is generating a NPE

You didn’t need that block to detect it.

well, no shit.

usually then a NPE is generated it appears somewhere
right?
unless it is being eaten?

use a debugger

what?

s/then/when
paulweb515, so this is the only way to detect NPE?

if you don’t catch that NPE you get the stack trace on the console and your app crashes

it didn’t crash but it didn’t perform what it is intended to do
i didn’t get a stack trace, why

not the only way, but most debuggers support some type of “Exception breakpoint” that will break when the exception is thrown

hard to say without seeing your app

_filePath = (String) _e.getKey();

Because you do an evil try { /* stuff here */ } catch (Exception e) {/*nothing here */}

and _e was null

b0r3d, just use one simpletry/catch in your main and use e.printStackTrace();

Crap

Blafasel, i don’t think so

that’s not good programming, but easy to find quick and lurn

i’m depending on someone’s else code.. so they might be logging the exception somewhere
but it’s evil i’m not being informed

~evil

only morons use the word “evil” to refer programming practices, IDEs, etc.

so what could be the reasons why im not being informed about the exception
can they just hide it?

sure

or log it ok
but that’s a bad practise
because I spent 3 hours debugging the code
like reverse engineering
and found that the Entry _e = _i.next(); line was ommited
omg evil stuff

yep. moron.

moo

someone tell me that its stupid to have a webapp analyze and process a 200 meg text file

so what are your comments on the above?

why would it be stupid?

it’s not real bright, no
ram costs would be nice

it depends entirely on the reqs.

this thing has 800,000 lines of call detail and its got to be inserted into our db
lucky me i got them to not insert all the packet lines (blackberry usage) so taht cuts down on how many inserts i do to about 25k-50k but i still have to process this text file to determine which lines to insert and which ones to skip

sounds easy enough

you would think but memory usage is killing me

how are you keeping files in sync with a database? I mean if the transaction of a DELETE SQL statement rolls back, the file should not be deleted and such things.

filesystems are generally non-transactionable

im having trouble getting the angle between two points
with the right being 0 degrees, and going counterclockwise

##math, perhaps?

erm
i would be able to do this in math not java because java is weird

uh. it’s math.
a + b, etc, etc
don’t blame java if you can’t do that.

i didnt blame it i said it has a weird math

Hi, im having a lot of problems trying to use commApi, whenever i try to open the ports (all of them) i get PortInUse exception, even if i just restarted the OS, my mind is gonna blow with this, ive been at this spot for two days now, please help me

no, it doesn’t.
it looks basically the same as in just about any other mainstream language.
int x = 2; int y = x *20;
it’s just math.
what’s so weird about it?

the coordinate system
the atan and acos, asin

those are just doubles.

i get error wemn i update its looking for sorce 1

uses pi differently

hahahahaha
yeah. java invented an entirely new math system.

i need to fix my java error

~tell snowbird abotu ask

tell nick about factoid – you missed out the ‘about’, cheeser

~tell snowbird about ask

snowbird, The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.

cheeser people come here to get help not receive idiot responses

sometimes, those people even have non idiot questions.

how does it use pi differently?

if it was a simple question i would just tell them instead of being an idiot

you haven’t *asked* a question yet.

i dont know but i get different results

against what?

JavaMan22, you actually didn’t ask any pecise question…

with the regular formula i use

you’ve shown no code. no errors. just spouted off idiotic babble about how java does math weird.

ok
right

~tell JavaMan22 about show us

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

ok more than likely the jvm is way more precise than any calculator you have or doing it by hand

Hi, im having a lot of problems trying to use commApi, whenever i try to open the ports (all of them) i get PortInUse exception, even if i just restarted the OS, my mind is gonna blow with this, ive been at this spot for two days now, please help me

is there a way to listen for entering/exiting fullscreen mode?

any idea how to make it transaction aware?

i try to update my jave its looking for sorce i gave it sorce still no updates

wtf are you talking about?

double theta = Math.atan((y1-y2)/(x1-x2));
thats wat i thought it would be but its not working

my java update

are those all ints?

hmm I see no simple way to do this. One could write some kind of Store that is able to do distributed transactions with a JTA Server, but that is not something simple ;(

doubles
….

use JCR
JCR is transactional, and it can mirror filesystems

or just forget about about transactions
and do manual clean up

btw, is there any advantage of JCR in contrast to existing ORM solutions like Hibernate?
it’s not the cleaning up, but for example when I delete an entity and at the same time delete the associated file, the filesystem operation will succeed when the database one fails, and I cannot undo this..

JCR != ORM

you can undo it
all you need is a persistent queue

and how do the results differ?

how do you think most JCRs work? they queue their file operations and commit in batches on transaction termination

is there any plugin available for eclipse or netbean to convert existing jsp code into jsf?

let me check again

“most JCRs” use a database.

btw in java pi is equal to 3.141592653589793 which is pretty damn accurate

what is the main difference? as far as I could tell, it’s main feature is that I can navigate the persistent object graph. But I can also do that with JPA. So why is JCR different?

JCR is designed for potentially heterogenous datasets.

there are a few transactional file apis

i have no idea what the pattern is but i get negatives.. positives…

jakarta has one, don’t know if it integrates with JTA, it’s at http://commons.apache.org/transaction/

~pastebin

http://pastebin.stonekeep.com

but it’s really not that difficult to write your own transactional file store if you think it through
everybody ends up doing it eventually hehe

yeah that would have been my next question

OTOH, you could use JCR and be done

I think the easiest would be to somehow have Spring transaction manager deal with this, so there is no need to do a distributed transaction
any idea how to make a JCR repository participate in a Spring transaction?

well, you probably don’t have to actually delete the file as part of the transactional operation. unless you’re dealing with system integration, it’s probably enough just to mark the file as deleted in the db

atan(double a)
          Returns the arc tangent of an angle, in the range of -pi/2 through pi/2.
see i told you its different

JCR uses a traditional JTA mechanism. Should be trivial. Plus, look at Spring modules.

using a transactional file store that participates in the db transaction will be very slow

what can i do abought my error

thanks
good point

in “Math” it would be 0 through 2pi

in bar after 6 beer is 60 feet to pi

maybe the healthiest would be to mark entities as deleted, however delete them physically only on a scheduled basis

if not sooner

that’s the easiest way if no other system depends on the presence of the file

Could anyone have a look at this code, and let me know if the reasoning behind suppressing the type warnings is correct? http://pastebin.stonekeep.com/684

yeah I think so. Thanks!

The idea of the class is to store a mapping from classes to Lists of those classes, in a type safe way

anyone here using aspectj? I’m not sure what the warning “Aspect not applied for aspect X”, everything seems to be okay afaik

Yeah, looks ok-ish.

or “advice defined in X has not been applied”

Do you think it’s a weird way of doing it? I steer clear of stuff like that normally, but in this case I think it makes sense

Can’t think of any better way for now, no.

ok i figured it out…..
double theta = Math.atan2(-(y2-y1),x2-x1)+Math.PI;

cool thanks

Tzzzz, what’s that for a crap formula?

I like to sort the items of a set, but without loosing my equal-method of the items. the javadoc of the SortedSet says, that the Comparator and the equal-method must be consistent.
what if I like to sort my items by name and my equals method checks the id?

why if I have an Integer that is null, and I set it to an int.. does a NullPointerException get thrown
that is not intuitive at all

What if you comparator checks name and then id?

sure it is.

integer is immutable you can not set it

Got a test case?

you can only set a reference to point to another integer

oh, you’re assigning the Integer value to an int? (“set it to” has never been a very unambiguous phrase to me…)

Hi all

Integer i = null; int j = i; //that’s what you did, and it produced an NPE
What did you expect it to do?

wonder of wonders

vulture I have no test case, but this is what is happening.. I have a method that takes in an ‘int’ and I pass it in an Integer.. sometimes the Integer is null, and then I get a NullPointerExcetion

paulweb515, that was also my first idea, but is that the prefered approach?

ernimril so if I have an Integer and point it to an int, what happens?

how would you convert a null to an int?

Yep – autoboxing (or unboxing) in this case. It’s really quite simple. Integer i = null; int j = i; is the same as Integer i = null; int j = i.intValue();

noob to java here so apologies. I’m having a problem with a jbutton background with an imageIcon attached (png) the icon seems to have a border and I wish to remove it and the button background colors ?

cheeser do what C does.. NULL is just 0

but it’s not.
that would imply that null == new Integer(0) which is clearly false

is the behavior spelled out in Java spec?

Integer holds one more value than int, it can be _unset_/null

yes

vulture oh I see .. your example makes sense then
the NullPointerException gets thrown when it is unboxing it.. i.intValue

Indeed.

okay. thanks all

~pastebin

http://rifers.org/paste

can someone help me running a thread using anonymous inner class

I think its point is that if a.equals(b) == true then compare(a,b) == 0

~tell b0r3d about show us

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

ok found a reference.

I think the problem is that a SortedSet also uses the comparator for equal-check.
…. and I have no idea how the Comparator with name and id should look like…

hello

~tell edico about Welcome.

edico, http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome
edico, a href=”http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome”http://eugeneciurana.com/galereya/view_photo.php?set_albumName=Humor&id=welcome/a

….

i am trying to set up my LAMPS server on ubuntu to run jsp pages in virtualhosts directories. I installed tomcat, mod_jk, and all of the samples run from port 80. But pages like test.jsp do not run in virtualhosts directories. can anyone help me? java 1.6, tomcat version 5.0. ubuntu is feisty fawn

Hm. The interaction between Ubuntu and Swing LAFs seems weird.

has anyone here heard of java OS (JX)?

yes.

are there any major projects that are based on it?
other major projects
with similar methodology but more far-reaching goals
it sounds interesting to me, but I haven’t read the design docs yet so I am unsure of the specific details other than what is posted to the main site
sounds interesting though

I’m looking for an example of using remote method invocation for Acegi and Spring… Do you happen to some useful sources?
I’m looking for an example of using remote method invocation for Acegi and Spring… Do you happen to some useful sources?

at least

I wrote one, shipped it, sold, it, etc. before JavaOS was final

google says there is two kinds of JavaOS
one with a small footprint (1-2Mb ram , 1-2Mb rom)
and then Sun’s
which is legacy

How do I organize class files in a good structure? I can’t them to work when I move them to other folders.

classes are traditionally in revers package name order.
that’s how the classloader finds htem.

~tell hacker_112 about packages

hacker_112, packages is http://java.sun.com/tutorial/java/interpack/packages.html and some example http://javafaq.mine.nu/lookup?254

class com.doofus.java.BoneHead is in src/com/doofus/java/BoneHead.java and then compiled to {whatever}com/doofus/java/BoneHead.class

NICE!

how to display repeated region in jsp?

Hmm… I tried to use “package LivingBeing;” for a file that I had in the subfolder LivingBeing and then import that one as LivingBeing.*; But the problem is that I I extend the class with a class called Base.java what is in the main folder…

repeated region??

If I compile a class in Linux. How can I call it just by it’s call name and not by `java classname`?

linux used to support running .class file like that.
it got removed, iirc.
just write a script

glasscasket, what about creating a .bat file ?

You mean like a bash script that?

yeah

can’t you just associate the .class files to java ?

sort of.
it’s not that simple, though.
you have classpaths and working dirs to worry about.

Alright, sounds good. Thanks!
Also, if my class accepts switches (i.e. `classname -a -b -c`), is there a special way to parse it?

commons-cli

they will be in the args array of your main method

HttpServlet cannot be resolved to type…. and any idea ? =/

Nice

sure. add a servlet jar to your project

cheeser, where can i get it ? and why when i do the same process on Netbeans it works fine ? =/

netbeans has the servlet jar availabel to your project, your runtime environment doesnt.
~tell getBoa about classpath

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

get it from your servlet container and I don’t know. it’s likely that netbeans has that jar in its classpath already.

eidolon, cheeser alright… thanks

Hello! Anyone here know anything about TM4J?

~anyone

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.

the dental condition?

Okay then. (Topic Maps for Java.) I need to read an XTM file from a jarfile, and I’d like to do it without having to extract the thing, but the Locator interface is confusing me.

No, the boys band.

have you tried getResourceAsStream? afaik, files in the jar file are on the classpath, gras can open any file within the classpath structure

I’ll look into that. Thanks eidolon!

i’m not even sure if i’m right

Yes, getResource* methods in Class and ClassLoader will correctly load files within jars or other classpath-ian locations (filesystems, other url sources, etc.. – whatever the classpath happens to be)

and ServletContext.getResource* may be useful on occassion as well…

*nods*

hello
I have a question about url encoding…

dbname.mysql’ and life is good.

some do dumps, but of course that is the bad route, you may get truly bad files. If you are serious you use rman
bsome do dumps, but of course that is the bad route, you may get truly bad files. If you are serious you use rman/b
(or any of the commercial alternatives that build on rman)

….&name=test%20one how do I convert %20 back to space when I get the parameter from url?

when i’m reading 0xFF from a stream of bytes, it’s getting stored as -1 rather than 255. i know bytes are signed, so this makes sense. but how can i store it as a signed int instead?

oh right, I was supposed to send you e-mail
though I’m not really sure if the problem is just a broken compiler toolchain, since the debian binary seems to work, but even the same sources when compiled on my machine fail with the internal JVM error I pasted yesterday

odd…
what version of gcc?

gcc (GCC) 4.1.3 20070629 (prerelease) (Debian 4.1.2-13)

I have a sligtly more modern (gutsy version) on this machine…

I’m not really sure if the problem would be gcc anyway – fakeroot has problems on the machine too, or perhaps ld.so – fakeroot gpg fails because the fakeroot library cannot be preloaded for some reason

anyway, did you find your memory problem?

yes, but that was last week already – before you told me about the debian package

good

it was a bit hard, though – I wish Java had some hooks in the emmory allocator to allow breaking when a single huge allocation occurs
now I had to basically step through code and print allocation statistics every now and then, narrowing it down until I found the culprit

it is not big allocations that kill you, it is keeping references around that kills you

in this case it was teh big allocation though – in the sense that the reference was supposed to be kept around, but the allocation wasn’t supposed to be big
there were two big allocations that ate all the 512 MB heap I had given to JVM and caused OOM before I could dump heap or do anything else profitable for tracing them down easily

hmm, why did you need soo big allocations? video handling?

I didn’t, it was a bug in my path simplifier – it uses a fudge factor to guess a suitable allocation size for the simplified path, and the factor blew out of hand in certain cases that weren’t tested

no tests for edge cases?

for that case, no

does netbeans need more of your pc’s resources than eclipse?

eclipse’s footprint is most felt when it sucks out your soul.

k.
didnt suck out mine yet.

maybe you’re just a soulless bastard.
8^)=

Can has soul?

Maybe
so netbeans doesnt suck it out?

i use IDEA so i dunno.
8^)=

crossplatform? :$

~idea

cheeser, idea is a non-free (as in beer and speech) IDE held in high regard by the ##java community. http://www.intellij.com/idea — check it out

it doesnt eat my pc’s resources as breakfast?

~idea

GhettoJava, idea is a non-free (as in beer and speech) IDE held in high regard by the ##java community. http://www.intellij.com/idea — check it out

yeeaaah, boi!

MickMcMack!

hi there

hi

I have a custom JComponent, where I draw many things with the paintComponent method
now I’d like to add a JTextField into my Component, is that possible somehow?
hi cybereal

yes, but you do not want to do that…

why not?

gremlins will eat your toes

no they won’t
They’ll eat his _BRAIN_

dude, he’s German, where do you think he keeps his brain?

I’m Austrian, not German.

oh my mistake, the goblin will eat your ankles!
I keed I keed

~tell cybereal about brains.

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

Can I create myself something like that ?
seems to be a hard work…

you know… you seem rather late to the whole lolcats game

~tell cybereal about question.

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

FAIL!
That monkey reminds me of the kids they show from ethiopia that look like they just had their candy stolen by sally struthers

I told you, that’s a form of abuse! So how’s it going?
You probably want to use an actual JTextfield, with a layout to put it in the right place

goki I have many things to paint, not only the textfield…

~pastebin

http://rifers.org/paste

Oh, hai.
u dont like my lolcatz?

You can has cheeseburger

LMFAO

~pastebin

http://rifers.org/paste

http://worsethanfailure.com/Articles/Really,-Really-Custom-Software.aspx
Look at the company name!
lolcat++

Have you ever seen what we call an “application”? They have lots of things painted, like buttons and text fields and lists, and they use individual components instead of everything glued together in one

to which company name on that page do you refer?

If you saw Office Space you’d get it.

oh..I got that, but its very come for worsethanfailure to make that reference as part of their anon. routines
I was’t sure if there was something else I was missing

hmm, I wonder if there’s a solution for mysql to replicate to pgsql…

does ibatis have annotation sqlmap support yet? anyone happen to know? I saw some vague results on google

sunnypies, are you still online?

hellO!
!pastebin
~pastebin

http://eugeneciurana.com/pastebin

http://worsethanfailure.com/Articles/I-am-errord!!.aspx

does anyone know of a way to allow a Java process to bind to a port 1024 on OSX/linux without running as root?
or some platform-neutral way to prompt for credentials so that process can run as root?

the kernel is what is preventing you from doing it. you can’t get around that.

david_koontz, you have to write wrappers for specific operating systems. ( services for windows, linux, mac-os, whatever )

Hello, if is this a sound method of cleaning up an arror of any size/dimension? http://eugeneciurana.com/pastebin/pastebin.php?show=3876 please tell me what you think.
Hello, can anyone please tell me if valid way to cleanup an array of n-dimension ? http://eugeneciurana.com/pastebin/pastebin.php?show=3876 please tell me what you think.

Just null the reference to the whole array, or let it move out of scope, and the GC will do the rest for you

yar, there’s no advantage to setting each element to null
keep in mind it’s all references, and once no references are left to an object, it is eventually going to get GC’d

reminds me of a nice MIT video
hmm lets see if it’s still here…
~pointer

I guess the factoid ‘nullpointerexception’ might be appropriate:
g[r]eek, nullpointerexception is There are many ways these can pop up, all of which are documented at http://tmorris.net/pubs/npe/ a common problem is the lack of distinction between an object and a reference – it is references that may be null, never objects.

~reference

I guess the factoid ‘references are pointers’ might be appropriate:
g[r]eek, references are pointers is http://java.sun.com/docs/books/jls/third_edition/html/typesValues.html#106237

well, actually, Some cases it could be array of String, primitives or Class

you are right… maybe I can do this…

i plan to use instanceof to check if it’s instance of Class and then invoke the classes cleanup method.

irrelevant

yup, it can be an array of anything, you just get rid of the reference to the array, and it will all be fine

so?

you would need something like you have in C, but not in Java

what goki said

well, in C when using malloc etc.

there’s no real need for “destructor” type methods in java

goki ok, but if it is of type ResourceClass then then i’ll step through it and invoke cleanup() on each ResourceClass

in fact just remove t.cleanup() in that code, the next line t = null; is all you need, that’ll remove t and everything it references including the array

I don’t have to set Images in ResourceClass to null?

0_o

not if you drop references to the instances of ResourceClass

or close Threads?

you only need something like that if you really need to release some kind of underlying resource, like an open file, or some kind of hardware

when the last thing holding a reference to an object drops it that object can be GC’d

I usually close threads with Thread.join() method

http://img406.imageshack.us/img406/2001/0829070920kf1.jpg illinois tollway rest area

ok, got it.
thanks.

threads are another matter

there’s no such thing as “closing” a thread, join just waits for the thread to terminate, which happens for reasons other than calling “join()”

haha

if you are concerned with what happens when an object is about to be garbage collected, see Object’s finalize() method

although AFAIK you can’t rely on that

indeed

I don’t have finalize method for my java.lang.Object because i’m using Java ME

g[r]eek, i was getting coffee and it just caught my eye.. the inner geek couldnt just walk by

trying to write a generalized “deinitialization” method for objects seems to be a bad approach either way

Alconquian, why do you say that?

do you know about garbage collection in java?

it’s it nice to set all objects to null?

ive seen a similar effect – an airport terminal arrivals/departures screen

you are not setting objects to null. never.

*yawn*

Does J2ME have no finalizers? seems unlikely, even considering how awful J2ME is

Clackwell, I guess I could use a refresher on java gc, can you recommend a url for this?

the only thing you will do by manually nulling references is waste your time, the JVM’s time, and possibly screw up the garbage collector a little

If you use the wireless toolkit it tells you how many garbage collections the VM made..

you are setting pointers to objects to null. doing this explicitly for something, say, a container of pointers, when you null the reference to the container itself, is pointless.
~gc
~ping

man that MIT video on pointers would really help nowhere1
~mit
can’t remember the factoid

The KVM may have a garbage collector, but does not support finalization.

Clackwell, ok, I agree

Clackwell, garbage collection is http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html and http://www-128.ibm.com/developerworks/java/library/j-jtp09275.html?ca=dgr-lnxw07JavaUrbanLegends
pong. Pong. PONG Already! What do you people want?! What will it take to finally get some peace and quiet around here!?!

g[r]eek, it was from stanford

I guess the factoid ‘commons primitives’ might be appropriate:
g[r]eek, commons primitives is http://jakarta.apache.org/commons/primitives/, a library with collections that hold primitives directly

~binky

krustofski, binky is a humorous series of videos that explain pointers in a clear way. They can be found here: http://cslibrary.stanford.edu/104/

ah ok
yes bikey!

wow I didn’t know that

binky even

thanks guys, you got me back on the OOP track again.

~tell nowhere1 about binky

nowhere1, binky is a humorous series of videos that explain pointers in a clear way. They can be found here: http://cslibrary.stanford.edu/104/

~ping

http://www.nataliedee.com/071405/ping.jpg

hrm.

anyone read prachett’s Mort?

weird.

If you choose to write a J2ME app be advised that you have to read the API very carefully as to what its’ doing.

I shall reread JSR 118 specs again to see how KVM is suppose to handle this.
I am having memory leaks in my application and I’m trying to figure out why

that’s ok, I have no intention of using J2ME unless I’m forced to. If Sun can’t be bothered to make a decent embedded Java, I can’t be bothered to use it

Have you ever written embedded software?’

In fact I can’t even work out which version to use, let alone how it works

Oh, it’s nowhere1 that’s writing the app.
oh.

svm_invictvs, no, not in C or C++

Well, J2ME is just like any other embedded development. YOu have to think small, hehe.

bed time. goodnight fellas

svm_invictvs, yes, I know. but problem is I have a full blown application written for J2ME

and?

it’s using Nokia E61/E62 so it’s not small in the least
it’s pretty huge

You also have to be… the ACROMASTER! Then you will understand that really, using the J2ME CLDC + CDC + Personal Java version 1.321 is easy!

svm_invictvs, and the cliente has 1MB of images!
they have complex syncing with their sever

How much space are you limited to?

it’s a nightmare on J2me

symbian has the pinnacle of j2me implementations, I doubt they left out a garbage collector

svm_invictvs, on E61 heap is limited only by memory card size
so I guess I have at least 30MB of heap

at any rate, since you’re targeting nokia devices specifically, why don’t you visit forum nokia and ask the experts?

I’m assuming you’re using proguard.

no heap is not on the memory card

svm_invictvs, oh yes!

it’s in regular ram, you probably have about 20mb max with nothing else running on that device

LacyBeer, if you install app on memory card I think it takes heap from memcard

no that would be 100% retarded

Actually it’s considerably less.
I know the motorola razr has like 1.5 mb of java heap.

this isn’t a razr, it’s a smartphone
it has 64mb of ram

LacyBeer, maybe ou are right.

but most of that is taken by the OS

How much heap do you guys have?
Yeah, and persistant storage…and the VM limits the heap space as well…

The Symbian j2me vm will let you use all remaining system memory for heap
it’s simple to find out, just run javabench

if you /ping javabot does he pong in the channel?
aw…
lol
Wait, that would be bad.

er JBenchmark rather
the memory cards are ridiculously slow, to write 20mb of files it takes seconds, that’s definitely not going to be where the heap goes

LacyBeer, verified it and you are exactly right
LacyBeer, i’m confusing it with RMS

well I’ve worked with the S60 phones in the past…
yeah
RMS will use the memcard

heap is limited by physical memory, and RMS by memcard
LacyBeer, i’m experienceing out of memory errors though.

~rms

what’s RMS?

I guess the factoid ‘jgoodies forms’ might be appropriate:
The JGoodies Forms framework helps you lay out and implement elegant Swing panels quickly and consistently. It has been designed to make simple things easy and the hard stuff possible, the good design easy and the bad difficult: http://www.jgoodies.com/freeware/forms/index.html

richard m. stallman

record management system, it’s a J2ME thing

I tracked down one bug, I didn’t cal Timer.cancel() I think.

you don’ access files, you access blocks of data, in a kind of table
you can have OOME even with a gc if you are allocating/deallocating often

LacyBeer, i am doing that alot

why is it that mobile devices always throw out the proper file system?

most gc don’t clear out unreferenced objects immediately because it kills performance

I can’t keep all of the images open at once because there are 1MB of them

how is that? won’t the gc kick in it short on memory and clean up what it can?

security
and many J2ME devices don’t have filesystems at all

kick in if short on memory, rather

it will eventually but you might try to access memory before it gc’s and it’ll give you that error

goki that is the past, most J2me has file systems now.

then you try again later and it works

especially midp2 and 3

do you really need all images open all at once?

what does “try to access memory” mean?=

and yes, most newer j2me impls have an extension for accessing the filesystems

the user wont be viewing all images at once

try to instantiate a class or provision an array?

DCTW, no! and I don’t open them all at ionec either!

It’s funny, I’ve written plain C for OS-less MCU systems, and it’s been easier than working out how to use J2ME

just that I’m creating and nulling lots of images

all that comes down to allocating memory. the logic should be “if no more memory, garbage collect”, surely?

that’s because J2ME is a failed attempt at compile once run anywhere

you’re not nulling the image, only the reference to it… you can’t control how long it’s loaded

but it’s not

screen is 320×240 images,

(you have a degree of control, but it’s not guaranteed)

and their are 10 different screens

because if you hit the ceiling then it can kill performance for the rest of the system, not all vm’s have the same priorities

if it really is not i am sure there is a reason for that, but right away that seems counter intuitive to me.

then widgets lots of widgets on each screen each with it’s own images

Java compiled for mobile devices would probably be fine, especially if they kept it up to date with “real” java
they would need a few compilers, but not that many, most good stuff seems to be ARM now

keep in mind this is a phone, and must maintain cpu time and memory for essential phone operations (like you know, maintaining that phone call)

This memleak is driving me crazy

huh? if my process bumps into its own self assigned memory usage limit why should it not try to clean up memory in that case?

it will, that’s why you catch the error and try again later

LacyBeer, think it’s because i’m opening /closing so many different objects?
open/classing == allocating/deallocating

probably, one common strategy is to try and allocation the memory needed ahead of time so it stays static

ah, sure, but…it is up to the phone to do proper preemptive multitasking, isn’t it?

I didn’t design it
I’ve only read the reasoning behind the behaviors

pooling instances can work pretty well, although the need for it depends on the quality of the GC

LacyBeer, then you are saying preallocate all 1MB of iamges int memory at once?

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

Comments are closed.