comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * paint program - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a58412a811c7bb44 * Visual Modelling Tool - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c3aab05fc2bb074a * Can HTML be translated to XHTML perfectly?! - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/109b3c89710816fe * About Google Api - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e584eaa8642abf4d * version -> speed? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a63fd0f945fa2e4f * Error during a POST to a servlet in weblogic - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c7fd3d60da3f6ed5 * Socket problem -- response slow for host with domain (on SunOS 5.8) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfb84c34caf0c9e9 * newbie RMI User - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/af49b3bdfce876e4 * MathFP - atan2 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4568ec7fc8654bd8 * xml select on jdbc server - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8e064231dc684dac * map image??? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ec70f963b2ba3e79 * Using BigInteger - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7be97102e1c754 * blanking a java.util.Date in 1.5 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b61c04b0e8db0fbf ========================================================================== TOPIC: paint program http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a58412a811c7bb44 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 10:15 pm From: "Aaron J Gage" <[EMAIL PROTECTED]> "C Williams" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, Basically, I > would like to work with pixels directly: take all of the ones within a > radius of a mouse click, blend them with a mask the represents the > brush, and then update just those pixels back on the canvas. > > I'm not sure what sort of component I can draw upon that lets me just > loop through its pixels. I've done something fairly similar to this a > few years ago (in C++), so I am okay with the concept but just > struggling with the implementation in Java. > -Casey You could create your own Component (subclass) and keep track of the pixels yourself (maybe using a 2D array of Color objects?). Java has no method in the Graphics class or subclasses such as setPixel(x, y, col) but you get the same effect with drawLine(x, y, x, y, col), and of course you can getPixel(x, y) by indexing into your array! maybe something like: public class PaintComponent extends JComponent { private int W = 200, H = 200; Color pixels[][]; // = new Color[W][H]; public PaintComponent() { super(); addMouseListener( new MouseHandler() ); } public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D)g; for (int x = 0; x < W ; ++x) for (int y = 0 ; y < H ; ++y) g.drawLine(x, y, x, y, pixels[x][y]); // and whatever else (border etc) } class MouseHandler extends MouseAdapter() { //override the handler methods you need } } This code isn;t complete, but gives you an idea of what I mean. You could even implement get/setPixel in this class. You can use the repaint() and repaint(x, y, w, h) to invoke a repaint of your component internally. The 2nd clips the region to redraw. You can (and should) get this in the paintComponent method by calling: g.getClipBounds() // I think, without checking the API. should return Rectangle end only repaint that portion of the component. Hope this helps you. ========================================================================== TOPIC: Visual Modelling Tool http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c3aab05fc2bb074a ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 9:44 pm From: IchBin <[EMAIL PROTECTED]> Edward H. Fabrega wrote: > "Rizwan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>I am looking for a modelling tool to use with my java project. Which >>modelling tool is popular in the java community. What do you guys >>recommend? >> >>Also what do you guys think about Rational Rose? >> >>Thanks >> >> > > > Check out Visual Paradigm if you're just learning UML. The Community Edition > is free, and if you like the program you can upgrade to more feature rich > editions (the most exensive being $699): > > http://www.visual-paradigm.com/vpuml.php > > -- Visual Paradigm is nice and I have the Eclipse Plug-in for it. I also found a different completely free version that does all that with full functionally. It has small memory footprint. It is free! I heard about it from these java newsgroups. It is call "Jude", can find at: http://objectclub.esm.co.jp/Jude/ I am very happy with it. Thanks in Advance... IchBin __________________________________________________________________________ 'Laughter is inner jogging' - Norman Cousins, editor and author (1915-1990) ========================================================================== TOPIC: Can HTML be translated to XHTML perfectly?! http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/109b3c89710816fe ========================================================================== == 1 of 3 == Date: Wed, Sep 22 2004 10:23 pm From: [EMAIL PROTECTED] (mike) regards: Can HTML be translated to XHTML perfectly?! or there is another similar tool in java ( like api ) can do the work?!...thank you ----------------------------------------------------------- I use the Jtidy opensources but I find that I cannot translate some HTML pages. thank you == 2 of 3 == Date: Wed, Sep 22 2004 11:01 pm From: JScoobyCed <[EMAIL PROTECTED]> mike wrote: > regards: > > Can HTML be translated to XHTML perfectly?! Can you define your definition of "perfectly", related to your question ? Maybe a different newsgroup oriented XML/HTML would be more appropriated (I am not sure if there are any, though ... :) ) -- JScoobyCed What about a JScooby snack Shaggy ? ... Shaggy ?! == 3 of 3 == Date: Thurs, Sep 23 2004 1:30 am From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> [EMAIL PROTECTED] (mike) writes: > Can HTML be translated to XHTML perfectly?! Not necessarily. HTML is more lenient than XHTML, and browsers even more so. For instance, the EMBED element is an abomination unto W3C, since it doesn't have a restricted set of possible attributes. The easiest is probably to lowercase all element and attribute names, and change <empty> elements into <empty/> and hope for the best. ========================================================================== TOPIC: About Google Api http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e584eaa8642abf4d ========================================================================== == 1 of 2 == Date: Wed, Sep 22 2004 11:07 pm From: wangyin <[EMAIL PROTECTED]> hi all: Where do I get com.google.soap.search.*? thanx! == 2 of 2 == Date: Thurs, Sep 23 2004 12:15 am From: Digby <[EMAIL PROTECTED]> http://www.google.com/apis/ wangyin wrote: > hi all: > Where do I get com.google.soap.search.*? > thanx! ========================================================================== TOPIC: version -> speed? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a63fd0f945fa2e4f ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 11:31 pm From: [EMAIL PROTECTED] (Peter) Hi Same java program, if i use jdk5.0 to compile it, it will run faster than compiled by 1.4.2? thanks from Peter ([EMAIL PROTECTED]) ========================================================================== TOPIC: Error during a POST to a servlet in weblogic http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c7fd3d60da3f6ed5 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 11:40 pm From: Frederic Houbie <[EMAIL PROTECTED]> Hi, I have a problem with Weblogic 8.1. In a servlet, I'm trying to connect to another server, doing a post request. URL serverUrl = new URL(request.getParameter("server")); HttpURLConnection Con = null; Con = (HttpURLConnection) serverUrl.openConnection(); OutputStream os = Con.getOutputStream(); DataOutputStream dos = new DataOutputStream(os); dos.writeChars(getRecordRequest); // which is line 80 dos.flush(); dos.close(); I tried setting BufferSize on response but no changes, I also modified MaxPostSize parameter in Weblogic console but no changes. Here is the stack trace. I'm using Weblogic 8.1 SP3 java.net.ProtocolException: Exceeding stated content length of 4202 at weblogic.net.http.ContentLengthOutputStream.write(ContentLengthOutputStream.java:31) at java.io.DataOutputStream.writeChars(DataOutputStream.java:275) at com.ionicsoft.wrs.querytutorial.GetRecordRequest.execute(GetRecordRequest.java:80) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:523) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) Thanks Frederic ========================================================================== TOPIC: Socket problem -- response slow for host with domain (on SunOS 5.8) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfb84c34caf0c9e9 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 12:03 am From: Babu Kalakrishnan <[EMAIL PROTECTED]> Nishi Bhonsle wrote: > > The constructor Socket smtpSocket = new smtpSocket("smtpServerVal", 25); > creates a stream socket ad connects it to the specified port number on the named host > here host = smtpServerVal (This is the Outgoing Mail Server hostname) > port=25. > (Got this information from java.net.Socket) > "smtpSocket" certainly not one of the java.net standard classes (And all Sun classes have names starting with a Capital letter). Nigel was assuming that it is a custom class that you wrote. Since you mention the java.net.Socket class, does your code by any chance read : Socket smtpSocket = new Socket(smtpServerVal, 25); ^^^^^^ instead ? (where smtpServerVal is the variable that holds the name) > > There is a firewall, but its the same for the windows machine too, so why would the > firewall on the solaris box cause such a big delay? > How can I check whether the DNS is working correctly on the machine? > > Is there a resolution? Since you say this happens only when you type names instead of an IP address, first thing one would suspect is a DNS resolution delay (though I can't really understand why it would fail "yahoo" quickly and "yahoo.com" after a delay - a smart resolver that understands invalid TLDs ???). It is possible that DNS is not setup properly on the Solaris machine ? Try running nslookup (or dig) from the commandline on the machine and see if similar delays occur. And if the name resolution fails on even well known domain names (like say yahoo.com) ask your system administrator to set the DNS right. (And if *you* have it to do it yourselves, make sure there is a "dns" entry in /etc/nssswitch.conf and that "nameserver" entries in the /etc/resolv.conf point to working DNS servers) BK ========================================================================== TOPIC: newbie RMI User http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/af49b3bdfce876e4 ========================================================================== == 1 of 2 == Date: Thurs, Sep 23 2004 12:09 am From: "paul.foreman" <[EMAIL PROTECTED]> Andrew, Just to let you know that I have got the applet working now. Thanks for your suggestions and help over the weekend. One of the problems was indeed the location of the class files for the server. Also the reference I gave the RMI registery - it should have been a html reference instead of a file reference. > > So, are the packages 'viewer2' and 'tm421_2nd'* > in the same directory? > > * which, by the way, is an horrific name for > a package. > Agreed :) == 2 of 2 == Date: Thurs, Sep 23 2004 12:20 am From: Andrew Thompson <[EMAIL PROTECTED]> On Thu, 23 Sep 2004 07:09:43 +0000 (UTC), paul.foreman wrote: >> * which, by the way, is an horrific name for >> a package. >> > Agreed :) ;-) Glad you got it sorted. ========================================================================== TOPIC: MathFP - atan2 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4568ec7fc8654bd8 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 12:26 am From: "Marek" <[EMAIL PROTECTED]> When I try use function atan2 form MathFP 2.0.5 or 2.0.5 I receive strange result. Below you can see test result form C(BC++5.5.1, and Delphi) and java(jdk 1.4) MathFP: atan2(toFP(1), toFP(1)) = 0.78539 atan2(toFP(1), toFP(-2)) = 2.67795 <- difference atan2(toFP(-1), toFP(1)) =-0.78539 atan2(toFP(-1), toFP(-1)) =-2.35619 <- difference C++/Delphi: atan2(1, 1) = 0.7854 atan2(1, -2) = -3.6054 <- difference atan2(-1, 1) = -0.7854 atan2(-1, -1) = -3.9270 <- difference Can you tell me why? What I do wrong? Irek ========================================================================== TOPIC: xml select on jdbc server http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8e064231dc684dac ========================================================================== == 1 of 2 == Date: Thurs, Sep 23 2004 12:55 am From: [EMAIL PROTECTED] (Tristan Buckmaster) hi, I was wondering whether there was an easy way to combining the results of SQL select statements on a database in the form of a xml document so I can transform the data into a html page using an xslt document. Thanks, Tristan == 2 of 2 == Date: Thurs, Sep 23 2004 1:13 am From: Paul Lutus <[EMAIL PROTECTED]> Tristan Buckmaster wrote: > hi, > > I was wondering whether there was an easy way to combining the results > of SQL select statements on a database in the form of a xml document > so I can transform the data into a html page using an xslt document. Yes, or you can simply read the database query result and create the HTML yourself. -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: map image??? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ec70f963b2ba3e79 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 1:02 am From: [EMAIL PROTECTED] (nuria) Ok thanks, but this is the problem I don“t know how do this... Michael Borgwardt <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > nuria wrote: > > > Is it possible to create image maps in java, i have an image with > > several parts and i want to have different action listeners for each > > section. I bascially want to create an image map as you would with an > > image in a HTMl page. > > > > > > All I really want to know is if this can be done and if yes how > > Of course it can be done. As for how, you'd probably draw the image on > a javax.swing.JPanel and register a java.awt.event.MouseListener to > react to clicks. ========================================================================== TOPIC: Using BigInteger http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7be97102e1c754 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 1:14 am From: "Jeremy Watts" <[EMAIL PROTECTED]> I've been trying to use the 'BigInteger' feature with no success - cant seem to find any examples of code that for instance adds or subtracts two big integer numbers. How do you actually use BigInteger to do arithmetic on large integer numbers?? Could someone give me some code examples please thanks ========================================================================== TOPIC: blanking a java.util.Date in 1.5 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b61c04b0e8db0fbf ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 1:26 am From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> [EMAIL PROTECTED] (Chris Murphy) writes: > //With 1.5 get [Sat Sep 25 12:00:00 EST 2004] > //With 1.4 got [Sat Sep 25 00:00:00 EST 2004] Looks like 1.5 formatting uses timezone information; however, from what I can tell, Australia spans GMT+8 to GMT+10; Are you in New Zealand or any other islands in the GMT+12 timezone? http://www.travel.com.hk/region/timezone.htm > //With 1.5 got [1096034400000] > //With 1.4 got [1096034400000] The timestamp long does not use timezones, but is GMT/UTC. ======================================================================= 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
