comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Can Java Programmer Learn C++ Quickly? - 4 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec * Java program is not evaluating String value correctly... - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5d457b2bb465740e * Unique key and value - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f78fd73e6d5dce7 * Opening all links of a html page and saving the html pages - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3965a89e63b8ab99 * JRE is machine dependent but compiler is machine independent - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5245e1f2b98c91fc * Using hobby source code in your job ? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4 * Serialization Problems and books on serialization? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8af88eceb230451c * Problem in Paint method - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57896100121a1d97 * Java History - 4 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5712674adb50bd0e * JAVA/ ORACLE/ CONTRACT/ FL - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c2089808879d1377 * Is that to implement JProgessBar, we need do in different thread? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b82cc98adac6a8bf * Which JVM to use for Tomcat 5.0.28 and Tomcat 5.5.4? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e152476f72d1387a * Help.. I need JSF, SPRING, HIBERNATE, STRUTS, JSP - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2e8c209ec29d626b * Where do they go? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/13296f4262fb9757 ============================================================================== TOPIC: Can Java Programmer Learn C++ Quickly? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec ============================================================================== == 1 of 4 == Date: Fri, Dec 10 2004 11:12 am From: "jeffc" "Phil Staite" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Wait till you first bump into trying to make a virtual function call > from a constructor or destructor... That works in Java? == 2 of 4 == Date: Fri, Dec 10 2004 11:10 am From: "jeffc" "James Kanze" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Well written C++ isn't necessarily difficult, but it is different from > Java. And while poorly written code is poorly written code in any > language, C++ does seem to have a particular gift for encouraging it. Right. == 3 of 4 == Date: Fri, Dec 10 2004 11:15 am From: "jeffc" "Ian T" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Fourth: Learn the containers in STL as soon as practically possible, > especially <map> and <list>. > > Good luck with that ;). Probably *the* best book (IMNSHO) for starting > out with C++ is Dietel & Deitel C++ How to Program. It's as dense as a > chocolate pudding, but it has all the bits. In keeping with your fourth point, and learning to write practical programs using the standard library immediately, I think Accelerated C++ would be a better choice for him. == 4 of 4 == Date: Fri, Dec 10 2004 11:23 am From: "jeffc" "James Kanze" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > When it comes down to it, of course, neither C++ nor Java can be taken > as models with regards to their collections and iterators. C++ uses > really stupid names, like ++ and *, rather than a simple, understandable > next() and element() (or something along those lines), but that's just a > naming convention. That is part of the problem with C++ - too much overloading. (The only one I've seen after just starting in Java is + for Strings.) Not just operators like those, but more general problems like "static" (ugh!), '&' (3 meanings), etc. Java has a similar problem with "final", (C++ has const, but no unoverridable methods), but then there is crazy stuff in C++ like the lack of an abstract keyword, and that inane syntax "=0" for pure virtual. Yes indeedy, an overly syntaxy language (due mostly to too much backward compatibility with C.) ============================================================================== TOPIC: Java program is not evaluating String value correctly... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5d457b2bb465740e ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 5:12 pm From: Michael Borgwardt jeffc wrote: > Ah, so if this had been some other sort of literal, like a primitive type 'c' > or > 3, then no object would have been created. Since it is a String literal, an > object is created. Yes. Note, though, that the object is created only once, when the class is loaded, not each time the code is executed. > Is there any other Java literal for which an actual object > is created? the .class literals also refer to objects, but of course those objects would be created anyway, no matter whether there are literals that reference them. ============================================================================== TOPIC: Unique key and value http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3f78fd73e6d5dce7 ============================================================================== == 1 of 3 == Date: Fri, Dec 10 2004 8:29 am From: "Yamin" Michael Borgwardt wrote: > Andrei Kouznetsov wrote: > > >>I think what is needed is a new class that extends a HashMap, and contains > >>a HashSets for the values. > >>then you need to override the put(Object key, Object value) method such > >>that > >>it checks if the value exists in the HashSet, and then override the > >>remove(Object key) method such that it removes the corresponding value for > >>that key from the HashSet before calling the remove in the supre class. > > > > > > Use simple hashtable and while 'putting' just check if your value already > > there. > > And how are you going to check that? By iterating through all the entries? > *Bad* for performance. So you'll have to use something quicker to do that > check. Something like a HashSet. > It's very easy to check for duplication. No need to create an enumeration or anything. Why make things complicated? Just try and retreive the value with the specified key before you insert...Incidently, it's also a lot quicker than generating an enumeration and parsing it...it gets (roughly the same performance as a get. Object insert(Object key, Object value) { Object oldValue = myHashtable.get(key); if( oldValue == null) { //the key is not in there myHashtable.put(key, value); return key; } else { //there already exists an entry return null; } } > Incidentially, that's pretty much how it would be done in a database, > which the original poster referred to. Marking a column UNIQUE causes > in index (basically a tree-based map) to be created if one didn't already > exist for that column. == 2 of 3 == Date: Fri, Dec 10 2004 5:58 pm From: Michael Borgwardt Yamin wrote: >>And how are you going to check that? By iterating through all the entries? >>*Bad* for performance. So you'll have to use something quicker to do that >>check. Something like a HashSet. >> > > > It's very easy to check for duplication. No need to create an > enumeration or anything. Why make things complicated? Just try and > retreive the value with the specified key before you > insert... Wrong. The request was for the value to be unique, so you have to make sure that it doesn't exist under *any* key. == 3 of 3 == Date: Fri, Dec 10 2004 8:58 am From: "Yamin" I should point out, the above only works for unique keys. Mind if we ask what data you're actually trying to store and how you use it? Often enough each value is always going to generate the same key, so only checkign key uniqueness is good enough. However, if two distinct value really do return the same key, the you'd have to do as others have suggessted and use 2 hashtables. If you want have both unique keys and values, you'd have to have two hashtable using the insert above and doing the checks accordingly. ============================================================================== TOPIC: Opening all links of a html page and saving the html pages http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3965a89e63b8ab99 ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 5:33 pm From: "Andrei Kouznetsov" >I want to know how to open all the links of a html page and then, save > those html pages. > In other words, if a html page @ www.ndtv.com has 10 links, I would > like to save the html pages (that are the target of these 10 links ) > on to my computer. acme.com has perfect solution for that and its free. -- Andrei Kouznetsov http://uio.dev.java.net Unified I/O for Java http://reader.imagero.com Java image reader http://jgui.imagero.com Java GUI components and utilities ============================================================================== TOPIC: JRE is machine dependent but compiler is machine independent http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5245e1f2b98c91fc ============================================================================== == 1 of 3 == Date: Fri, Dec 10 2004 8:50 am From: [EMAIL PROTECTED] When we download JRE, there are different platforms to choose. That means JRE is machine dependent, but Java Compiler is machine independent. Is that the story board? Java Code -> Java Compiler -> Class File -> Platform Dependent JRE -> Native Code Is that correct? Please advise. Thanks == 2 of 3 == Date: Fri, Dec 10 2004 5:19 pm From: "Grant Wagner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > When we download JRE, there are different platforms to choose. That > means JRE is machine dependent, but Java Compiler is machine > independent. The compiler itself is machine dependant, that is, you need a different Java compiler for each platform you run it on, but the bytecode it produces is machine independant (at least in theory). If you include things in your Java program that are machine dependant such as references to "drive letters" or hardcoding directory path separators then the bytecode may be technically machine independant, but it will not run correctly on platforms other than the one it is targeted for. > Java Code -> Java Compiler -> Class File -> Platform Dependent JRE -> > Native Code Pretty much. The behaviour of the JRE or JVM (Java Virtual Machine) is a "black box", you don't necessarily know (or care) what is going on inside. It can "interpret" the bytecode instruction by instruction and execute the appropriate native CPU instructions, or it can JIT (Just-In-Time) compile the bytecode to native code, then execute that native code. Or it can do a bit of both. -- Grant Wagner <[EMAIL PROTECTED]> == 3 of 3 == Date: Fri, Dec 10 2004 6:43 pm From: Michael Borgwardt Grant Wagner wrote: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>When we download JRE, there are different platforms to choose. That >>means JRE is machine dependent, but Java Compiler is machine >>independent. > > > The compiler itself is machine dependant, that is, you need a different > Java compiler for each platform you run it on, No, because the compiler itself (at least Sun's javac) is written in Java, so all you need is a (definitely machine dependant) JRE. ============================================================================== TOPIC: Using hobby source code in your job ? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a60dfe865a7807c4 ============================================================================== == 1 of 2 == Date: Fri, Dec 10 2004 4:58 pm From: Albert van der Horst In article <[EMAIL PROTECTED]>, Flash Gordon <[EMAIL PROTECTED]> wrote: >Albert van der Horst <[EMAIL PROTECTED]> wrote: > >> >> This is of course because published GPL code is effectively owned >> and defended by the public, which includes IBM, a company with >> deep pockets and good lawyers. > >This is incorrect. The public does *not* own GPL code, the copyright >owners do. The copyright owners are therefor free to release identical >code under another licence or sell it if they wish. Look at Cygwin and >QT for two examples of code available both under GPL and commercial >licenses, there are others. You turn my carefully worded phrases upside down. By GPL-ing my code, I do the best I can to give the public full control of my code. That is what I mean by "effectively". And indeed the public holds a stake at my code, probably more than I do. What you say about selling by the autor is only very partially true. If I am the only contributor to code, I can rerelease under a different copyright. I can do nothing if I'm a significant contributor, but others are also. This is, of course, the case with practically all significant sources. So I restate: "the public effectively owns the GPL-code." And I would add: "the companies with the best lawyers effectively own public domain code.". >-- >Flash Gordon Groetjes Albert. -- -- Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS One man-hour to invent, One man-week to implement, One lawyer-year to patent. == 2 of 2 == Date: Fri, Dec 10 2004 10:38 am From: "Andrew Koenig" "Albert van der Horst" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You turn my carefully worded phrases upside down. > By GPL-ing my code, I do the best I can to give the public > full control of my code. That is what I mean by "effectively". > And indeed the public holds a stake at my code, probably more than > I do. This is incorrect. By GPL-ing your code, you give the public *no* control over it. If you wanted to give the public control over it, you would place it in the public domain. If you GPL code, you are (still) the only one who controls it, because you and you alone have the option of making the code available under different terms. ============================================================================== TOPIC: Serialization Problems and books on serialization? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8af88eceb230451c ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 10:08 am From: [EMAIL PROTECTED] Dear Sudsy, Michael, Indeed as both of you spotted, my problem is with buffer. I changed to ByteArrayStreams (whose buffers can grow with data) and everything go away. Many thanks for your help. Best regards, sinlee ============================================================================== TOPIC: Problem in Paint method http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/57896100121a1d97 ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 6:08 pm From: "Thomas G. Marshall" [EMAIL PROTECTED] coughed up: > Hi Everyone, > > I am creating light weight button. > > I have given almost all support. > > But in application when user overriding paint method > > my component is not visible. > > When calling setVisible in application my paint method is > > not getting called. > Please let me know how to solve this problem. > > Regards > > Udhaya Override paintComponent(). Be sure to extend one of the lightweight classes, it will bring with it much support, and will keep your LW component behaving in later java revisions. -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. ============================================================================== TOPIC: Java History http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5712674adb50bd0e ============================================================================== == 1 of 4 == Date: Fri, Dec 10 2004 6:13 pm From: "Thomas G. Marshall" Chris Smith coughed up: > <[EMAIL PROTECTED]> wrote: >> Being new to Java, I am trying to get a little history. >> >> Currently everything is referenced as some type of J2 (J2SE, J2EE, >> J2ME). >> >> I am wondering when/if there was ever a J1SE, J1EE, etc ... > > Not exactly. > > First there was Java 1.0.2 (the first public release). Then there > were several 1.1 releases. Then there was 1.2. > > At the time of Java 1.2, a lot of changes got made. Though there were > actually no changes at all to the language specification, the main > changes were: a vastly expanded standard API, at least several times > as expansive as the 1.1 versions and including Swing [...] Just a nit pick. The JFC (swing) was originally maintained briefly in its own revision space, and was shippable with 1.1.mumble. By the way, I always had a hard time reading "JFC". It was just too engrained within me noggin as cussing. ;) Seriously... ...[rip]... -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. == 2 of 4 == Date: Fri, Dec 10 2004 6:18 pm From: "Thomas G. Marshall" Chris Smith coughed up: > Tom Dyess <[EMAIL PROTECTED]> wrote: >> Sun does something similar with SunOs and Solaris: SunOs 5.7 is also >> Solaris 7; SunOs 5.8 is also Solaris 8, etc. Must be a cultural >> thing from way back when that just stuck. > > Well, that's a tad different from what happened with Java 2. "Java 2" > is a product, and it has several versions, of which 1.2 is only the > first one. Though it's confusing to have a numeral in the product > name, it does actually make sense from an objective standpoint. > However, Solaris is *exactly* reminiscent of the current "Java 5.0" > fiasco. Probably true. Well, IIRC, Solaris 2.0 was really huge, in that it was sun's first departure from their BSD roots, and the official embracing of AT&T's SVR4, which was a great move technically (though painful). It was a disaster in terms of revision numbering however, and I had no end of grief trying to explain to customers why their device drivers needed radical reworking even though the "SunOS" number just "went up". OI. -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. == 3 of 4 == Date: Fri, Dec 10 2004 6:24 pm From: "Thomas G. Marshall" Thomas Weidenfeller coughed up: > Chris Smith wrote: >> Well, that's a tad different from what happened with Java 2. "Java >> 2" is a product, and it has several versions, of which 1.2 is only >> the first one. > > Well, calling the first version of a product 1.2 isn't too clever. To add, they desperately attempted to keep the "1.2" as glued to the term "JDK" and not "java", which was a hopelessly lost cause baffling every non-java person. "Do I need java 1.2 or java 2????" Oh man..... ...[rip]... > Solaris is also very similar to the "Java 2" rebranding. Solaris > actually started as "Solaris 2" (aka SunOS 5.0) plus a desperate > attempt by Sun to rebrand SunOS 4.x.y as "Solaris 1.<mumble>". YES. And this was no end of confusion. Not helped by the fact that SVr4 has a "roman 5" of sorts in it, and is a /different/ 5, though it's what solaris 2 / sunos 5 is based upon. > So, > there is someone at Sun who likes to name products "<Product> 2". > Then they repeated the renumbering stunt for Solaris 7 (aka Solaris > 2.7, aka SunOS > 5.7). Yep. Different dog, same fleas. Same dumbass marketting... ...[rip]... > The same marketing guys messing the C/C++ compiler naming/versioning > up apparently now have some say in Java naming/numbering :-( Bingo. -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. == 4 of 4 == Date: Fri, Dec 10 2004 6:31 pm From: "Thomas G. Marshall" Kieron Briggs coughed up: > [EMAIL PROTECTED] wrote: >> Being new to Java, I am trying to get a little history. >> >> Currently everything is referenced as some type of J2 (J2SE, J2EE, >> J2ME). >> >> I am wondering when/if there was ever a J1SE, J1EE, etc ... >> >> What does the 2 stand for? Was there some type of major revision? > > The numbering system of Java has been.... erratic. > > From memory (and I'm sure others will correct me here...) > > In the beginning there was Java, which was also called Java 1.0. Forgetting the "oak" thing for now, and them microwaves running the early "java" thing, there was something simply called java-alpha, by folks I chatted with at sun. I paid /out of pocket/ to attend a sun propaganda thing from sun. At which they were touting "beta" as the latest and "throw out alpha, it will not work at all, and is not compatible." Whatever. Growing pains. > Then there were some improvements to the standard API, and Java 1.1 > was born. There were ENORMOUS improvements, and 1.1 was born. I would argue that the delta: 1.0.mumble ---to---> 1.1.mumble (particularly 1.1.7) is vaster in its impact than 1.1.mumble ---to---> 1.5.mumble No kidding. ...[rip]... -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. ============================================================================== TOPIC: JAVA/ ORACLE/ CONTRACT/ FL http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c2089808879d1377 ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 6:17 pm From: "Virgil Green" "Tom Gugger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > OMNI GROUP > > [EMAIL PROTECTED] > > 419-380-8853 > > > > J2EE/ JSP/ CONTRACT/ FL > > > > ORLANDO , FL > > EIGHT MONTHS > > Start Date: Jan 3, 2005 > > IMPORTANT: Contractor is required to provide laptop. Can't afford to provide the necessary hardware... but willing to pay contractor rates? Seems a bit odd. <snip job requirements> ============================================================================== TOPIC: Is that to implement JProgessBar, we need do in different thread? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b82cc98adac6a8bf ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 6:21 pm From: "Ann" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > James wrote: > > without using antoher thread, there is no way to do it right? > > when something is processing, it will not response to progressbar? > > anyone can give some example(code) on it? > > eg. like processing for loop 10000 time > > the progress bar showing the percentage. call setProgress() in your loop when you want to update the bar. http://java.sun.com/docs/books/tutorial/uiswing/components/progress.htm > The progress bar should update, unless you are doing your > processing inside a UI event handling method, in which case > you'll be running under Swing's own thread, which would likely prevent > other components from updating until your method exits > and returns control back to Swing. > > > -FISH- ><> > ============================================================================== TOPIC: Which JVM to use for Tomcat 5.0.28 and Tomcat 5.5.4? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e152476f72d1387a ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 10:25 am From: Katerina McLean Hi: Is there a suggested version of JVM to use with Tomcats 5.0.28 and 5.5.4? I have been searching online but could not find any info from the Apache group. Thank you for helping me out on this. Kat ============================================================================== TOPIC: Help.. I need JSF, SPRING, HIBERNATE, STRUTS, JSP http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2e8c209ec29d626b ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 10:35 am From: "[EMAIL PROTECTED]" If anyone knows anyone looking for some full time work or a contracting position in Santa Monica CA, please contact me!! [EMAIL PROTECTED] 310 998 9442 JSF, JAVA SERVER FACES, JSP, SPRING, HIBERATE, STRUTS!!! ============================================================================== TOPIC: Where do they go? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/13296f4262fb9757 ============================================================================== == 1 of 1 == Date: Fri, Dec 10 2004 10:36 am From: "Thomas G. Marshall" Chris Uppal coughed up: > Paul Cager wrote: > >> And of course mark/sweep GC makes perfect sense now... > > The janitor's name is Mark. > > -- chris LOL. Oh too good. That was a perfect comment. -- Everythinginlifeisrealative.Apingpongballseemssmalluntilsomeoneramsitupyourn ose. ============================================================================== 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
