comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Telnet and EOF with SocketChannel.read() - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8ca7103c044db1f * JTextArea question - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b5070301a6779b * A little optimization question: Local var allocation - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a6b24661ed590053 * Help needed! how to deploy java application - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1be98d1355247063 * How to restrict direct access to JSP files, only allow access via servlet? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/514c912d89045a82 * How do i serialize... - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a2cd83849aed5600 * Java double precision - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ffd916b2ccb1a75b * CVS connection problem in Eclipse using ext or extssh - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f210a50f0bbbf32b * "static" prefix - to parallel "this" prefix - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157 * Threads and modal dialog behaviour question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a5f146a46cb92ad * Java and xmlrpc? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4304527fb69e181 * get and set Attribute for EJB Context (Storing objects) - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ac27c0ee059670c * Eclipse: List of TODO tags in Task view - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/00ec03d9704ddd3c * Can Java Programmer Learn C++ Quickly? - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec * Create DOM from SAX stream - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bb3fb5a719f2610 * Invoking 'diff' from java with piped input - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a587b43b3b207a9f * Good Tutorials? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e1bfe9d64672b57e * Efficient way of dynamically invoking a method that returns a primitive type? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bcb9be06f3aeec1 ============================================================================== TOPIC: Telnet and EOF with SocketChannel.read() http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8ca7103c044db1f ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 3:11 am From: [EMAIL PROTECTED] (Fritz Bayer) Hello, I'm playing around with the NIO api trying to figure out how certain functions respond and work. I know that SocketChannel.read() can return -1, which actually signals a EOF. I have seen this and I'm trying to reproduce it To do so I use telnet to connect to my server. Then I type "^]" so enter the special mode of telnet and use "send eof" to sent an EOF to the program. I use a debugger to check out whats comming in. My SocketChannel.read() returns two bytes -1 and -20 respectively. Those correspond to the ISO 8859 latin1 of 255 and 236. I was expecting that SocketChannel.read() would not fill the buffer and return a -1 instead. Now I was wondering if anybody has some suggestions on what I'm doing wrong here? I just thought that maybe the telnet program does not really send eof but something else instead? Typing in ^D does not work. This usually corresponds to EOF when using bash under linux. Fritz == 2 of 2 == Date: Wed, Dec 8 2004 12:37 pm From: Gordon Beaton On 8 Dec 2004 03:11:28 -0800, Fritz Bayer wrote: > I'm playing around with the NIO api trying to figure out how certain > functions respond and work. > > I know that SocketChannel.read() can return -1, which actually signals > a EOF. I have seen this and I'm trying to reproduce it > > To do so I use telnet to connect to my server. Then I type "^]" so > enter the special mode of telnet and use "send eof" to sent an EOF > to the program. "send eof" sends the "telnet end of file" character, which is a telnet control character. If you want the server to reach end of file, don't "send" anything. You need to close the client connection. SocketChannel.read() will indicate EOF at that point. > Typing in ^D does not work. This usually corresponds to EOF when > using bash under linux. ^D is not an EOF character either. It is a special character interpreted by the console driver, telling it to close the input stream to whatever process is reading from the current tty (and thereby causing that process to detect EOF on its stdin). /gordon -- [ do not email me copies of your followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e ============================================================================== TOPIC: JTextArea question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b5070301a6779b ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 11:20 am From: "Ryan Tan via JavaKB.com" Yes I am sure. I am using JDK 1.4.2_04 on windows. Any ideas are appreciated :) -- Message posted via http://www.javakb.com == 2 of 2 == Date: Wed, Dec 8 2004 6:22 am From: Babu Kalakrishnan Ryan Tan via JavaKB.com wrote: > Yes I am sure. I am using JDK 1.4.2_04 on windows. > > Any ideas are appreciated :) > Even the source code doesn't show them being disabled. So I suspect it is something else in your code that's doing it. Can you post a small code sample that exhibits this behaviour ? Are you by any chance calling setEnabled(false) as well ? BK ============================================================================== TOPIC: A little optimization question: Local var allocation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a6b24661ed590053 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 1:40 pm From: Daniel Sjöblom Chris Berg wrote: >>In this case the two approaches compile to identical bytecode (which you >>could have verified yourself), so there is not much to discuss. Even if > > How do I verify that? Use the javap tool that is provided with the SDK. >>they didn't, worrying about this kind of microoptimization is utterly >>futile. A better improvement to #1, #2 would be a more readable version: >> >>String str; >>while ((str = dis.readLine()) != null) >>{ >> ... something >>} > > > This is your own taste. Personally, I don't like concatenations like > that; a program does not necessarily get more readable by reducing the > number of characters or lines. I usualy stick to the principle of one > thing happening on each line. As Michael said, this is an idiom recognized by most programmers. I don't think you will find many people advocating your approach, but as always YMMV. > Unless, of course, if your version actually runs faster? It appears to > have one less reference to the string than mine !! As I said above, you should avoid this kind of optimization. Any speed benefit/disadvantage from my version (or anything comparable) is absolutely dwarfed by the amount of time it takes to call the DataInputStream.readLine method and do whatever work there is to be done inside the loop. But since you asked for it, the bytecodes are not equivalent, but that doesn't really mean anything. On the current Sun VM both approaches will be compiled to the same machine code by the JIT compiler (verified with -server, not sure about client vm, but I don't expect much of a difference). -- Daniel Sjöblom Remove _NOSPAM to reply by mail ============================================================================== TOPIC: Help needed! how to deploy java application http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1be98d1355247063 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 3:58 am From: "Ravi" Totally agree with you Andrew. Alot of beginner Java users dive straight into IDE's such as Netbeans etc. When it comes to problems with compiling, deploying and so on, it would be useful for them to know how to directly do this from a command line argument, or better yet, consult the java specification documentation. Andrew Thompson wrote: > On 13 Nov 2004 09:18:12 -0800, Jane Sfelc wrote: > > > ..I think NetBeans is not that bad. > > Don't get me wrong, I have nothing against powerful, > intuitive IDEs as such. It's just that people learning > Java should know how to compile, run and jar their projects > before they allow an IDE to 'do it for them'. > > Why? Because the IDE's config. will become corrupted or lost, > and if you don't know how these things are done from the command > line, your chances of fixing the IDE are pretty slim. > > Also, the layout you are using is a horrid one, and I can > say that without having ever used it. It (correct me if > I'm wrong) put's things *exactly* where you want them, right? > > That might work fine on one OS, using one particular version > of Java, but move it anywhere else and you will discover that > the text of UI elements is a different size, or the default > borders and paddings have changed because of an updated PLAF. > The UI 'falls apart'. > > In any case, glad you sorted this one. Think about what I've > said for the next problem that crops up. > > -- > Andrew Thompson > http://www.PhySci.org/codes/ Web & IT Help > http://www.PhySci.org/ Open-source software suite > http://www.1point1C.org/ Science & Technology > http://www.LensEscapes.com/ Images that escape the mundane == 2 of 2 == Date: Wed, Dec 8 2004 4:02 am From: "Ravi" >>command line argument corrected: command line environment Ravi wrote: > Totally agree with you Andrew. Alot of beginner Java users dive > straight into IDE's such as Netbeans etc. When it comes to problems > with compiling, deploying and so on, it would be useful for them to > know how to directly do this from a command line argument, or better > yet, consult the java specification documentation. > > > > Andrew Thompson wrote: > > On 13 Nov 2004 09:18:12 -0800, Jane Sfelc wrote: > > > > > ..I think NetBeans is not that bad. > > > > Don't get me wrong, I have nothing against powerful, > > intuitive IDEs as such. It's just that people learning > > Java should know how to compile, run and jar their projects > > before they allow an IDE to 'do it for them'. > > > > Why? Because the IDE's config. will become corrupted or lost, > > and if you don't know how these things are done from the command > > line, your chances of fixing the IDE are pretty slim. > > > > Also, the layout you are using is a horrid one, and I can > > say that without having ever used it. It (correct me if > > I'm wrong) put's things *exactly* where you want them, right? > > > > That might work fine on one OS, using one particular version > > of Java, but move it anywhere else and you will discover that > > the text of UI elements is a different size, or the default > > borders and paddings have changed because of an updated PLAF. > > The UI 'falls apart'. > > > > In any case, glad you sorted this one. Think about what I've > > said for the next problem that crops up. > > > > -- > > Andrew Thompson > > http://www.PhySci.org/codes/ Web & IT Help > > http://www.PhySci.org/ Open-source software suite > > http://www.1point1C.org/ Science & Technology > > http://www.LensEscapes.com/ Images that escape the mundane ============================================================================== TOPIC: How to restrict direct access to JSP files, only allow access via servlet? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/514c912d89045a82 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 6:11 am From: "Ryan Stewart" "Alan Gutierrez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2004-12-07, Ryan Stewart <[EMAIL PROTECTED]> wrote: >> "Anan" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> How to restrict direct access to JSP files, but allow access only via >>> servlet? >>> Is it possible via .htaccess? If so, e.g. of a snippet on how to do >>> it? Any other ways? Thanks. > >> Put all JSPs in WEB-INF. > > That can't be a good idea. I've put data in WEB-INF, but I'd never > think to put JSP resources there. Is this a common practice? > From"Code Conventions for the JavaServer Pages Technology Version 1.x Language": "Third, we use the term JSP fragment to refer to a JSP page that can be included in another JSP page. ... JSP fragments can use either .jsp or .jspf as a suffix, and should be placed either in /WEB-INF/jspf or with the rest of the static content, respectively. JSP fragments that are not complete pages should always use the .jspf suffix and should always be placed in /WEB-INF/jspf." http://java.sun.com/developer/technicalArticles/javaserverpages/code_convention/ Granted it can be interpreted a couple of ways. When using Struts, the idea is that all access to the application will go through Struts. Therefore, there is no need for any public JSPs. And in a sense, every JSP is being included, though not in another JSP. == 2 of 2 == Date: Wed, Dec 8 2004 6:45 am From: "John C. Bollinger" Ryan Stewart wrote: > "Alan Gutierrez" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>On 2004-12-07, Ryan Stewart <[EMAIL PROTECTED]> wrote: >>>Put all JSPs in WEB-INF. >> >> That can't be a good idea. I've put data in WEB-INF, but I'd never >> think to put JSP resources there. Is this a common practice? >> > > From "Code Conventions for the JavaServer Pages Technology Version 1.x > Language": > "Third, we use the term JSP fragment to refer to a JSP page that can be > included in another JSP page. ... JSP fragments can use either .jsp or .jspf > as a suffix, and should be placed either in /WEB-INF/jspf or with the rest > of the static content, respectively. JSP fragments that are not complete > pages should always use the .jspf suffix and should always be placed in > /WEB-INF/jspf." > > http://java.sun.com/developer/technicalArticles/javaserverpages/code_convention/ I think "JSP fragments can use either .jsp or .jspf as a suffix, and should be placed either in /WEB-INF/jspf or with the rest of the static content, respectively" mixes up the recommended locations for .jsp and .jspf files. In particular, it is not consistent with the next sentence that specifies that certain JSP fragments should both have the .jspf extension and be located in /WEB-INF/jspf. As a result, I think the convention that is being conveyed is to put .jsp files "with [...] the static content", i.e. _not_ under WEB-INF. > Granted it can be interpreted a couple of ways. Indeed. You can certainly disagree with my interpretation, but in stipulating multiple possible interpretations you absolve the text in question from having any authority with respect to the matter at hand. > When using Struts, the idea > is that all access to the application will go through Struts. Therefore, > there is no need for any public JSPs. And in a sense, every JSP is being > included, though not in another JSP. That's well and good, but not relevant to where the .jsp files should be located relative to the webapp root. I happen to agree with Alan that JSPs that are complete pages and are used as such should not be placed under WEB-INF. There are multiple mechanisms available for preventing direct access to the JSPs; putting them under WEB-INF is unnecessary, unconventional (according to my reading of the Sun convention), and confusing. John Bollinger [EMAIL PROTECTED] ============================================================================== TOPIC: How do i serialize... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a2cd83849aed5600 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 4:18 am From: [EMAIL PROTECTED] Thanks for the input! I have tried the first option. It doesn't work for primitive type changes. I will see the second option, which looks good. aMit ============================================================================== TOPIC: Java double precision http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ffd916b2ccb1a75b ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 12:21 pm From: Patricia Shanahan [EMAIL PROTECTED] wrote: > I know the following behaviour is an old problem, > but still I don't understand why such a simple piece of code: > > > double val = 0; > for(int i=0;i<10;i++) { > val+=0.1; > System.out.println(val); > } > > has the following (terrible) output: > > 0.1 > 0.2 > 0.30000000000000004 > 0.4 > 0.5 > 0.6 > 0.7 > 0.7999999999999999 > 0.8999999999999999 > 0.9999999999999999 > > > ??? > > Why, as a developer, I have to use a trick like this to solve the > problem: > > java.text.DecimalFormat df = new > java.text.DecimalFormat("###.########"); > double val = 0; > for(int i=0;i<10;i++) { > val+=0.1; > val = df.parse(df.format(val)).doubleValue(); > System.out.println(val); > } > > > Thank you in advance > Vincenzo Caselli > [EMAIL PROTECTED] > http://www.censnet.it > There are two incompatible objectives for string conversion of floating point data: 1. Produce a tidy result showing only meaningful digits. 2. Produce a result that uniquely identifies the floating point number. Language and library developers pick one for the default conversion. In C, for example, printf aims for #1, defaulting to 6 digit precision. Java uses #2 as the default, producing enough digits to ensure that the reverse conversion will recover the double. The result of adding 0.1+0.1+0.1 really is different from 0.3. I don't fully understand the reason for your "trick". I would have used the DecimalFormat when aiming for tidy output, but would not have converted back or used the result in continuing calculations. Doing so throws away precision if the mathematical answer is not a short decimal fraction. For example, try substituting 1/3.0 for 0.1 in your test. If you are only concerned with exact representation of short decimal fractions, and don't need to deal with numbers like 1/3.0, consider using BigDecimal instead of double. Any number that would be improved by your trick can be exactly represented as a BigDecimal with scale=8. Patricia ============================================================================== TOPIC: CVS connection problem in Eclipse using ext or extssh http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f210a50f0bbbf32b ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 4:53 am From: "fivepopes" Hi, I've been sweating for some time trying to connect to cvs using ext or extssh from Eclipse (3.1M3) on winxp. When I try to add a new location (filling out the form properly, I'm quite convinced), I get the message: "Error validating location "". Keep location anyway?" Somehow, it seems that the repository path isn't read. When I try to add the same connection with pserver, everything works fine. Any help is greatly appreciatied! cheers, thomas ============================================================================== TOPIC: "static" prefix - to parallel "this" prefix http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 4:55 am From: "Darryl L. Pierce" Chris Uppal wrote: >>>The name of the class. >> >>But you're not specifying the name of the class here. You're specifying >>the context of the variable in question. That it just happens to *also* >>be the classname is just a coincidence, and doing that doesn't harm the >>code or the intention at all. > > Most of the uses of the classname are redundant. To see that, change the name > of the class. All the uses of the classname (within the body of the class) > that have to change with it are redundant. Change the name of an instance variable. All the uses of the variable (within the body of the class if not the clients of the class) that have to change with it are redundant. My point is, it's no more a case of redundancy than any other example of indicating context. You use the classname to indicate the context in which you're using the static variable. BTW, the above scenario doesn't happen in Eclipse: you refactor and rename the class and all of those references are updated. *AND* the references in *other* classes are updated too. Which brings up an interesting question: how will you refer to static methods/variables in *other* classes? Are we going to keep the ClassName.staticField pattern? If so, then we now have *two* ways of doing the *exact same thing* which to my mind makes the static keyword even *less* attractive. -- Darryl L. Pierce <[EMAIL PROTECTED]> Visit my webpage: <http://mcpierce.multiply.com> "By doubting we come to inquiry, through inquiry truth." - Peter Abelard ============================================================================== TOPIC: Threads and modal dialog behaviour question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a5f146a46cb92ad ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 6:49 am From: Babu Kalakrishnan Aloys Oberthür wrote: > Babu Kalakrishnan wrote: > >> Aloys Oberthür wrote: >> >>> I have a question on modal dialogs in (non-event-dispatching)Threads. >>> I do set a flag in the actionPerformed() method of a modal dialog and >>> the object which displayed the dialog in the first place can question >>> this flag after "returning" from show(). I would have expected this >>> to be not timing dependant, but I see it is not which I do not >>> understand >>> >>> >>> that's the dialog in essence: >>> >>> class ModalerDialog extends JDialog implements ActionListener { >>> boolean flagSuccessful = false; >>> ... >>> >>> public void actionPerformed(ActionEvent aE) { >>> String cmd = aEvt.getActionCommand(); >>> >>> if(cmd.equals("one")) { >>> flagSuccessful = true; >>> this.setVisible(false); >>> } >>> else if(cmd.equals("two")) { >>> flagSuccessful = false; >>> this.setVisible(false); >>> } >>> } >>> >>> public boolean isSuccessful() { >>> return flagSuccessful; >>> } >>> } >>> >>> >>> and that is the Thread launched within the actionPerformed()-method >>> of a menu ActionListener (see // comments) >>> >>> Thread t = new Thread() { >>> public void run() { >>> >>> ModalerDialog md = new ModalerDialog(owner, true); >>> md.show(); >> >> >> >> If "md" is really a modal dialog, I would expect this thread to stop >> right here, and continue on to the next line only after the dialog has >> been hidden / disposed off. That's how modal dialogs are expected to >> behave. >> >>> >>> boolean b = md.isSuccessful(); // now on "one" false >>> try { >>> Thread.sleep(250); >>> } >>> catch (InterruptedException e1) {} >>> b = = md.isSuccessful(); // and now on "one" true ???? >>> >>> if(md.isSuccessful()) >>> md.dispose(); >>> else { >>> md.dispose(); >>> owner.showStartupDialog(); >>> } >>> } >>> }; >>> t.start(); >>> >> >> Couldn't understand what your comments meant either. >> > > It is true, that the Thread stops and displays the modal dialog. But > although I first set the flag within the dialogs actionPerformed method > and then set the dialog to not visible I get two results in the calling > Thread depending on when I invove md.isSuccessful(). > > > The comments referred to the actionCommand, I meant that the command > "one" is the one, where successful is set to true in the > actionPerformed() method above. > OK - Check if the problem goes away if the variable flagSuccesful is declared to be "volatile". (Or alternately declare the isSuccessful method as synchronized). BK ============================================================================== TOPIC: Java and xmlrpc? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4304527fb69e181 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 6:27 am From: "John C. Bollinger" ted holden wrote: > Problem fixed. This was basically an eclipse glitch, you have to include > the external jars apriori as you create a project. Adding them later > should have worked but didn't. That's odd. Adding Jars to a project later generally does work for me. YMMV. John Bollinger [EMAIL PROTECTED] ============================================================================== TOPIC: get and set Attribute for EJB Context (Storing objects) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ac27c0ee059670c ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 6:45 am From: Michael Borgwardt [EMAIL PROTECTED] wrote: > Are there any methods like getAttribute and setAttribute off the EJB > Context object like there is for Servlet context? Nope. > Currently I did not see any in the API. How then are we supposed to > store objects that we want to exist for the life of the app server and > to be accesible by our beans? Not at all. Such objects would not be compatible with the concept of EJBs, which includes clustering. You have to use entity beans for such purposes. == 2 of 2 == Date: Wed, Dec 8 2004 6:30 am From: [EMAIL PROTECTED] Are there any methods like getAttribute and setAttribute off the EJB Context object like there is for Servlet context? Currently I did not see any in the API. How then are we supposed to store objects that we want to exist for the life of the app server and to be accesible by our beans? Thanks for any suggestions. ============================================================================== TOPIC: Eclipse: List of TODO tags in Task view http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/00ec03d9704ddd3c ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 5:54 am From: [EMAIL PROTECTED] I'm not sure if this is the reason, but I noticed the feature stopped working sometime after this was announced: http://news.com.com/Microsoft+checks+off+patent+win/2100-1008_3-5228693.html http://www.theinquirer.net/?article=16489 http://www.flipcode.com/cgi-bin/fcmsg.cgi?thread_show=22715 Dean S. Jones == 2 of 2 == Date: Wed, Dec 8 2004 5:55 am From: "John C. Bollinger" Tzar wrote: > I think problem is when I enter a comment like // TODO it does not > create a task icon on the left edge of the editor (after saving). If I > manually click on the left edge and select Add Task then it does but > for some reason it's not doing it for the // TODO comment. > I tried it on couple of other machines and they work fine. It > automatically creates a TODO task and it shows it in the Tasks View. It seemed to me that this behavior of Eclipse 2 was omitted from Eclipse 3, or at least not enabled by default. I last looked into when Eclipse 3 was still prerelease, however, and I never fully characterized the problem. John Bollinger [EMAIL PROTECTED] ============================================================================== TOPIC: Can Java Programmer Learn C++ Quickly? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7c7a28aa864e41ec ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 7:56 am From: Chris Smith > "Rhino" <[EMAIL PROTECTED]> wrote... > > I am giving some thought to applying for some jobs that want people with > > Java and C++ experience. Ann <[EMAIL PROTECTED]> wrote: > Did you consider C# instead of C++? Huh? If the job requires Java and C++, why would you learn C# instead of C++? That's like learning Spanish so that you can travel to Quebec. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation == 2 of 2 == Date: Wed, Dec 8 2004 7:35 am From: Chris Smith Ian T <[EMAIL PROTECTED]> wrote: > Chris Smith wrote: > > > IMHO, this is far more confusing than pointer arithmetic ever > > was, but it's still not prohibitive to understand. Devoting months to > > getting it is, frankly, ludicrous. > > > Please point out where I said it would take months to 'get' pointer > arithmetic. I don't believe you did. I'm responding to the general idea, expressed at several points in this thread, that it would take months (or even years) to understand this stuff. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== TOPIC: Create DOM from SAX stream http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bb3fb5a719f2610 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 6:51 am From: Collin VanDyck I'm sorry if this has been incredibly overdone; I googled for a couple minutes and couldn't come up with a definitive answer. In my application I have the need to create a DOM from a stream of SAX events. The way it currently works is that I instantiate an org.apache.xml.utils.DOMBuilder on an empty org.w3c.dom.Document that I've created from a JAXP DocumentBuilderFactory. For the most part it works fine; all of the ContentHandler callbacks get reported into the Document but only some of the LexicalHandler events get reported. Looking into the source for DOMBuilder I see that it tends to ignore certain lexical events, mainly startDTD(): /** * Report the start of DTD declarations, if any. * * Any declarations are assumed to be in the internal subset * unless otherwise indicated. * * @param name The document type name. * @param publicId The declared public identifier for the * external DTD subset, or null if none was declared. * @param systemId The declared system identifier for the * external DTD subset, or null if none was declared. * @see #endDTD * @see #startEntity */ public void startDTD(String name, String publicId, String systemId) throws org.xml.sax.SAXException { // Do nothing for now. } The DOMBuilder I'm using comes from the rt.jar under the 1.4.2_03 SDK. I need these events to be fed back into the Document. Am I missing something obvious here or will I need to extend the DOMBuilder and fill in the gaps? Seems strange to me that would be left out. Thanks for any help Collin ============================================================================== TOPIC: Invoking 'diff' from java with piped input http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a587b43b3b207a9f ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 7:31 am From: Michael Borgwardt David Kensche wrote: > Hello, > I want to call GNU diff from a java class with the following command [] > My problem is: how do I give the input? I assume there has to be a > way to pipe the Strings to the process but I can't make out how. Just write them to a file, then give the file name as argument. No, there is no other way, because a process can have only one input stream. The other way would be to find and use a diff implementation in Java. ============================================================================== TOPIC: Good Tutorials? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e1bfe9d64672b57e ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 7:17 am From: Collin VanDyck JS wrote: > Where can I find good Java tutorials? > > JS > > You should really try harder: http://www.google.com/search?hl=en&q=java+tutorial&btnG=Google+Search But yes, the first link is the first place you should go. Run through the Sun tutorials. They are quite good. ============================================================================== TOPIC: Efficient way of dynamically invoking a method that returns a primitive type? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bcb9be06f3aeec1 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 6:42 am From: [EMAIL PROTECTED] (Andreas Jakobik) Hi, is there an efficient way to dynamically invoke a method that returns a primitive type? I'd like to avoid the Object to primitive type conversion. The temporary object wrapper should not have to be created at all. In our application (a Configuration Service within a telcom platform) we dynamically call methods on so called Managed Objects (MOs). Such an MO may implement the folloing method: public int getPmX(); The configuration service calls this method by means of reflection, i.e. Method.invoke(...). However the returned value is (of course) an Object which must be casted. My question is: If a client application has a reference to an MO, and knows the name of the method (but only in run-time) and that it returns an int (as in the above example), is there a better way to call the method than using Method.invoke(). My assumption is no... (At compile time the client application does not know the method name.) BTW, we're on a J2ME CDC foundation profile which provides an Java 1.2 API. Thanks a lot! /Andreas ============================================================================== 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
