@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3



Comments:

<0> which means you'd need the two of them - the first to swollow up the carriage return, the 2nd for the actual input
<1> you're right
<1> I just took out the "Line" from the command, commented one of them out and it's working.
<1> Thanks.
<1> I have a try/catch block to catch errors when a user input tries to store a non int into my int variable, which works as it should. I then have a while loop to compare variable "input" and loop around if it's less than 1920 or greater than 2006, which also works, but inside that loop I have a copy of the first try/catch block, in case a non int gets entered again and it's not being executed. I just get an infinite loop.
<1> Is there something I need to unset after an exception gets caught?
<2> paste your code in a paste bin
<2> but it sounds like you're catching the error but continuing the loop
<3> i have this huge exam tomorrow
<3> and im sick
<3> i need help guys
<3> its an easy subject
<3> can anyone try to teach me
<1> I'm trying to use input = scannerInput.nextInt(); with skip to skip a pattern of [^0-9] but I don't know how to write this and everything I try gives an error. sun's doc site doesn't explain clearly enough how to use this, can anyone help?
<4> perhaps do it yourself, reading line by line.



<1> well what I'm trying to do is make scanner ignore non ints, no idea if this will work, but I can't even find out how to write the line to try it.
<1> grr, having major problems.
<1> I have a try/catch which is catching exception errors when a user inputs a non int, when the scanner's storing the value into an int variable, that works. But inside the following while loop, which loops until my input is over 1920 and under 2006, I have another try/catch which does the same thing and it's giving me an infinite loop, it's ignoring the second input prompt line.
<4> i'd rather do it myself, but alright. never used scanner.
<1> I've tried setting my variable to zero, but it keeps catching the exception.
<1> I've tried closing my scanner so I can reopen it and after that is a pause method which waits for me to press a key, I get to that prompt, it prints "press a key" but no prompt comes up and java crashes. Even though my scanner got closed before pause, so I'd expect java to crash before the "press a key" prompt.
<1> going by that it appears everything inside a try block is predetermined, so I can't change a variable inside it, is that correct? I know a variable set in a if statement dies when the if statement is finished.
<1> I can't even think straight anymore, spent almost 2 hours trying to find how to fix this. I've tried so many things.
<1> Finally fixed it.
<5> does anyone know how to get the WDK network monitor working properly?
<6> mornin all
<6> i'm having some "building" trouble with websphere RAD .. anybody familiar with the tool?
<6> I have a group of web modules under an enterprise application, then i have a standalone general java appliation, and I want rad to automatically compile that general java app into the EAR file when it compiles.. can't seem to find a way to do that
<6> it works to manually make a jar file of that standalone, include it into the enterprise app, but they're both under development, and to do any minor test i'd have to rebuild the jar every time .. must be a better wya
<6> *way
<7> wtf.. I'm getting LF in xml attribute values mangled to SPACE
<8> hello. Is it possible to create just a private key to use for digital enveloopes?
<8> a descartable key
<9> NeB{wRk}: did you go to the properties of that ear/java build path and import that external jar?(at least that's how you do it in wsad)
<6> yes, importing the jar works, but the jar is under development too, so i just wanted the external project to be in the build path without having to jar it
<9> ah i see dunno :/
<6> i go to the web module properties, add my "externalProject" into what it calls the build path, and add the "externalProject" as a Project Reference, but neither help, when i test it i get cl***NotFoundExceptions
<6> if i jar it up, add it as a library file, then it works.. *scratch head*
<9> in wsad that is a project *reference* but i've never tried it
<9> and it probably wouldn't rebuild the other project is my guess based on your experience :Z
<9> i'm sure you could write an ant script to do it tho
<6> ya, i'll have to go about it like that somehow .. seems like it should work if it is on the build path, but i dont know if its a bug or a "feature" lol
<10> hi. I have an java application. I want it to run only in one instance. Is there a way to this without using files or environment variable ?? cause this application may not close properly.
<11> where can i ask related security questions?
<10> ( ?? )
<9> SweD jar it?
<11> how do i obtain a random private key to be used in a digital envelope?
<11> in java of course :)
<10> sabre> "java -jar prog && java -jar prog" will not run two instances ?
<10> oki... il will try this
<10> (anyone knws a french java channel?)
<9> java -jar prog will run one instance...what you just typed will start 2 i ***ume
<10> sabre> so... its not what i want
<9> ok so just run one :)
<10> :(
<9> lol sorry SweD...communication barrier
<10> i understand very well
<9> yes but i'm afriad i don't understand what you are trying to ask
<10> sabre> its really easy. I have a GUI wich run in taskBar (trayIcon). If the user clic a second time on the desktop icon, i want the application to maximize and not to start again
<10> because i will have 2 running
<9> it should do that by default
<10> oh... no
<9> ohhh
<12> SweD: there may be a better solution, but you might consider creating a lock file when you start the application the first time. Just have the file marked as deleteOnExit so it will be removed when the application terminates.
<10> Resonator> this application may not terminate properly
<9> yeah or just add a check in the program in your main method to check if it's running
<10> sabre> how can i check a program is running ?
<12> SweD: deleteOnExit is something that will be hooked into the VM - unless the VM is shut down forcefully, the lock file should get cleaned up.
<9> Resonator's idea sounds better
<12> Er not hooked into the VM, but it depends on graceful exit by the Java VM, not your application.
<10> Resonator> but if the power alimentation is down... it will not be deleted, and the application will not start nomore
<12> SweD: that's true.. but there's not going to be an easy way to determine if the app is running if you are starting two Java VM instances when executing it.
<12> You might want to present a warning about the lock file existing when the user tries to start the app.
<10> yes i see
<12> Unfortunately communication between two running VM's isn't something you'll be able to do in Java. That's something that would be platform-specific, and Java is meant to be platform independent...
<10> ok ok



<10> thanks
<12> No problem... like I said, there may be a better way, but that's all I can think of off the top of my head.
<12> I know that "maximizing" the application when trying to run another instance isn't going to be possible.. at least there's no way that I can think of to do that.
<7> Tasuki?
<9> oh it's possible but it won't be fun
<12> wlfshmn: in the virtual flesh :)
<12> wlfshmn: long time no see
<7> Long time no see, or have I just been ignoring you forever?
<7> ;)
<12> I haven't been on IRC in a long, long time.. just got back online a few weeks ago.
<7> a bit scary that one actually remembers nicks, and alternate nicks..
<12> haha :) I think my username was always "resonator" even though my nick was Tasuki at the time.
<12> I'm not sure that that's scary - just a sign of a good memory!
<7> I think so too, or I wouldn't have made the connection
<7> do stop by the other place, I suspect there might be one or two others that remember you ;)
<12> It's been better than 2 years since I've been on IRC - pretty wild to still see some familiar faces around!
<7> Resonator: I dunno about wild. It just means some of us have no life to speak of ;)
<9> SweD my guess is you'll have to use JNI and write some native code there bud
<9> you guys are so well behaved in here :)
<12> wlfshmn: eh, tried that, didn't care for the general feel of the channel.
<7> Resonator: hupp, ok
<12> The elitism and the way they treat everyone like an idiot kind of bugs me - I guess I've mellowed out too much :P
<7> I think we have all, to a man, turned cynical ;)
<7> we area bunch of grumpy old men in our mid-20s ;)
<12> lol
<12> Eh I'll poke in there and see what's going on. Maybe I just chose a bad time to check it out.
<13> Hi! Is it posible to create two or more diferent Graphics objects witch I can paint on diferent locations?
<9> that "chan" is the armpit of undernet
<9> although i will say the "other" chan is not any better :Z
<10> Resonator> sabre> look that. A strange solution to my problem... Just do that : "java.net.ServerSocket ss = new java.net.ServerSocket(PORT);" . if there is a bindException, app is already running. Even if I don't need a socket...
<12> Oh yeah, that's a pretty good idea :P
<9> thanks for the tip!
<10> thanks :)
<14> hi everyone
<14> i got a huge problem with DocumentBuilderFactory.newInstance()
<14> it's eating all my memory, it seems it doesn't release the documents after parsing them
<14> is there a trick to release the memory? im using java 1.4
<14> i tried this
<14> Document doc = docBuilder.parse(in); doc=null;
<14> still same thing
<14> any ideas?
<9> Creative1: start the app with a RAM limit? but i think you got a bigger issue here
<9> maybe have a loook at JRAt http://jrat.sourceforge.net/
<14> it seems a memory leak in the builderfactory
<9> i doubt that
<14> when i read the file once, it takes that space
<14> i read it 100 times in a loop
<14> it increments exactly 100 times
<14> i ran jprofiler on it, all the memory is taken by the document builder parse method
<14> and it won't release it
<12> Creative1: you may want to explicitly have the VM do garbage collection.
<9> that most likely will not work
<14> resonator, i did, i use jprofiler
<12> As long as you aren't holding any references to the objects created by the parser, that should free up the memory, but it's not guaranteed.
<12> Oh hm.. I've no idea then.
<9> Creative1 have you put this in the debugger?
<14> i'm checking the xalan-java site and i see they fixed several memory leaks
<14> but i don't know if it's this one
<14> sabre, yes
<9> and i ***ume it is not reaching breakpoints at all?
<9> past this method?
<14> yeah, eclipse won't go inside the parse method
<9> yes but i mean right after that method
<14> after parse? yes it can go there
<9> then why do you think it is the parse method?
<4> Creative1: you can re-post the initial problem description?
<14> sorry i was trying to debug
<14> it's using gnujax.jar file as a library


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #java
or
Go to some related logs:

#AllNiteCafe
hh2g quotes
#linux
maldives thebalaabodu
#chatzone
maltese sorm
#linux
#asm
#linuxhelp
#MissKitten



Home  |  disclaimer  |  contact  |  submit quotes