comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * How 'java' (command) handles the classname passed - 5 messages, 5 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/908d4e10411ee318 * object problem? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1bd7ea0d3b158f73 * UML class diagram generator - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8241734de4805c3 * Split with regular expressions - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2c7dcc86f463c843 * Showing a new frame - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4617f0d7eec8e506 * A question of reading api document - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1c6d046830d875c * how to cast a primitive type 'long' to byte[8] - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b17527882b80175 * I found this great little site. - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f6d9842f82b50028 * Environment variable - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e10a85f420f52962 * Writing to Word documents - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/63e6214e752428a * Paid software approach - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ef2d9f2620cccdfe * newLine in <applet>'s <param> tag - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1d6211b531fb4f45 * Anyone know of a good JSP Java host to test new shopping cart application? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b82d367b68b7f7bd * operators - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79153676aedd1545 * clarification about login logic in a Webapp using Struts - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6107ee79d477edec * different versions of the same library - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1005ef562ebe3630 * Searching a pattern - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a13808905eeda1a7 * File upload - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c7508deb2afd0a5 * Memory Augmentation Device ( MAD ) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/af4ef09097ca0047 * Complete Java 2 Certification Study Guide by Philip Heller, Simon Roberts - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23f360949f0bf362 * references and a binary tree - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d897505b2c28f461 ========================================================================== TOPIC: How 'java' (command) handles the classname passed http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/908d4e10411ee318 ========================================================================== == 1 of 5 == Date: Sun, Nov 21 2004 8:15 am From: "KiLVaiDeN" <[EMAIL PROTECTED]> "kris" wrote > Does the 'java' work this way: when we give "java classname", 'java' > strictly would search for classname.class and proceeds thereafter, The JVM(Java Virtual Machine) searches in the classpath folders a file name "classname.class" when you call the command "java classname". Calling "java classname.class" would make the JVM search for a file called "classname.class.class" in all the folders of your classpath, therefor leading to an error. K == 2 of 5 == Date: Sun, Nov 21 2004 9:13 am From: Angus Parvis <[EMAIL PROTECTED]> kris wrote: > Hi, > > After compiling the .java file, the .class is passed to 'java' > and that runs the program. > Does the 'java' work this way: when we give "java classname", 'java' > strictly would search for classname.class and proceeds thereafter, > The reason i got this doubt is when i gave a command "java > classname.class" an error was raised pointing no class definition. > > Thanks for your time. > > Krishna. even if it was like you say, strictly searching for "given classname".class would result in "classname.class.class", so no wonder that the vm couldn't find it. == 3 of 5 == Date: Sun, Nov 21 2004 10:01 am From: Chris Smith <[EMAIL PROTECTED]> KiLVaiDeN <[EMAIL PROTECTED]> wrote: > The JVM(Java Virtual Machine) searches in the classpath folders a file name > "classname.class" when you call the command "java classname". > Calling "java classname.class" would make the JVM search for a file called > "classname.class.class" in all the folders of your classpath, therefor > leading to an error. I'm in picky mode today. It would look for "classname/class.class", actually, where '/' is actually the platform-dependent file separator. In the fully qualified class called "classname.class", the "classname" piece is the package, and "class" is the simple name. Packages are represented as directories by the system classloader. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation == 4 of 5 == Date: Sun, Nov 21 2004 11:22 am From: "Mike Schilling" <[EMAIL PROTECTED]> "Chris Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > KiLVaiDeN <[EMAIL PROTECTED]> wrote: >> The JVM(Java Virtual Machine) searches in the classpath folders a file >> name >> "classname.class" when you call the command "java classname". >> Calling "java classname.class" would make the JVM search for a file >> called >> "classname.class.class" in all the folders of your classpath, therefor >> leading to an error. > > I'm in picky mode today. It would look for "classname/class.class", > actually, where '/' is actually the platform-dependent file separator. > In the fully qualified class called "classname.class", the "classname" > piece is the package, and "class" is the simple name. Packages are > represented as directories by the system classloader. Being even pickier, jar files can exist in the system classloader as well; they will also be searched Being pickier still, I don;t know of any JVM restriction that limits it to files and jars; a JVM implementation could (as far as I know) also search databases or other sorts of repositories. == 5 of 5 == Date: Sun, Nov 21 2004 11:15 am From: Oscar kind <[EMAIL PROTECTED]> kris <[EMAIL PROTECTED]> wrote: > Does the 'java' work this way: when we give "java classname", 'java' > strictly would search for classname.class and proceeds thereafter, > The reason i got this doubt is when i gave a command "java > classname.class" an error was raised pointing no class definition. Approximately. The JVM (started with the java command) searches for the named class in the classpath. Thus: - if the class name is "MainClass", the JVM searches for "MainClass.class" in each classpath entry (directory or the root of a jar file). - if the class name is "some.package.MainClass", the JVM searches for "MainClass.class" in the directory "some/package" in each classpath entry (directory or the root of a jar file). -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: object problem? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1bd7ea0d3b158f73 ========================================================================== == 1 of 2 == Date: Sun, Nov 21 2004 8:19 am From: Chris Smith <[EMAIL PROTECTED]> KiLVaiDeN <[EMAIL PROTECTED]> wrote: > But why would we bother triming messages, using some of our time, while some > people overuse bandwith with 100000x bigger downloads, and 100000x more > useless things ? I'l jump in and perhaps explain. Bandwidth isn't really the issue any longer -- maybe it used to be, fifteen years ago when most netiquette descriptions were written. Even on a modem, the time required to download a signature is a tiny fraction of a second. The issue is that people should be removing *everything* except enough of the previous post to provide some context on what they write. You are, in fact, quite welcome to leave a signature in the reply if you're replying to the signature. Cutting out irrelevant content, though, makes the groups easier to read for everyone. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation == 2 of 2 == Date: Sun, Nov 21 2004 8:50 am From: "nick" <[EMAIL PROTECTED]> when i change the contents of currentPlayer,will temp also change? because when i change currentPlayer contents, i dont want to affect temp any more thanks! "Joona I Palaste" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D:[EMAIL PROTECTED] > nick <[EMAIL PROTECTED]> scribbled the following: >> Player temp; >> temp=currentPlayer; >> currentPlayer=nextPlayer; >> nextPlayer=temp; >> >> temp=currentPlayer; > >> is temp become a reference address of currentPlayer in there? > > When the second line has been executed, yes, both variables temp and > currentPlayer refer to the same object. > >> how to copy a new object to temp? > > Strictly speaking, you can't. Java variables don't hold objects, they > hold references to objects. If you mean "how to make temp refer to a > new object", then that is easy: > > temp = new Player(); > > or whatever constructor you wish to use. > > -- > /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ > \-------------------------------------------------------- rules! --------/ > "Make money fast! Don't feed it!" > - Anon ========================================================================== TOPIC: UML class diagram generator http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8241734de4805c3 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 8:30 am From: "VisionSet" <[EMAIL PROTECTED]> "KiLVaiDeN" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Brzezi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Hi. > > > > Could you recommend mi any program, which generates UML class diagrams > > Objectering, which is free in personnal use. > But doesn't do roundtrip in the free edition, which I think is what the OP will require. -- Mike W ========================================================================== TOPIC: Split with regular expressions http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2c7dcc86f463c843 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 8:35 am From: "Adam P. Jenkins" <[EMAIL PROTECTED]> patrik wrote: > Hi everybody... > > I have a question concerning regular expressions: > i have the following example string including quotas: > > "bbbb cccc" "dddd eeee" "ffff" > > i want to split the string with the "split(String regex) String[]" > method and want to get the following result array: > > ["bbbb cccc", "dddd eeee", "ffff"] > > so i want to be the blank as separator except the blank is within an > opened and closed quota. Is this possible to do with a regular > expression, and if so - how does this regex look like ?! It is possible, though from the example of the desired result you showed, it looks like you also want to strip the quotes themselves. If that is the case, you can just write String s = "\"bbbb cccc\" \"dddd eeee\" \"ffff\""; String[] result = s.split("\"\\s+\""); This will give you the result you showed above. If you really just want to match space, but only if it's surrounded by quotes, then you can use the zero-width lookahead and lookbehind constructs, documented in the java.util.regex.Pattern Javadocs. The pattern would look like (?=")\s+(?<=") Used in the split function: String[] result = s.split("(?=\")\\s+(?<=\")"); In this case the strings in result will contain the quotes. ========================================================================== TOPIC: Showing a new frame http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4617f0d7eec8e506 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 8:59 am From: "Ann" <[EMAIL PROTECTED]> "Franco Fellico'" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi. > > I am creating my first Java program (with Jbuilder 7) and clicking a > PushButton I would like to open a new Form (modal or modeless) and > then close it. What is the code to do that? > > Thank you from Franco Hint: "new JFrame ... " or "new JDialog..." ========================================================================== TOPIC: A question of reading api document http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1c6d046830d875c ========================================================================== == 1 of 3 == Date: Sun, Nov 21 2004 9:06 am From: "Ann" <[EMAIL PROTECTED]> "Davide" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > mike wrote: > > regards: > > > > When I read the api of some opensource > > > > Classes > > XXX.YYY > > -------------------------- > > What is the relation between YYY and XXX? > > > > Is YYY XXX's inner class? > > > > --------------------------- > > Thank you. > > May god be with you. > > Hi Mike. > Perhaps I may be wrong... > > could be XXX a class in YYY package? > > For example, you could have ZZZ.XXX.YYY, this may be java.util.Vector: > java is the external package, util is the inner package ad Vector a > class in java.util package. I never heard of "external package" and "inner package", what are they? I searched the SUN Java Tutorial for them and nothing is found. == 2 of 3 == Date: Sun, Nov 21 2004 11:03 am From: "KiLVaiDeN" <[EMAIL PROTECTED]> "Ann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Davide" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > mike wrote: > > > regards: > > > > > > When I read the api of some opensource > > > > > > Classes > > > XXX.YYY > > > -------------------------- > > > What is the relation between YYY and XXX? > > > > > > Is YYY XXX's inner class? > > > > > > --------------------------- > > > Thank you. > > > May god be with you. > > > > Hi Mike. > > Perhaps I may be wrong... > > > > could be XXX a class in YYY package? > > > > For example, you could have ZZZ.XXX.YYY, this may be java.util.Vector: > > java is the external package, util is the inner package ad Vector a > > class in java.util package. > > I never heard of "external package" and "inner package", what > are they? I searched the SUN Java Tutorial for them and nothing > is found. > > There is no real hierarchy in the packages, but since they are handled like folders you could say "external package" is the higher folder, and "inner package" would be the subfolders. They could also be handled differently, like this instead of java util lang having something like java.util java.lang K == 3 of 3 == Date: Sun, Nov 21 2004 11:23 am From: Davide <[EMAIL PROTECTED]> KiLVaiDeN wrote: > There is no real hierarchy in the packages, but since they are handled like > folders you could say "external package" is the higher folder, and "inner > package" would be the subfolders. > They could also be handled differently, like this > > instead of > java > util > lang > > having something like > java.util > java.lang Right, you expressed what I had in my mind :) Anyway, if Mike posts actual names, a more precise response could be given. Bye, Davide ========================================================================== TOPIC: how to cast a primitive type 'long' to byte[8] http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b17527882b80175 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 9:18 am From: Daniel Sjöblom <[EMAIL PROTECTED]> xarax wrote: > "Ferenc Hechler" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>I don't think it can be done by a simple cast, >>because the byte represantation of a long is system >>dependant (little-endian, big-endian). > > Totally wrong on the Endian thing. Java is > ALWAYS big endian. Not true. The java platform is endian agnostic. It is true that for example the class file format uses big endian representation of data, but this is simply because you can't have a portable transmission format if you don't specify endianess. Beyond that, the JVM is free to use whatever endianess the target platform uses. I can guarantee you that on an x86 and any reasonable JVM, an int is little endian. -- Daniel Sjöblom Remove _NOSPAM to reply by mail ========================================================================== TOPIC: I found this great little site. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f6d9842f82b50028 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 9:22 am From: Sudsy <[EMAIL PROTECTED]> I found this great little site. wrote: > I found this great little site. I signed up two weeks ago and got 2 > Disney tickets and this week they are sending me 2 Universal Studios > tickets. Here's the link <http://66.219.102.40>and by the way I am a > real person, this is my real email address. I'm not a spammer and didn't > appreciate the nasty email I got last time I tried to post this link. > Thanks, Lisa How can they afford to give you two tickets to Universal Studios when they can't even shell out the US$10 to register a domain?! No wonder you got nasty replies the last time you posted this tripe. -- Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development. ========================================================================== TOPIC: Environment variable http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e10a85f420f52962 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:10 am From: "Glynne" <[EMAIL PROTECTED]> "Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Glynne wrote: > >>>or is it "forbidden" to use environment vars in java? > >> > >>It is stringly discouraged, since it's not portable. Some systems don't > >>have environment variables at all (such as pre-X MacOS), and they don't > >>behave the same on all systems that do. > > > > > > > > By the same logic, some systems don't have a GUI, so why don't we deprecate > > Swing and the AWT? > > Because they cannot be emulated by something more portable. There's nothing > you can do with environment variables that can't be done with system properties, > with less potential for incompatibilities or other problems. > > Yes, but if I NEED to interrogate the environment variables, I should not find the language standing in my way. If 90% of Java programmers don't need env vars, that's great, but don't deny the other 10% of us access to them. Otherwise we'll have to keep C/C++ around to write our "real" apps. The fact that this functionality was originally present, then it was deprecated, then it was un-deprecated.... and the fact that it's occassionally debated in the newsgroups would seem to indicate that it is a useful feature, at least for a subset of Java programmers. ========================================================================== TOPIC: Writing to Word documents http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/63e6214e752428a ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:38 am From: Edwin van der Sanden <[EMAIL PROTECTED]> On 14 Nov 2004 15:14:53 -0800, [EMAIL PROTECTED] (Jonck van der Kogel) wrote: >Hi everybody, >I have defined a Word template and set bookmarks at certain locations >in this document, to which I then want to write text gotten from a >database and save the file. In this way I could create standard >documents (for example an invoice) in an automated manner. >I have looked into the Jakarta POI project >(http://jakarta.apache.org/poi/index.html), but this project is mostly >aimed at Excel, Word support is still in its infancy. >Another solution that I've found >(http://www.must.de/en/default.html?../Javactpe.htm) seems to work >very well, but is Windows only. >Also there are a few commercial solutions, but these cost several >thousand dollars, which I can't afford. > >I figure such an automated creation of Word documents is probably >being done by a lot of people, so therefore I was wondering, does >anyone know of a (affordable) way to achieve what I described in a >platform independent manner? > >Thanks very much, Jonck you might want to have a look at WordprocessingML : http://rep.oio.dk/Microsoft.com/officeschemas/welcome.htm hth, Edwin. ========================================================================== TOPIC: Paid software approach http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ef2d9f2620cccdfe ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:39 am From: [EMAIL PROTECTED] (Lynn Segal) SoftArtisans.com offers an approach to outputing Word and Excel documents from a .Net or Java server. ========================================================================== TOPIC: newLine in <applet>'s <param> tag http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1d6211b531fb4f45 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:55 am From: [EMAIL PROTECTED] (peter10) Hello Andrew! > Why are you feeding 'newlines' to an applet? > Well the reason is that my applet functions as a text editor. One can save and then reload text to continue editing, and thus all the newlines that one has put in when first editing text have to show up again. > Replace the new-lines with a sequence of characters that > are not going to be in the input text, then split the line > based on those markers and insert new-lines. Thanks! That seems like a workable solution! Peter ========================================================================== TOPIC: Anyone know of a good JSP Java host to test new shopping cart application? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b82d367b68b7f7bd ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 11:01 am From: "emma wykes" <[EMAIL PROTECTED]> Hi All, I am relatively new to JSP / Java beans and have a shopping cart which I have tested on resin at home and wondered if anyone knew of a good host which could help with any initial problems should there be any with my webapp. regards and thanks in advance. Jim Ascroft ========================================================================== TOPIC: operators http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79153676aedd1545 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 11:02 am From: Oscar kind <[EMAIL PROTECTED]> Chris Smith <[EMAIL PROTECTED]> wrote: > <- Chameleon -> <[EMAIL PROTECTED]> wrote: >> I have a class Digit and I want to implement operators + - * / with 2 >> Digits, a Digit and an Integer, a Digit and an int, a Digit and a Double >> etc. >> >> Is this possible? > > Nope, there is no user-defined operator overloading in Java. This is also why these operators are not implemented for the classes java.math.BigInteger and java.math.BigDecimal. You can however, use the same solution as used for those classes: create methods for it. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: clarification about login logic in a Webapp using Struts http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6107ee79d477edec ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:24 am From: Oscar kind <[EMAIL PROTECTED]> Jean Lutrin <[EMAIL PROTECTED]> wrote: > I have a question regarding how things are > named in the following scenario... > <cut: description of 3 tries and then ... login> > > If we're using some kind of MVC framework (self made, or already > made, like Struts -- leaving aside consideration about wether or > not Struts is really an MVC framework etc.), what is the model, > what is the view, what is the controller in the above scenario? > > I think I understand the "view" part, but what about the model > and the controller? First of all, you generally use J2EE security to authenticate a user. If the username/password is correct, it redirects you to the page you originally requested. The view (as you probably guessed) is the HTML page. Yes, that's correct; J2EE form login only needs an HTML form (JSP's are optional). The model and controller are inplemented by the J2EE server. > More specifically, there's some "logic" involved here : after two > wrong login tries, we propose to send the password back by email. > What is this logic related to? Alas, the various authentication frameworks are very restrictive: - They do not provide any information as to what went wrong: you don't know if the password is wrong, if the username doesn't exist, etc. - They do not allow you to specify a "three strikes and you're out/..." scenario: you don't know how many tries the user had. For the "three strikes and you're out/..." scenario however, there is a workaround: - use a cookie to store the number of failed tries, - show a different page if there are three or more failed tries, and - modify all responses of your application to remove the cookie if needed. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: different versions of the same library http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1005ef562ebe3630 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:36 am From: Oscar kind <[EMAIL PROTECTED]> hilz <[EMAIL PROTECTED]> wrote: > [...] just out of curiousity, how would i unload a class? > in other words, if i still want to use the two versions of a library, then i > would use URLClassLoader to load a class from a jar file, > then if i want to use the other version of the class that is in another jar, > how would i unload the first one in order to load the second one? (assuming > i make sure i don't have any instances of that class at the time of > unloading). You don't: instead, you - discard all references to the classloader for the first library (including any objects loaded with it) - create a new classloader for the second library - create objects using that new classloader Note that your starting class doesn't know about this other classloader; the instantiated class (using the created classloaders) does. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: Searching a pattern http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a13808905eeda1a7 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:58 am From: Oscar kind <[EMAIL PROTECTED]> gonas <[EMAIL PROTECTED]> wrote: > How can i search for a pattern in a string. > > ie. if the pattern is "xyz" then the string can be tokenized only when > the pattern "xyz" appears and not for each "x","y","z" > > also the same for multiple patterns like "xyz" and "abc". finding the > string between the two patterns. > > usage of indexOf is very much killing tell me some other ways What is it exactly that you are trying to do? If you're searching for the pattern itself, have a look at the package java.util.regex (especially the classes Pattern and Matcher therein). If you're using the pattern as a delimiter and want to tokenize the string in which it occurs, have a look at java.lang.String#split(String) and java.lang.String#split(String,int). -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: File upload http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3c7508deb2afd0a5 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 10:41 am From: Oscar kind <[EMAIL PROTECTED]> gonas <[EMAIL PROTECTED]> wrote: > How can I upload a file from my client machine to a directory in my > webhosting server using JSP/Servlet. > > provide me a sample code for using com.oreilly.servlet > specify in step by step procedure! Hahahaha! But seriously, Tony is right. On the other hand, if you create some code and explain where you get stuck, you are likely to get a useful reply. Note however, that getting stuck does not mean that you simply don't know where to go from where you are. We expect an honest effort on your part, which means: - Code that tries, but fails, do to what you want. See here on the format: http://www.physci.org/codes/sscce.jsp - Your description of what you expect. - Your description of what you get instead. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: Memory Augmentation Device ( MAD ) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/af4ef09097ca0047 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 11:34 am From: "Peter L." <[EMAIL PROTECTED]> Hello, Memory Augmentation Device ( MAD ) is a Java Web Start application that will help you organize information. MAD might be classified as a PIM ( Personal Information Manager ) but has some unique data navigation capabilities not found in PIMs on the market today. A fully functional, no cost version of MAD is available at: http://PL10004.home.att.net/mad.html For a low $20 registration fee, superuser features such as archiving and keyword management can be activated. I hope you find MAD useful and would be interested in your comments/suggestions. Thanks Peter ========================================================================== TOPIC: Complete Java 2 Certification Study Guide by Philip Heller, Simon Roberts http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/23f360949f0bf362 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 12:00 pm From: [EMAIL PROTECTED] (Leonardo Maranh?o) Someone over here can sand me by email the e book of Philip Heller, Simon Roberts Complete Java 2 Certification Study Guide. I live in Moçambique - Africa and here we dont have access to this books. Thanks Leo ========================================================================== TOPIC: references and a binary tree http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d897505b2c28f461 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 11:54 am From: "Milan Stezka" <[EMAIL PROTECTED]> "Neil Campbell" <[EMAIL PROTECTED]> píse v diskusním príspevku news:[EMAIL PROTECTED] > Milan Stezka wrote: > >> Hello, >> >> I am new to Java. I am filling a binary tree with values using a loop, >> so when I need to descend one node deeper at the end of the loop, I >> use node=node.right for example. Consider this pseudo code: >> >> //... >> while(1) { >> node=new Node(new Leaf(),null); >> node=node.right; >> } > > It looks as though you are creating a node (with new Node(...)), with a > single child (the new Leaf). Then you assign a reference to this child to > node. Next time around the loop, you create another new Node, and assign > a > reference to this to node, thus losing the reference you assigned with > node=node.right. Yes you are absollutely right, I have got it to work now. I was refering to null. I feel embarassed to post such a bad question. > > I'm not entirely certain what you're trying to do; but if you want to add > a > new child node on to the end of the tree, you have to assign it to > node.right (or node.left): > > node.right = new Node(...); > > ...but I'm not sure I've really understood your question. > > Neil > > -- > Neil Campbell > batneil[AT]thebatcave[DOT]org[DOT]uk > http://www.thebatcave.org.uk ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
