comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * A very basic jni question - are values copied? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5b02c5b97b0a872b * BufferedReader Method to Read Next Line?? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/10c43d275881bfe9 * compressing or encrypting a String - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d28e472c042b2e3a * CACAO JavaVM 0.91 released under GPL - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b91aecb616a13f79 * Uploading Files Using MultipartRequest while Parsing Other Params - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8ab3d5be27383e5 * Tree view type applet question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/792860f0cc43027 * Ant question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fa97e66c00da320 * Parsing a Schema to build a JTree - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4522b0f7e93fb2de * Function calls... - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fffeec3e18ff1713 ============================================================================== TOPIC: A very basic jni question - are values copied? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5b02c5b97b0a872b ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 9:54 pm From: "Ann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > When an array is created in the native code and returned to java is it > returned by reference or by copy? > > Sorry for not being able to find the answer to this very basic question > in the standard places. > > > Aaron Fude > Frommy book learnin, all parameters and return values are passed by copy, BUT WAIT THERE'S MORE. If the parameter/ret val is an Object (array is an Object) then what is copied is the reference to the object. So the array is itself not copied, you just get a reference to it; it lives in the heap. Of course I have not tried it myself, I use int and float. ============================================================================== TOPIC: BufferedReader Method to Read Next Line?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/10c43d275881bfe9 ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 1:56 pm From: "Michael Wong" "Krmathieu" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does anybody know what method or code could be used to access the next > line > of the buffer? Basically, what I am trying to do is read in each > individual When working with streams, the current position is the next character that hasn't been read yet... unless you use the mark/reset methods, which allow you to set a mark in the stream and reset the position back to that mark. In your case (BufferedReader), just keep calling the readLine method, it will return the next line of text. If the readLine method returns null, you've reached the end of the stream. ============================================================================== TOPIC: compressing or encrypting a String http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d28e472c042b2e3a ============================================================================== == 1 of 3 == Date: Sat, Dec 25 2004 4:04 pm From: "Wendy S" I'm sorting JPG files into directories based on an IPTC field. I need a way to create a reasonably short directory name based on a longer (up to 64 chars) String. For example, I might have 100 images, each having one of these three IPTC Headlines: Mary Smith | Zorro | Some Event John Brown | Patrick | Some Event Alice Jones | Jack | Some Event I need to generate three short strings that I can use for directory names that will be the same every time a certain String is processed. I do NOT need to be able to decode the original value from the shortened one. I only care that I get the same directory name for the same long string every time I "compress" it. After some searching around, I realized that String.hashCode() does _exactly_ what I'm asking for. However, vanity requires (or at least wishes) that the directory name be a little "prettier" and alphanumeric. Is there anything I can do with an integer like 1263925117 to get something like 4xr52z (and still be reasonably sure I won't get duplicates, even when the second half of all of the Strings is likely to be the same)? Or does anyone know another way to compress the original String into something shorter? (If anyone comes upon this later looking for a Java API to read IPTC or EXIF data from images, look here: http://www.drewnoakes.com/code/exif/ ) Thanks for any ideas, -- Wendy S == 2 of 3 == Date: Sat, Dec 25 2004 5:27 pm From: "Chris" > However, vanity requires (or at least wishes) that the directory name be a > little "prettier" and alphanumeric. Is there anything I can do with an > integer like 1263925117 to get something like 4xr52z (and still be > reasonably sure I won't get duplicates, even when the second half of all of > the Strings is likely to be the same)? String dirName = Integer.toHexString("foo".hashCode()); By encoding the directory name using hex digits instead of decimal digits, the name will never be longer than 8 characters. == 3 of 3 == Date: Sat, Dec 25 2004 6:02 pm From: "Wendy S" "Chris" <[EMAIL PROTECTED]> wrote > String dirName = Integer.toHexString("foo".hashCode()); > By encoding the directory name using hex digits instead of decimal digits, > the name will never be longer than 8 characters. Thank you, that's exactly what I needed. -- Wendy ============================================================================== TOPIC: CACAO JavaVM 0.91 released under GPL http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b91aecb616a13f79 ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 7:39 pm From: [EMAIL PROTECTED] (Andreas Krall) 1 minute, remove. Stir-fry the vegetables. Put the meat back into the wok and adjust the seasoning. De-glaze with sherry, cooking off the alcohol. Add broth (optional) cook a few more minutes. Add the cornstarch, cook a few minutes till thick, then place the stuffing into a colander and cool; 2 hours Wrap the rolls: Place 3 tablespoons of stuffing in the wrap, roll tightly - corner nearest you first, fold 2 side corners in, wrap till remaining corner is left. Brush with egg, seal, and allow to sit on the seal for a few minutes. Fry the rolls: 325° if using egg roll wraps, 350° for spring roll wraps. Deep fry in peanut oil till crispy golden brown, drain on paper towels. Lemon Neonate Turkey serves just as well, and in fact even looks a bit like a well-dressed baby. By the time you turn the child?s breast into cutlets, it will be indistinguishable. The taste of young human, although similar to turkey (and chicken) often can be wildly different depending upon what he or she has consumed during its 10 to 14 months of life... 4 well chosen cutlets (from the breasts of 2 healthy neonates) 2 large lemons (fresh lemons always, if possible) Olive oil Green onions Salt pepper cornstarch neonate stock (chicken, or turkey stock is fine) garlic parsley fresh cracked black pepper Season and sauté the cutlets in olive oil till golden brown, remove. Add the garlic and onions and cook down a b ============================================================================== TOPIC: Uploading Files Using MultipartRequest while Parsing Other Params http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a8ab3d5be27383e5 ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 4:14 pm From: "Ryan Stewart" Ones Self wrote: > Hi, > > I'm using Tomcat 4.1.31 with Velocity 1.4, and I'm trying to upload a [...] See answer in comp.lang.java.help. Please do not multipost. ============================================================================== TOPIC: Tree view type applet question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/792860f0cc43027 ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 5:10 pm From: [EMAIL PROTECTED] (talisman) hi, before i consider writing one, i thought i'd ask if anyone is aware of an already commercially available applet that - (a) provides a tree view of a data format - the applets data file format should be xml. (b) has a drag n drop functionality (so yo ucan drag leaf from one node to another folder etc). (c) exposes methods for getting current state of tree in xml. (d) can set different icons in xml data file for tree nodes etc. (e) has a generally rich set of methods for adding folders, leaf nodes etc to the structure, deleting them, getting id of the current selected node etc. (f) the applets xml datafile should be able to store id's relating to nodes etc... thanks ============================================================================== TOPIC: Ant question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1fa97e66c00da320 ============================================================================== == 1 of 1 == Date: Sun, Dec 26 2004 1:57 am From: "Tony Morris" "Arun" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does ant ever include text inside two tags. > > For example: > > <build> is there ever text in here </build> > > I never see a build file with text between tags, only tags with > attributes. > This depends on the Ant task. Most (all?) core tasks, by convention, do not use text within elements, however it can be achieved by writing a task with the method addYourPropertyName(String) method. http://ant.apache.org/manual/develop.html#writingowntask -- Tony Morris http://xdweb.net/~dibblego/ ============================================================================== TOPIC: Parsing a Schema to build a JTree http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4522b0f7e93fb2de ============================================================================== == 1 of 1 == Date: Sat, Dec 25 2004 6:14 pm From: [EMAIL PROTECTED] hey, I've practically finished the JTree thing now. And I was hoping you could help me with a slight challenge. Basically, when the tree is built there may be a subtree called USAdress, with name, street, etc as children nodes. Elsewhere in the tree, there are nodes called shipTo and billTo (which are defined as USAddress types as defined in the given schema). In my current algorithm, the USAdress node is added to shipTo and then to billTo, so the USAddress node is moved to billTo, and is no longer the child of shipTo. Is there any easy way to make a copy of a TreeNode (and its subtree)? Ie. is there an existing method which will work this magic for me, or am I going to need to write one? Cheers, David ============================================================================== TOPIC: Function calls... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fffeec3e18ff1713 ============================================================================== == 1 of 1 == Date: Sun, Dec 26 2004 12:21 am From: [EMAIL PROTECTED] (Raymond Martineau) In C, it's possible to create an array of the following data structure to associate a function call with a specific key or identifier: struct { char *key; void (*function)(); } a[] = { { "Function1", Function1} , { "Function2", Function2}}; (Or some other varient that you are comfortable with.) I would like to know the appropriate procedure on how to implement the same in Java. I would prefer to use the above system, as it can be much quicker to call a function by looking up the associated token in a hashtable as opposed to writing many lines of an if/else ladder. The first thought that appeared in my mind would involve reflecting classes. Checking with the API spec indicated that it should work, but I'm not sure that placing a large number of methods in one class is the best solution. In case you're wondering, I'm using this system to interpret a language that uses a large number of keywords (with each keyword executing its own function.) ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.java.programmer To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
