comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Needed library for Hijri <-> GregorianCalendar - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/40ec37cb37635d70 * what is a design pattern and a framework - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/94501b11b82cdbb2 * opinion on coding standard - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f96751a1d317c1a * JOption Pane/ How to check string - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b94c7b6218a6dd3 * Dual screen Java3D problem - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f102ab38f2f7ceaf * Decimal separator and Double.valueOf - 5 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/36f58c8877939f7e * [REPOST] java.awt.Image problem - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7f984034b7d7f294 * Ant vs Makefiles - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e81556a5c62ba767 * Maximum size of MappedByteBuffer in Java 5.0 64 bit - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6ee93ad14e4aa12c * java.rmi.server.hostname letter-figure problem - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/61da22c23f1157be ============================================================================== TOPIC: Needed library for Hijri <-> GregorianCalendar http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/40ec37cb37635d70 ============================================================================== == 1 of 2 == Date: Thurs, Dec 2 2004 12:53 am From: [EMAIL PROTECTED] Dears, I need a library for Hijri(Islamic Calendar) conversion from and to GregorianCalendar. Thanks == 2 of 2 == Date: Thurs, Dec 2 2004 10:17 am From: Michael Borgwardt [EMAIL PROTECTED] wrote: > I need a library for Hijri(Islamic Calendar) conversion from and to > GregorianCalendar. This package contains Calendar subclasses vor various non-Gregorian calendars including Hijri: http://oss.software.ibm.com/icu4j/ Then, all you need to do is parse dates with one and formate them with the other. ============================================================================== TOPIC: what is a design pattern and a framework http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/94501b11b82cdbb2 ============================================================================== == 1 of 2 == Date: Thurs, Dec 2 2004 12:59 am From: "Shriram" hi.. could any one explain what a design pattern means ... also what si COTS,frameworks,etc shriram == 2 of 2 == Date: Thurs, Dec 2 2004 10:24 am From: Michael Borgwardt Shriram wrote: > hi.. > could any one explain what a design pattern means ... An abstract, reusable and named description of a solution to a common design problem. > also what si COTS, Commercial off-the-shelf. Software you buy and customize yourself (or not at all) as opposed to having ir programmed or customized for you by the maker. > frameworks, A collection of software components and design conventions on how to use them which are supposed to save a lot of time when developing applications - usually frameworks are specialized on a particular kind of application. > etc You know, there's this really great thing called a "search engine". http://www.google.com/ ============================================================================== TOPIC: opinion on coding standard http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f96751a1d317c1a ============================================================================== == 1 of 3 == Date: Thurs, Dec 2 2004 10:02 am From: Michael Borgwardt Ann wrote: >>What in god's grace is a *VP* doing micromanaging stuff like coding >>standards? > > Haven't you heard? Using coding standards makes the stock price rise > compared to not using coding standards. Even as a ticklist feature, it doesn't make sense for the VP to decide *what* coding standards should be used. That's the job of the project leader, who'd hopefully let (or make) the developers reach a consensus. == 2 of 3 == Date: Thurs, Dec 2 2004 10:27 am From: "Tim Ward" "Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > What in god's grace is a *VP* doing micromanaging stuff like coding > standards? A company might decide that it wants uniform coding standards across all its operations, to make it cheaper to move staff about. To achieve this it might want or need the decision to be made by someone senior to all the techie groups who are each proposing that their own standard become the corporate one. This could be a VP. That's not micromanaging, that's strategic. -- Tim Ward Brett Ward Limited - www.brettward.co.uk == 3 of 3 == Date: Thurs, Dec 2 2004 11:49 am From: Michael Borgwardt Tim Ward wrote: >>What in god's grace is a *VP* doing micromanaging stuff like coding >>standards? > > > A company might decide that it wants uniform coding standards across all its > operations, to make it cheaper to move staff about. To achieve this it might > want or need the decision to be made by someone senior to all the techie > groups who are each proposing that their own standard become the corporate > one. This could be a VP. Should be the head of the development department, if there is a separate development department (it sounded like that). > That's not micromanaging, that's strategic. Making the decision on the particular coding standards on a non-tech management level is quite definitely micromanagement. If the tech groups can't agree on one and the development head is too cowardly to make the decision himself, it's their fault, but it's still micromanagement. ============================================================================== TOPIC: JOption Pane/ How to check string http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2b94c7b6218a6dd3 ============================================================================== == 1 of 2 == Date: Thurs, Dec 2 2004 4:06 am From: "Miller_Man" I am new to Java and my teacher wants us to use the JOptionPane to input data. It appears to only return a string. When I try to check in if statement I get errors. I figured out how to change a (string)number to an integer with parseInt but I can't convert string to a char to check in if statement. ie: if (answer == 'Y') gives me error string/ char mismatch Any help would be great. Thanks == 2 of 2 == Date: Thurs, Dec 2 2004 10:01 am From: Andrew Thompson On Thu, 02 Dec 2004 04:06:39 -0500, Miller_Man wrote: > I am new to Java c.l.j.help is thisaway.. <http://www.physci.org/codes/javafaq.jsp#cljh> >..and my teacher wants us to use the JOptionPane to input > data. It appears to only return a string. You can provide JOptionPane any arbitrary Object <http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JOptionPane.html#showMessageDialog(java.awt.Component,%20java.lang.Object)> "You can supply a JPanel with JTextField, JTextArea, JComboBox etcetera and simply query the state of the fields when the JOP returns. >..When I try to check in if > statement I get errors. I figured out how to change a (string)number to > an integer with parseInt but I can't convert string to a char to check in > if statement. > ie: if (answer == 'Y') gives me error string/ char mismatch 'Y' is the way to represent a char, to represent a String, use.. "Y". However, the way that you are comparing strings need fixing as well. When comparing Strings, always use.. if ( answer.equals("Y") ) { .... HTH -- 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: Dual screen Java3D problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f102ab38f2f7ceaf ============================================================================== == 1 of 1 == Date: Thurs, Dec 2 2004 10:16 am From: Jacob I have a dual screen setup. When I launch my Java app on screen 1 and select objects so that my Java3D canvas is instantiated everything is fine. However, if I first move the JFrame to the second screen and _then_ get the 3D canvas added, I get the following fatal exception: Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: adding a container to a container on a different GraphicsDevice at java.awt.Component.checkGD(Component.java:858) at java.awt.Container.checkGD(Container.java:1091) : What is the work around? Thanks! ============================================================================== TOPIC: Decimal separator and Double.valueOf http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/36f58c8877939f7e ============================================================================== == 1 of 5 == Date: Thurs, Dec 2 2004 10:15 am From: "Mel" Hi, I have a tricky decimal separator problem in java 1.2 When calling Double.valueOf("2.5"); everything is fine but on the second machine thios version Double.valueOf("2,5"); is correct. Obviously I have to consider localization settings. My first approach was to use the localized decimal separator char chDec = new DecimalFormatSymbols().getDecimalSeparator(); String ret = "2.5"; char chDec = new DecimalFormatSymbols().getDecimalSeparator(); if(chDec != ',') ret = ret.replace(',', chDec); if(chDec != '.') ret = ret.replace('.', chDec); Double.valueOf(ret); To my surprise this didn't work too because my machine can read Double.valueOf("2.5"); but the localised version looks like this Double.valueOf("2,5"); To get rid of the localisation settings I tried this version DecimalFormat df = new DecimalFormat(); DecimalFormatSymbols dfs = new DecimalFormatSymbols(); dfs.setDecimalSeparator('.'); df.setDecimalFormatSymbols(dfs); return df.parse(StrEnforceDecimalDot(strVal)).doubleValue(); This works fine on one machine but not on the other. Is there something wrong with the code. Machine 1 looks like this: WinXp German version -> Oracle9iRel2 -> Java running within Oracle Machine 1 looks like this: Unix -> Oracle9iRel2 -> Java running within Oracle What am I missing? Which strings can Double.valueOf parse per definition. I can't find a clear specification in the java doc. Do I have to consider Oracle NLS parameters? Thanks for any help. Mel == 2 of 5 == Date: Thurs, Dec 2 2004 10:34 am From: Michael Borgwardt Mel wrote: > What am I missing? > Which strings can Double.valueOf parse per definition. > I can't find a clear specification in the java doc. Use java.text.DecimalFormat instead. THat's what it's for (and Double.valueOf()) isn't! == 3 of 5 == Date: Thurs, Dec 2 2004 11:18 am From: "Mel" Thanks for your response. Double.valueOf returns a new double initialized to the value of the passed string. I pass the string "2.5" And I expect to get the value 2.5 why doesn't this work on each machine? java.text.DecimalFormat is intended for formatting numbers. I don't need number formatting, I just need to parse text strings like "2.5" "34.7" "78.56" without being affected from localisation. "Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Mel wrote: > What am I missing? > Which strings can Double.valueOf parse per definition. > I can't find a clear specification in the java doc. Use java.text.DecimalFormat instead. THat's what it's for (and Double.valueOf()) isn't! == 4 of 5 == Date: Thurs, Dec 2 2004 11:41 am From: Michael Borgwardt Mel wrote: > Double.valueOf > returns a new double initialized to the value of the passed string. > > I pass the string "2.5" > And I expect to get the value 2.5 > why doesn't this work on each machine? Actually, it should. According to the API doc, Double.valueOf expects the input to be floating point literals according to the Java Language Specification. Which is not locale-dependant. If it doesn't work on your machine, then either you are not calling the method you think you're calling, not passing it the String you think you're passing it, or your Java implementation is broken. > java.text.DecimalFormat is intended for formatting numbers. *and* parsing them. It allows you full control over the parsing process. == 5 of 5 == Date: Thurs, Dec 2 2004 12:02 pm From: "Mel" Thanks Double.valueOf ("2.5"); is independent of any localisation and works everywhere This statement will actually help me Thanks "Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Mel wrote: > Double.valueOf > returns a new double initialized to the value of the passed string. > > I pass the string "2.5" > And I expect to get the value 2.5 > why doesn't this work on each machine? Actually, it should. According to the API doc, Double.valueOf expects the input to be floating point literals according to the Java Language Specification. Which is not locale-dependant. If it doesn't work on your machine, then either you are not calling the method you think you're calling, not passing it the String you think you're passing it, or your Java implementation is broken. > java.text.DecimalFormat is intended for formatting numbers. *and* parsing them. It allows you full control over the parsing process. ============================================================================== TOPIC: [REPOST] java.awt.Image problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7f984034b7d7f294 ============================================================================== == 1 of 3 == Date: Thurs, Dec 2 2004 11:02 am From: "Andrei Kouznetsov" > I am double buffering an image which represents an horizontal table, as > you > might expect this could get really wide. If the table changes (row deleted > or added) I redraw the buffer otherwise I only draw the image that's in > the > buffer. may be you should read this article: http://java.sun.com/products/jfc/tsc/articles/ChristmasTree/ -- 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 == 2 of 3 == Date: Thurs, Dec 2 2004 3:29 am From: "MaSTeR" > I think I lost you there. Do you mean to say that the display looks > damaged even when you force a refresh by doing the above ?? I'd expect > the display to become trashed as soon as it is updated from the other > thread, and continue to be that way till something else (like the > iconizing / restoring) forces it to refresh itself (at which point it > should display properly). If this is the observed behaviour, that isn't > very surprising at all. Proper synchronization should fix the issue. > That's exactly what I would expect from a sync issue. Unfortunately it behaves the opposite way (!). When I redraw the buffer from scratch it paints correctly and as soon as I refresh it (by scrolling it manually or forcing repainting in any ither way) it gets corrupted. Also I tried some extreme synchronization measure like sync the whole methods and didn't work, it just slowed down insertion of new records. > >>Also I assume you're also ensuring that the paint() method gets called > >>from the update() method. (i.e. if you're overriding update). > >> > > > > I do, the super class implementation clears the screen, causing flickering > > and it was unnecessary since my ticker repaints the whole area. > > > > This means that the way you're performing double buffering is broken. > The clearing of the screen is exactly what you *avoid* by using double > buffering. > Not sure about this last point, I do avoid clearing of the screen by overriding update in this way: // Overrides this method to prevent the superclass to clear the screen at each repaint. public void update(Graphics g) { paint(g); } == 3 of 3 == Date: Thurs, Dec 2 2004 11:41 am From: "MaSTeR" "Andrei Kouznetsov" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I am double buffering an image which represents an horizontal table, as > > you > > might expect this could get really wide. If the table changes (row deleted > > or added) I redraw the buffer otherwise I only draw the image that's in > > the > > buffer. > > may be you should read this article: > http://java.sun.com/products/jfc/tsc/articles/ChristmasTree/ > Very interesting article, unfortunately using swing is not an option for me. I had to rewrite myself a sorta of many classes described in there. ============================================================================== TOPIC: Ant vs Makefiles http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e81556a5c62ba767 ============================================================================== == 1 of 1 == Date: Thurs, Dec 2 2004 11:35 am From: Jacob Harris L wrote: > Hi, > > I am working on a project that is written in Java but it's mainly used > in Unix environments and uses Makefiles to build. > > I want to develop on this project in a Windows environment and I want > to: > > ***Convert the Makefiles into Ant Build files*** I see no particular good reason to switch to Ant. If you install Cygwin on your Windows box, your makefiles should work just fine. For a Makefile framework well suited for Java development, check http://geosoft.no/development/javamake.html ============================================================================== TOPIC: Maximum size of MappedByteBuffer in Java 5.0 64 bit http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6ee93ad14e4aa12c ============================================================================== == 1 of 1 == Date: Thurs, Dec 2 2004 11:36 am From: "Boudewijn Dijkstra" "The POWER of 2WO" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > If Java 5.0 can allocate only 2G ByteBuffers, can it allocate a pool > of ByteBuffers, whose sum is 512G ? Probably. But note that a ByteBuffer may be larger than 2G, but the standard ones are implemented as a single array. Arrays are limited to 31-bit indices. ============================================================================== TOPIC: java.rmi.server.hostname letter-figure problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/61da22c23f1157be ============================================================================== == 1 of 1 == Date: Thurs, Dec 2 2004 11:47 am From: David Murko dear all, ich have a strange problem (for me) when starting jboss (3.2) with the 'java.rmi.server.hostname' parameter. i start jboss with run.sh and this parameters: #### . . . # Execute cd $JBOSS_HOME/bin $JAVA \ -Xms1500M -Xmx1500M -Xss256k \ -ea -esa -server \ \ -Djava.awt.headless=true \ . . . -Djava.rmi.server.hostname=server.nice4you.com" \ -Djava.rmi.server.useLocalHostname=false \ -classpath "$JBOSS_CLASSPATH" \ \ -Djava.io.tmpdir=../server/default/tmp \ \ $JAVA_OPTS \ $JBOSS_OPTS \ \ org.jboss.Main "$@" \ >> $JBOSS_LOG 2>&1 & . . . #### and the 'java.rmi.server.hostname' value 'server.nice4you.com' was ignored, but when i use this value 'server.niceyou.com' instead it works. so my question: is there a problem with a letter-figure combination and when yes, is there a workaround for this. with regards, davidm ============================================================================== 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
