comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * MathFP - atan2 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4568ec7fc8654bd8 * MVC - controller - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8de48c520823ca6b * Why can't static methods be overridden? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f211d387a7676de * read binary data from C file??? - 4 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c04d04f749f5ae1f * Improving website responsiveness. - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f719ebe188f50463 * overriding inner classes - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3fe8aa87a5e9b71d * OT: game programmer SALARY - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/87940bc0e58ea09 * Simple multiuser java database - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76285f28cb4423bf * navigate to webpage and capture whole screen to a JPEG? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8b394e001e6cf553 * Preventing multiple instance standalone desktop gui applications - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/afa857e018f3780 * Rational Rose - physical Table to java - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4743ac7852021b7a * how do i mute audio input? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c7606744b24c6e7f * Rational Rose Help - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/98d1761de28597de * JList problem - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/72da84dc06d2c08b * Question About LinkedList - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7190a07093aa978f * Problem with a simple CMP bean while working on JBoss - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8fb2455973de436 * OutOfMemoryError -- how to trap - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/724b6eb292f841c3 * j2se 1.5 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/14c9f2340716e66d ========================================================================== 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 8:09 am From: Paul Lutus <[EMAIL PROTECTED]> Marek wrote: > >> Show me the source for the method you are using here. What is toFP()? >> What is atan2(), because it is not Math.atan2(). You are asking for >> advice > about >> a package you do not provide any information about. > I haven't external package source, only class files. > >> Why are you not using the standard Java classes that are provided for >> this purpose? > Because I develop programs for J2ME. This platfom haven't float point > arithmetic. > > Why are you not telling the maintainers of this package that their > They don't answer me Umm, first, please quote your posts according to convention, and second, if you cannot get the source, and if the maintainers won't reply to your inquiries, I strongly advise against using this package. It is a bug, some may argue not terribly significant, but their unwillingness to reply/react speaks volumes. > >> code is broken (http://jscience.org)? > Maybe > >> As a last resort, you could show us the source for the methods you are >> using, so we can tell you how its programmers went wrong. If you cannot > get >> the source, maybe it would be better if you didn't use this package. > I need ArcTan2 function work without float point arithmetic. Cal you tell me again wny you cannot use Java's Math package? -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: MVC - controller http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8de48c520823ca6b ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 8:10 am From: "VisionSet" <[EMAIL PROTECTED]> Briefly I have a controller that instantiates swing models and the view. The models are registered with the view, and further event driven updates are handled by swings internal event mechanism. The view has inner action classes that generally call the controller which initiates business processes. All standard stuff hopefully. Now in more detail. I have Swing models (eg ComboBoxModel, TableModel) that I have implemented as separate classes, extending AbstractTableModel for example. These are instantiated by the controller at startup and passed to the view which does eg myJTable.setModel(myTableModel). When an Action is triggered the views inner Action class calls the controller via a controller interface - decoupling controller and view. The controller then calls one of its TaskControllers which creates a new inner Task instance that threads a new long business process (network call) and then updates the GUI on the event thread. My Controller acts as Mediator? for View, Swing Models, and the TaskControllers. The abstract Task class is similar to Suns SwingWorker class. It has two abstract methods one runs in a new thread and does the long task, the other is called at the end of the former but runs on the event thread to update the GUI (by updating the model). Originally my Controller was full of innerclass subclasses of Task. So I factored them out into there own top level classes. The controller creates an instance of a TaskManager at startup which has attribute such as SwingModels and the main Controller. When the controller decides to perform a business process it calls the task manager to do the task, the task manager has an inner Task subclass and one of these is instantiated each time the business process is required. I was trying to get away from inner classes, but it seems they perfect here, I didn't think it was a good idea to keep passing parameters where the reference is known to be unchanging. Therefore the TaskManager class is there soley to encapsulate the initial controller attributes relevent to the task it manages. Am I making any sense or do you want a link to UML? If all that is understandable, is it a sensible design? class Controller { TableModel aSwingModel; TaskManager tm; Controller() { tm = new TaskManager(aSwingModel); } void doTask { tm.doTask(); } } class TaskManager { TableModel aSwingModel; doTask() { new Taskette(); } private class Taskette extends Task { // change and update aSwingModel } } -- Mike W ========================================================================== TOPIC: Why can't static methods be overridden? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f211d387a7676de ========================================================================== == 1 of 2 == Date: Thurs, Sep 23 2004 8:15 am From: "John C. Bollinger" <[EMAIL PROTECTED]> Chris Uppal wrote: > No. The "static" concept in Java is designed to be misleading. Ask yourself I've never heard it put quite that way before. :-) > The way I like to think of it is that the "class" is a separate object from all > its instances, and that it's of a different class (one with no name), and that > the static methods and fields are "really" instance members of that class > object. (Smalltalk programmers will recognise this picture.) I'm not a Smalltalk programmer, but I have come to exactly the same mental model. As you say (elided) that model can be misleading, especially if pushed too far or if incorrect assumptions are made (e.g. about there being any inheritance relationships among the hypothetical class classes). Nevertheless, to a first approximation it does a good job of explaining the nature and use of classes' static members. > Yes, it's because "static" in Java has nothing to do with -- in fact is > antithetical to -- OO concepts and OO programming. That sounds a bit strong, but after thinking about it I have to agree. John Bollinger [EMAIL PROTECTED] == 2 of 2 == Date: Thurs, Sep 23 2004 8:51 am From: Joona I Palaste <[EMAIL PROTECTED]> John C. Bollinger <[EMAIL PROTECTED]> scribbled the following: > Chris Uppal wrote: >> The way I like to think of it is that the "class" is a separate object from all >> its instances, and that it's of a different class (one with no name), and that >> the static methods and fields are "really" instance members of that class >> object. (Smalltalk programmers will recognise this picture.) > I'm not a Smalltalk programmer, but I have come to exactly the same > mental model. As you say (elided) that model can be misleading, > especially if pushed too far or if incorrect assumptions are made (e.g. > about there being any inheritance relationships among the hypothetical > class classes). Nevertheless, to a first approximation it does a good > job of explaining the nature and use of classes' static members. However, with a bit of practice, the Smalltalk object model can be simulated using Java. You just have to use regular objects as class objects and then pass a reference to them to any "normal" objects you create. -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/ "You have moved your mouse, for these changes to take effect you must shut down and restart your computer. Do you want to restart your computer now?" - Karri Kalpio ========================================================================== TOPIC: read binary data from C file??? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c04d04f749f5ae1f ========================================================================== == 1 of 4 == Date: Thurs, Sep 23 2004 8:20 am From: John Adams <[EMAIL PROTECTED]> Gordon Beaton wrote: > On Wed, 22 Sep 2004 16:53:23 -0400, John Adams wrote: > >> I have to write a client end in java reading data sent over UDP >>from a server (the server is written in C). The data format is a C >>struct with all the fields including long, int, float, etc. I got >>the data in the java client end in the format of a DatagramPacket, >>then I convert it to a byte array. Now the question is, how do I >>extract each field from the byte array? > > > Others have already pointed out how you can read the data, however > it's worth mentioning that if the server gets recompiled with a > different compiler, or moved to a different platform (with no changes > to the data types) it could break your client. > > The real solution is to change the server so that it doesn't write the > data in a format that is quite so compiler and platform dependent. > > Writing raw binary data directly from a C struct is lazy, fragile and > non-portable. And as you've already discovered, it makes it difficult > and error prone to write a client in a different language, that > doesn't use the same compiler, or that will run on a different > hardware platform. > > /gordon > Hi, Thank you all for your invaluable advice. To date, I have seemed to try all the methods mentioned: Array, ByteBuffer, DataInputStream, ByteArrayInputStream, intBitsToFloat(), etc. I had, ofcourse as Michael Borgwardt so "brilliantly" pointed out, tried putting some values on the server side and dumping them out on the client side (That is HOW I know they are not the same!!!). Flatform and hardware also are not the concern since I had tried running the server on the very same intel machine as the client (just to debug). Endianess is also out of question in this scenario. This is how I do it: // The data format from a C server. // To make thing simple, I make all fiels float typede struct { float something; float some_other_thing; ... } // class to convert data on the java end public class StructureInputStream extends ByteArrayInputStream { static int curr = 0; private DataInputStream dis = null; public StructureInputStream(byte[] b) { super(b); curr = 1; dis = new DataInputStream((InputStream)this); } public final long readLong() throws IOException, EOFException { return dis.readLong(); } public final double readDouble() throws IOException, EOFException { return dis.readDouble(); } public final int readInt() throws IOException, EOFException { return dis.readInt(); } public final int readUnsignedShort() throws IOException, EOFException { return dis.readUnsignedShort(); } public final float readFloat() throws IOException, EOFException { return dis.readFloat(); } public final short readShort() throws IOException, EOFException { return dis.readShort(); } public final char readChar() throws IOException, EOFException { return (char)dis.readByte(); } public void skipBytes(int n) throws IOException { int num_bytes_to_skip = n; int x = 0; do { x = dis.skipBytes(num_bytes_to_skip); num_bytes_to_skip -= x; } while (num_bytes_to_skip>0); } } // And how the UDP client gets data // try - catch blocks are omitted for clarity DatagramPacket pkt = new DatagramPacket(buffer, buffer.length); socket.receive(pkt); byte[] data = pkt.getData(); StructureInputStream t = new StructureInputStream(data); float a1 = t.readFloat(); t.skipBytes(4); float a2 = t.readFloat(); t.skipBytes(4); float a3 = t.readFloat(); t.skipBytes(4); float a4 = t.readFloat(); t.skipBytes(4); // print out ... Again, thank you all for your advice. Regards, == 2 of 4 == Date: Thurs, Sep 23 2004 9:15 am From: Paul Lutus <[EMAIL PROTECTED]> John Adams wrote: / ... > Thank you all for your invaluable advice. To date, I have seemed to > try all the methods mentioned: Array, ByteBuffer, DataInputStream, > ByteArrayInputStream, intBitsToFloat(), etc. I had, ofcourse as Michael > Borgwardt so "brilliantly" pointed out, tried putting some values on the > server side and dumping them out on the client side (That is HOW I know > they are not the same!!!). Okay, to restate a point made by someone else, why are you trying to transfer the data in binary form? Why not make the server emit the data in plain-text form? This is a much more robust solution, one that is immune to nearly all the issues that are occupying your thinking right now. In other words, you may spend months debugging this binary transfer solution, only to see your work entirely unraveled by a revision in a future compiler, or you can use plain text and be done with it. -- Paul Lutus http://www.arachnoid.com == 3 of 4 == Date: Thurs, Sep 23 2004 9:41 am From: "Will Hartung" <[EMAIL PROTECTED]> "Paul Lutus" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Okay, to restate a point made by someone else, why are you trying to > transfer the data in binary form? Why not make the server emit the data in > plain-text form? This is a much more robust solution, one that is immune to > nearly all the issues that are occupying your thinking right now. > > In other words, you may spend months debugging this binary transfer > solution, only to see your work entirely unraveled by a revision in a > future compiler, or you can use plain text and be done with it. The choice of format may well be out of the hands of the guy with the problem. Could be a legacy or 3rd party application. The fact that there may be other, more appropriate ways to transfer data doesn't necessarily lessen the need for someone to do exactly what he's asking. Regards, Will Hartung ([EMAIL PROTECTED]) == 4 of 4 == Date: Thurs, Sep 23 2004 9:55 am From: Paul Lutus <[EMAIL PROTECTED]> Will Hartung wrote: / ... > The choice of format may well be out of the hands of the guy with the > problem. Could be a legacy or 3rd party application. > > The fact that there may be other, more appropriate ways to transfer data > doesn't necessarily lessen the need for someone to do exactly what he's > asking. Yes, but we don't know that, and the OP may not know the advantages of plain text. Therefore someone needed to mention it. -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: Improving website responsiveness. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f719ebe188f50463 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 8:33 am From: Rico <[EMAIL PROTECTED]> On Wed, 22 Sep 2004 11:51:02 -0700, Will Hartung wrote: >> I'll keep you Guys updated how things turn out after I've fixed that >> mess. > Good luck! Let us know! So, what do you think happened Will? :-) The page I worked on is the very first page that everyone accesses after the login. Doesn't sound like 'once in a blue moon', right? And it's not "early in development" here. In that JSP page I had identified a couple of functions that were part of the problem. It is my understanding that just because I didn't notice a difference you think it means that I modified the wrong method because it's not "ACTUALLY slow" there. Did you consider that it's not "ACTUALLY slow" _only_ there? After modifying another 4 or 5 such similar methods, I achieved what I wanted. Rico. ========================================================================== TOPIC: overriding inner classes http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3fe8aa87a5e9b71d ========================================================================== == 1 of 2 == Date: Thurs, Sep 23 2004 8:24 am From: "P.Hill" <[EMAIL PROTECTED]> Tom wrote: > Doesn't java support overriding inner classes? Overriding is not a concept that applies to classes. You must subclass the inner class. > // inner class > private class LocalClass{ So what class are you suggesting this class should be the subclass of? Would you like to tell the compiler your answer? -Paul == 2 of 2 == Date: Thurs, Sep 23 2004 8:26 am From: "Adam" <[EMAIL PROTECTED]> > Doesn't java support overriding inner classes? > > // BEGIN EXAMPLE > // class code ------------------------------------------ > > public class ClassA{ > LocalClass instance; > > // inner class > private class LocalClass{ > public void doit(){ > System.out.println("Hello"); > } > } > > ClassA(){ > instance = new LocalClass(); > } > > public void doit(){ > instance.doit(); > } > } > > public class ClassB extends ClassA{ > LocalClass instance; > > // inner class > private class LocalClass{ > public void doit(){ > System.out.println("Goodbye"); > } > } > } > > public class Main > { > public static void main(String[] args){ > ClassA ca; > ClassB cb; > > ca = new ClassA(); > cb = new ClassB(); > > ca.doit(); > cb.doit(); > } > } 1. There is no such thing like overriding a class, so I don't know what do you mean by that. 2. You haven't constructed anywhere in your code an instance of ClassB.LocalClass, so dont count on executing any code from that class. 3. In you code, ClassB has a- definition of an inner class ClassA.LocalClass (derived from ClassA, but invisible - marked private) b- definition of an inner class ClassB.LocalClass (unrelated to above) c- reference of type ClassA.LocalClass called 'instance', derived from ClassA, invisible (private in superclass), referencing a ClassA.LocalClass object created in ClassA constructor d- reference of type ClassB.LocalClass, pointing to null That is really messy, and proves nothing. Calling cb.doit() calls doit() on reference mentioned in point c, and Hello is printed. Anyway, I think what you mean is: /// InnerOverride.java class Base{ protected class InnerBase{ void doit(){ System.out.println("Hello"); } } void doit(){ getInner().doit(); } InnerBase getInner(){ return new InnerBase(); } } class Derived extends Base{ protected class InnerDerived extends InnerBase { void doit() { System.out.println("GoodBye"); } } InnerBase getInner(){ return new InnerDerived(); } } public class InnerOverride{ public static void main(String[] args) { Base one = new Base(); Base two = new Derived(); one.doit(); two.doit(); } } ///end of code Adam ========================================================================== TOPIC: OT: game programmer SALARY http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/87940bc0e58ea09 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 8:23 am From: Miss Elaine Eos <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, Scott Ellsworth <[EMAIL PROTECTED]> wrote: > > I will discuss job offer with a game company soon. Please post how > > much I should bargain for. > > Good luck, and congrats. This would be many people's dream job. > > > -job title: port engineer (j2me, Brew phone games) > > -at San Francisco > > Ok - the very best thing you can do is ask friends who graduated the > year before with your major and grades what they are getting. They may > tell, they may not. Or you could ask the HR person at the company "what is the salary range for this position?" There's really nothing you can do about it, anyway -- but if you know that the range is from X to Y, you can at least get a feel for what they think of your skills by where they offer you in that range. While I agree with the other poster that ~40k is about right for a college hire, they might try to come in slightly below that, on the thought that giving you a raise from 39,800 to 40,200, while it's ridiculously small (1%), has a large "feel" to it, in that it crosses the 40k boundary. Also, don't get caught up in nit-picky -- if you want 40k and they're offering 39,800, don't make a big deal over $200/yr ($4/week!) What you MIGHT do, if they offer less than you indicate you'd like, is ask "what incentive programs are available to me to help me make up the difference (bonuses, etc), and what do I have to do to get them?" The question's not as flip as it may sound -- if a company thinks you're worth $35k and you think you're worth $45k, but they obviously feel that SOMEONE is worth $45k (or more -- even $55k!), ask point blank "what skills do I need to demonstrate to be the kind of person that you pay $55k?" Or, if you're feeling fancy, "I feel I'm worth $45k, and I'd like a chance to prove it to you. Tell me what skills I need to demonstrate in the first three months in order to get a retroactive salary increase." (No one will offer you a retroactive salary increase, but they may be willing to offer a normal increase, and a bonus for the difference.) The point is: everything is negotiable. Don't try to over-sell what you have, and don't let them try to under-bid what they're getting. Luck! -- Please take off your shoes before arriving at my in-box. I will not, no matter how "good" the deal, patronise any business which sends unsolicited commercial e-mail or that advertises in discussion newsgroups. ========================================================================== TOPIC: Simple multiuser java database http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/76285f28cb4423bf ========================================================================== == 1 of 3 == Date: Thurs, Sep 23 2004 8:38 am From: [EMAIL PROTECTED] (Robert) I have written a no frills console math app that I would like to run from multiple computers. I need help in replacing two methods that store and retrieve data. I am currently using an array for writing/reading strings but I need to replace the array with a database. For various reasons I don't want to get wrapped up in configuring and managing a SQL database but need to distribute this classs to multiple computers. I'd like to find a small efficient database that doesn't require the complexity of jdbc calls from my app but will allow tcp calls for remote instances. Robert == 2 of 3 == Date: Thurs, Sep 23 2004 9:06 am From: Paul Lutus <[EMAIL PROTECTED]> Robert wrote: > I have written a no frills console math app that I would like to run > from multiple computers. I need help in replacing two methods that > store and retrieve data. I am currently using an array for > writing/reading strings but I need to replace the array with a > database. For various reasons I don't want to get wrapped up in > configuring and managing a SQL database but need to distribute this > classs to multiple computers. I'd like to find a small efficient > database that doesn't require the complexity of jdbc calls from my app > but will allow tcp calls for remote instances. If you want a database that is accessible by way of TCP calls, the next questions are whether you intend to write it yourself, whether it will be written in java, and whether the clients will read only or possibly modify the database. If the database requirement can be met by simply retrieving flat-file records and no interactive writing will be done, this is very simple. If you have to retrieve many records, or retrieve using any database-specific methods such as SQL queries, or write to the database, this becomes much more complex. So, in summary, you need to define the problem more clearly. Start by moving beyond saying what it is not. -- Paul Lutus http://www.arachnoid.com == 3 of 3 == Date: Thurs, Sep 23 2004 10:02 am From: John Davison <[EMAIL PROTECTED]> Robert wrote: > I have written a no frills console math app that I would like to run > from multiple computers. I need help in replacing two methods that > store and retrieve data. I am currently using an array for > writing/reading strings but I need to replace the array with a > database. For various reasons I don't want to get wrapped up in > configuring and managing a SQL database but need to distribute this > classs to multiple computers. I'd like to find a small efficient > database that doesn't require the complexity of jdbc calls from my app > but will allow tcp calls for remote instances. > > Robert Go here: http://freshmeat.net/browse/67/ (or navigate Freshmeat.net->Browse->Database->Database Engines/Servers) - john ========================================================================== TOPIC: navigate to webpage and capture whole screen to a JPEG? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8b394e001e6cf553 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 8:44 am From: Andrew Thompson <[EMAIL PROTECTED]> On Thu, 23 Sep 2004 10:18:07 -0400, Flip wrote: > I would like to create a dynamic screensaver which would > show me the latest CSI webpage This? <http://www.cbs.com/primetime/csi/main.shtml> (An URL speaks a thousand words, Flip) >..on my monitor. If that's the page, Robot screencapture and the JEditorPane* are probably out of the question.. * <sscce> import javax.swing.*; import java.net.URL; import java.io.IOException; /** Display CSI web page. */ class Browser extends JFrame { public Browser(URL url) throws IOException { super("Adding HTML to a JEditorPane"); getContentPane().add( new JEditorPane(url) ); setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE); pack(); validate(); } /** Instantiate this class. */ public static void main(String[] args) throws Exception { URL url = new URL("http://www.cbs.com/primetime/csi/main.shtml"); Browser b = new Browser(url); b.setVisible(true); } } </sscce> -- 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: Preventing multiple instance standalone desktop gui applications http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/afa857e018f3780 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 8:56 am From: Paul Lutus <[EMAIL PROTECTED]> Kent Yang wrote: > I need to have only one instance of a Desktop GUI application running. > What is the best way to do this? The only answer I can find > searching throught the archives was to use a socket. Is this the best > way? That depends. I often use a flag file. This has the advantage that, in a multi-user environment, each user has a separate flag file, so each user can only have one instance running, but there can be as many single instances as there are users. I put the flag file in the user's home directory under a subdirectory with the same name as the application, a scheme that has been worked out in Linux/Unix environments over time, and one that works fine in Windows as well. -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: Rational Rose - physical Table to java http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4743ac7852021b7a ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 8:59 am From: [EMAIL PROTECTED] (Jim) Hi, I have a set of physical Oracle tables with Foreign and Primary Keys. I know rational rose will "reverse engineer" my tables, but can it then create Java classes for each of my tables? I don't have a physical model nor I plan to convert or design the imported physical model to a logical model. Can rational Rose do this - where can I find this information? Are there any newsgroup (not IBM forums) where I may post the question if nobody knows how to answer my question? Thank you for any help in advance. James. ========================================================================== TOPIC: how do i mute audio input? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c7606744b24c6e7f ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 9:04 am From: [EMAIL PROTECTED] (Wayne's World) hi everybody, i'm searching around now for two weeks, for a proper way, to mute the audio input with java. i'm writing java program that generates a television program. the program uses a MySQL db to read the playlist for today and remote controls VLC (www.videolan.org). i'm now working on an extension, that some of the playlist entries are standing for live-tv, on whitch the pc display's the signal, gainded on the tunerinput on a hauppauge WinTV extreme. and there it is, where i have a problem. i'm currently developing this under WinXP and, because VLC and VLS supports DVB-cards only under Linux i need an application, that display's the input of my tv-card on the screen. i tried DScaler (a real unstable solution), ProgDVB (that doesn't support hauppauge's WinTV) and media player classic (has no startup parameters to display the input at application start; you have to choose it in the menu). so i have to stay on the application, delivered with the WinTV card: WinTV2000 however, when live tv should start, my java app runs: Process winTV2000 = Runtime.getRuntime().exec("c:\\Programs\\WinTV2000\WinTV2k.exe"); when the live session ends, i call winTV2000.destroy(); and there is my problem. that call doesn't quit the application, it destroy's the process of the application. that has the consequence, that the audio input of my soundcard, the tv-card is sending the audiosignal to, stay's open and the audio playback doesn't stop. i have to mute the audio input manualy. i thought, that has to be solved with java.sound.sampled, where i can get my AudioMixers and their Port.Info.LINE_IN's. but that ports have no controls. non of my mixers has any usable control. the one and only control from all of my mixers i can get is a ReverbControl and that shurely isn't what i need. i tried many way's to get a linein with some controls, unfortunately unsuccessful. neither a BooleanControl (for muting a port) nor a FloatControl (for volume-changing) is supported by any of my mixers. i think, searching the JMF-Framework wouldn't help me much, because JMF sets up on java.sound and has therefor the same problems (tell me, if i'm wrong there). i also tried to find out, if i can gain control of the audio mixer by activex, but i didn't find the corresponding COM-object to do that. sadly, i don't have neither much experience in programming c++ nor i have visual studio, to programm native code for that. i would appreciate any help on my problem. how can i make my WinTV shut up??? thanks for your help wayne ========================================================================== TOPIC: Rational Rose Help http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/98d1761de28597de ========================================================================== == 1 of 2 == Date: Thurs, Sep 23 2004 9:04 am From: [EMAIL PROTECTED] (Jim) Hello, Does anybody know where can I get information for Rational Rose - actual help? I have questions, but I don't know where to get help - I am using a trial so I don't have access to any IBM support. Thank you for any help, James. == 2 of 2 == Date: Thurs, Sep 23 2004 9:50 am From: Paul Lutus <[EMAIL PROTECTED]> Jim wrote: > Hello, > > Does anybody know where can I get information for Rational Rose - > actual help? I have questions, but I don't know where to get help - I > am using a trial so I don't have access to any IBM support. Google "Rational Rose". 146,000 hits. -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: JList problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/72da84dc06d2c08b ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 9:08 am From: Paul Lutus <[EMAIL PROTECTED]> Mika Suomi wrote: > class AsiakasListaHndl implements ListSelectionListener{ > public void valueChanged(ListSelectionEvent e) { > JList jlst= new JList(lstCustomers); > String name=(String) jlst.getSelectedValue(); > System.out.println(name);}} > > This is code in listener and when I click a customer in list it gives the > result twice.First when I click mouse second when I release mouse.Why??? The problem is located in the code you didn't post. -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: Question About LinkedList http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7190a07093aa978f ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 9:09 am From: "John C. Bollinger" <[EMAIL PROTECTED]> Edward H. Fabrega wrote: > "Edward H. Fabrega" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>"Edward H. Fabrega" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >>>My program will implement a flat file database (non-relational). I >>>haven't started to code yet, as I'm transitioning from C++ MFC to Java. >>>Using MFC I was able to do this with a linked list of StringArrays. In >>>Java, I'm thinking about doing it with a LinkedList of ArrayLists, where >>>each item in each ArrayList is a String. This will model the records. I >>>will have a simple ArrayList to model the column labels. >>> >>>My question is: is there a better data model for a database that is >>>achievable with the API? A store bought component or something from a >>>third party API is not possible. I'm not worried about the UI at this >>>point, only the data. >> >>In my previous post, "My question is: is there a better data model for a >>database that is ..." >> >>should read: "My question is: is there a better data model for a flat file >>database that is..." >> > > > One FINAL stipulation. I can't do an array of arrays because the database > must be dynamic, in the sense that records can be added, deleted, plus the > number of fields must be changeable. So I must be able to vary the size of > the ArrayLists in the LinkedList, and the size of the LinkedList itself that > is made up of the ArrayLists. You have not even come close to specifying all your requirements. I suspect that the term "database" has a very specific meaning to you, at least in this context, but it does not illuminate us very well. Enumerate (for yourself) all the functional requirements, and determine how well your proposed model will handle them. If you need help with such an evaluation then ask some more specific questions here. To get you going, here are some of the key characteristics of the two main List implementations: ArrayList --------- ()Indexed element access is fast (constant time). ()List additions (at the end) sometimes require copying the entire backing array (to a larger array), but usually not. Adding a large number of elements is O(log N), if I've worked it out right. ()List insertions (not at the end) require moving the elements at and after the insertion position, and sometimes requires moving all the elements (when a larger array is required). ()List deletions usually require moving some or all of the elements of the backing array to new positions (O(N)). LinkedList ---------- ()Indexed element access is slow (O(N) for random indices) because the List must be traversed from one end to the desired element. The specific cases of access to the first and last elements are fast, however. ()Additions and deletions at beginning or end are O(1) ()_Indexed_ additions and deletions are O(N) for random indices, because of the time required to traverse the list to the appropriate location. ()List mutations never require copying the backing data structure. ()The List's ListIterator is your friend. Use it instead of indexes wherever possible. HTH John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: Problem with a simple CMP bean while working on JBoss http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8fb2455973de436 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 9:14 am From: [EMAIL PROTECTED] (Tomer Ben-David) [EMAIL PROTECTED] (Subra) wrote in message news:<[EMAIL PROTECTED]>... > Problem with a simple CMP bean while working on JBoss > > CLIENT : EmployeeSalInsertClient.java > CMP Jar: emp > ------------------------------------------------ > Database : MS SQL SERVER > Table Name is : emp > Column names: > eno - int > ename - varchar(30) > esal - float > > It is a simple ejb......... > able to insert the records into the database............. > unable to find records.................. > > The error is given below > > C:\javajava -classpath > > .;D:\jboss-3.2.4\server\default\lib\jboss-j2ee.jar;D:\jboss-3.2.4\serv > > er\default\lib\jbossall-client.jar;D:\jboss-3.2.4\server\default\lib\jnet.jar; > EmployeeSalInsertClient > Exception in thread "main" javax.ejb.FinderException: Unknown query: > public > abstract emp.Employee > emp.EmployeeHome.findByPrimaryKey(java.lang.Integer) > throws java.rmi.RemoteException,javax.ejb.FinderException > at > > sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.jav > a:245) > at > > sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220) > at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122) > at > org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown > Source) > at > > org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java: > 135) > at > > org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96) > at > > org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46) > at > > org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:53) > at > org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173) > at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85) > at $Proxy0.findByPrimaryKey(Unknown Source) > at > EmployeeSalInsertClient.main(EmployeeSalInssimertClient.java:34) do you have a findByPrimaryKey method in your bean home interface ? ========================================================================== TOPIC: OutOfMemoryError -- how to trap http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/724b6eb292f841c3 ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 9:12 am From: Dimitri Maziuk <[EMAIL PROTECTED]> D. Alvarado sez: > Hello, I understand that you cannot try/catch for Errors, but I was > hoping to get some advice on how I can gguage when I'm running out of > memory, or at least how much is still available. I'm an old WebLogic > server, 5.1, with Java 1.3. Any advice you have on good coding > standards in such situations or good ways to check available memory is > greatly appreciated. - Dave Consider the following: 1. program A checks for available memory, the check returns X 2. context switches to program B 3. program B allocates Y bytes (or frees Z bytes) 4. context switches back to A A now believes there's X bytes available. In fact, there's X - Y. Or X + Z. To make it more interesting, consider a system that overcommits (i.e. doesn't throw an error if Y > X at step 3). HTH Dima -- True courage comes from steadying yourself and forcing yourself to ssh into the fscking thing yet again and not admitting that it doesn't care what it's done to your life. -- "Hidden among the nodes" by ADB ========================================================================== TOPIC: j2se 1.5 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/14c9f2340716e66d ========================================================================== == 1 of 1 == Date: Thurs, Sep 23 2004 9:14 am From: Mike Yawn <[EMAIL PROTECTED]> Stik wrote: > Hello everyone! > > Looking for a book or documentation covering all new features > that comes with j2se 1.5. Any hints? I picked up the 'Java 1.5 Tiger Developer's Notebook' (O'Reilly) at JavaOne and think it gives excellent coverage. http://www.amazon.com/exec/obidos/ASIN/0596007388/ref%3Dnosim/theyawnscom-20/102-3050387-1929758 > > Does anyone know when the final relase of j2se 1.5 is > coming? > > Cheers! ======================================================================= 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
