What?? Trendmark??
It was bound to happen... there is a new telephone company offering UNLIMITED US Domestic Long Distance Calling for a flat rate of $20-$60 per month... no computer required... phone to phone... "pin drop" quality. For exciting information and a FREE Demo: Web site: http://www.maxpages.com/insidetrac
Re: A very elementary question ?
Mehrdad Jahansoozi wrote: Hi, The problem is with your CLASSPATH, and maybe with PATH, too First you will have to add your "/MyJavaDir/jdk117/bin/" to your PATH variable (PATH=%PATH:/MyJavaDir/jdk117/bin). An alternative solution is to make symbolic links of the java binaries (like java, javac, and so on) to a directory that is already in PATH (like /usr/bin): "ln -s /MyJavaDir/jdk117/bin/java /usr/bin", and so on. Second, you have to set your CLASSPATH: "CLASSPATH=.:/MyJavaDir/jdk117/lib/classes.zip" Third: "cd /MytestDir" "java Test" That's all. It should work. If you encounter any problems, please contact me for details. Catalin. Hi, I installed JDK 117 on a newly and painfully installed Linux Red Hat 5.1 I wrote a small Java program. When I type /MyJavaDir/jdk117/bin/javac /MyyestDir//Test.java Test.class is generated Then I type /MyJavaDir/jdk117/bin/java /MyyestDir//Test I get a message invalid class name: /MyJavaDir/jdk117/Test How do you run your Java on Linux ? Regards, Mehrdad -- \|/ \|/ @~/ Oo \~@ /_( \__/ )_\ \__U_/
Porters: Performance suggestion
Small performance enhancement suggested. The performance of java.util.Vector.copyInto(Object[]) could be improved, I believe. Currently the implementation does something like: public void copyInto(Object[] anArray) { int i = elementCount; while (i-- > 0) { anArray[i] = elementData[i]; } } Why not make it: public void copyInto(Object[] anArray) { System.arraycopy(elementData, 0, anArray, 0, elementData.length); } I personally use the copyInto method very often. Is this the place I should post such issues, or should I contact JavaSoft or so? Ernst -- _ | "Come to me all you who are weary and burdened, and I | | will give you rest." | | | | -- Jesus Christ (Mt. 11:28) | |___ _| | Ernst de Haan | email [EMAIL PROTECTED]| | Java programmer | web members.xoom.com/znerd/ | | Utrecht University| icq# 21871778 | |___|_|
Re: Porters: Performance suggestion
Ernst de Haan wrote: > Small performance enhancement suggested. > > The performance of java.util.Vector.copyInto(Object[]) could be > improved, I believe. Currently the implementation does something like: > >public void copyInto(Object[] anArray) >{ > int i = elementCount; > while (i-- > 0) > { > anArray[i] = elementData[i]; > } >} > > Why not make it: > >public void copyInto(Object[] anArray) >{ > System.arraycopy(elementData, 0, anArray, 0, elementData.length); >} > > I personally use the copyInto method very often. If you want a performance improvement you should not copy elementData.length elements but just elementCount elements ;-) > Is this the place I should post such issues, or should I contact > JavaSoft or so? I don't know (I'm not a porter). Why not build your own classes.zip? -- Martin Sorgatz [EMAIL PROTECTED]
Re: Porters: Performance suggestion
technically we are to change only the platform dependent code - hands tied by license. Ur improvement would not fit into that catagory :( . PLEASE file away at javasoft. BTW this does not mean that it wont be used, or benefit those here. I have no problem with this being posted here gat Ernst de Haan wrote: > Small performance enhancement suggested. > > The performance of java.util.Vector.copyInto(Object[]) could be > improved, I believe. Currently the implementation does something like: > >public void copyInto(Object[] anArray) >{ > int i = elementCount; > while (i-- > 0) > { > anArray[i] = elementData[i]; > } >} > > Why not make it: > >public void copyInto(Object[] anArray) >{ > System.arraycopy(elementData, 0, anArray, 0, elementData.length); >} > > I personally use the copyInto method very often. > > Is this the place I should post such issues, or should I contact > JavaSoft or so? > > Ernst > -- > _ > | "Come to me all you who are weary and burdened, and I | > | will give you rest." | > | | > | -- Jesus Christ (Mt. 11:28) | > |___ _| > | Ernst de Haan | email [EMAIL PROTECTED]| > | Java programmer | web members.xoom.com/znerd/ | > | Utrecht University| icq# 21871778 | > |___|_|
Re: Porters: Performance suggestion
Martin Sorgatz wrote: > > Ernst de Haan wrote: > > > Small performance enhancement suggested. > > > > The performance of java.util.Vector.copyInto(Object[]) could be > > improved, I believe. Currently the implementation does something like: > > > >public void copyInto(Object[] anArray) > >{ > > int i = elementCount; > > while (i-- > 0) > > { > > anArray[i] = elementData[i]; > > } > >} > > > > Why not make it: > > > >public void copyInto(Object[] anArray) > >{ > > System.arraycopy(elementData, 0, anArray, 0, elementData.length); > >} > > > > I personally use the copyInto method very often. > > If you want a performance improvement you should not copy > elementData.length > elements but just elementCount elements ;-) *LOL* You're absolutely right. Ha ha ha. Man, we should get our own jdk-source-code-performance-improvement newsgroup! ;) > > Is this the place I should post such issues, or should I contact > > JavaSoft or so? > > I don't know (I'm not a porter). Why not build your own classes.zip? No way. I'm not that desparate. I'd have to rebuild the classes.zip every time I get a new JDK update. It's not that I really _need_ the performance that bad, I just want to help improve Java (especially on unices). Ernst -- _ | "Come to me all you who are weary and burdened, and I | | will give you rest." | | | | -- Jesus Christ (Mt. 11:28) | |___ _| | Ernst de Haan | email [EMAIL PROTECTED]| | Java programmer | web members.xoom.com/znerd/ | | Utrecht University| icq# 21871778 | |___|_|
Tried to free bogus memory
this is an applet and the problem occurs in appletviewer This does NOT happen in netscape (Java 1.1.5). [summer@possum os2]$ ./r os2.Ftpenquiry$1[,0,0,10x280,invalid] free: double-freed at 83F8748 free: double-freed at 83F87A0 free: double-freed at 83F9900 free: double-freed at 83F9958 Tried to free bogus memory 83ffdd8, ignored Tried to free bogus memory 83ffe30, ignored Tried to free bogus memory 83ffe88, ignored Tried to free bogus memory 83ffee0, ignored free: double-freed at 8401BD8 free: double-freed at 8401C30 README.linux for JDK 1.1.6, Version 4 08/28/98 This is the Blackdown Java-Linux port of JDK 1.1.6 to Linux. It extends Steve Byrne's JDK 1.1.6 Version 2 port. RedHat 5.0 glibc If you need source say so now: it's latish at night and I wanna sleep. I'll have your reply if you're reasonably prompt in the morning (and if all goes well, jdk117). If I don't hear in time I'll asome you think t might be fixed and I'll ignore it, at least till I have jdk117 in place. I can give it a try on OS/2 if needed: it's got IBM's latest 116 (and I'm trying to get 117 for that too. I might be sleeping, but my computer will be hard at it.) Cheers John Summerfield http://os2.ami.com.au/os2/ for OS/2 support. Configuration, networking, combined IBM ftpsites index.
Re: How to Write MakeFile ?
On Wed, 25 Nov 1998 [EMAIL PROTECTED] wrote: > Heres a simple Makefile I use. > > BIN = /home/jarvi/java/gps/bin/ > JAVAC = javac > JFLAGS= -d /home/jarvi/java/gps/bin -O > JFILES := $(patsubst %.java,$(BIN)%.class,$(wildcard *.java)) > SUBDIRS = almanac misc route trackpoint waypoint rxtx > > .SUFFIXES:.class .java > > $(BIN)%.class: %.java > $(JAVAC) $(JFLAGS) $< > > all:$(JFILES) $(SOFILES) > @set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done I use a script, typically in which ever directory's most likely to be convenient. The script will typically have the command ... better, here's one: #!/bin/bash jikes -d ~/Classes MyStocks.java \ Records/*.java \ Reports/*.java \ Reports/*/*.java \ || exit java Stocks.MyStocks which will probably complete before javac's compiled anything. Cheers John Summerfield http://os2.ami.com.au/os2/ for OS/2 support. Configuration, networking, combined IBM ftpsites index.
A bug in the parse method? (and more)
Hello, I'm using the JDK 1.1.5, of course the Linux version. I have to parse a file of many lines, each line has 1 float and 4 double numbers. I read the lines and for each line I parse the 5 numbers and store them in the variables of a Body object. The line is read into the String bodyinfo. To parse di string I'm using this method: java.text.DecimalFormat.parse(String, ParsePosition) (Please notice that I'm still quite new with Java, so if this isn't a smart way to parse these lines, please let me know.) Anyway here is the code fragment: ParsePosition p = new ParsePosition(0); // Posizione DecimalFormat df = new DecimalFormat(); // Parser body[i].base = df.parse(bodyinfo, p).floatValue(); body[i].posx = df.parse(bodyinfo, p).doubleValue(); body[i].posy = df.parse(bodyinfo, p).doubleValue(); body[i].velx = df.parse(bodyinfo, p).doubleValue(); body[i].vely = df.parse(bodyinfo, p).doubleValue(); The official 1.1.5 docs say: When parsing, leading whitespace is discarded (with successful parse), while trailing whitespace is left as is. Example: Parsing "_12_xy" (where _ represents a space) for a number, with index == 0 will result in the number 12, with status.index updated to 3 (just before the second space). Parsing a second time will result in a ParseException since "xy" is not a number, and leave index at 3. The string "23.456 12 23.6 0 0.1" (no withspace at the beginning) gives: Base: 23.456 PosX: 0.0 PosY: 0.0 VelX: 0.0 VelY: 0.0 The 0.0 values are perhaps null values (see below). The ParsePosition is 0 before the first parse and stays at 6 (points the whitespace after the 23.456) after it. I guessed that the behaviour of this method is different from what is written in the docs: the method does not discard the whitespaces. The proof is the following: I put a withspace at the beginning of the string: " 23.456 12 23.6 0 0.1". And the result was: Base: 0.0 PosX: 0.0 PosY: 0.0 VelX: 0.0 VelY: 0.0 Again, these could be null values (see below). Before submitting the bug to this list I chose to run a test on a Solaris JDK 1.2 of my Computer Science Department (i.e. I haven't installed and configured it). For this test I used the string without the whitespace at the beginning. I compiled the code with the Solaris javac compiler (should have I tried also with the Linux-compiled java bytecode?) and ran it. I got a NullPointerException in the second parse call, surely because the doubleValue() was called on the return value (null) of the first parse. Needless to say, when I tried with the string with a whitespace at the beginning, I got the exception in the first parse. This seem to say that: 1) This parse method has a behaviour different from the one described in the docs and seems to be there since the solaris code (I guess that the Linux JDK is derived from the solaris code). 2) There is a different buggy behaviour: in Solaris the method returns a null, in Linux seems that it returns a zero value...or the doubleValue returns 0 if called on a null pointer. In the latter case, this does not happen in Solaris. I hope this helps to fix the bug. If you need more informations just ask. BTW, I wrote a workaround. I just increase the ParsePosition p variable... p.setIndex(p.getIndex() + 1); .every time after a parse call. With this trick, all works perfectly: Base: 23.456 PosX: 12.0 PosY: 23.6 VelX: 0.0 VelY: 0.1 This is the final proof that the problem are the whitespaces. Best regards, Andrea --- Andrea "Kontorotsui" Controzzi - MALE Student of Computer Science at University of Pisa - Italy - E-mail: [EMAIL PROTECTED] My home page: http://www.cli.di.unipi.it/~controzz/intro.html Founder and Admiral of Hoshi no Senshi (italian Leiji Matsumoto's fan group). Creator of It.Arti.Cartoni (italian anime newsgroup) and proud member of... +-+ |. * . | | .__ . . | |oq |po _ _| | / #==>>>==#,-' (_)\ | | | ,-|~\\ ///_ ,() ,_} | | | |/|~]]] /// ,-~' .,~ / \| . | | |\_|_|_\_\~~~~' \ (/|. | | ./~ \___/ [m] \ \__// | | _bo..__ // `-,.~~ | | _-~ 0o.__( . | | \ o . | | . (_)00 | |. \~~~*,,,* ~00 | |~0 . | | ~~~---~~ | | .*| +-
Re: CLASSPATH confusion
On Tue, 24 Nov 1998 [EMAIL PROTECTED] wrote: > Having it "fixed" in 1.2 won't help us, as Jikes is designed to run with > all but most ancient JDK's. You supply the classes.zip (or jar, or > whatever), we provide the bytecode. Sigh. I imagine you'll think of a switch such as +1.2 to give it 1.2 behaviour. If you decide to use a jikesrc file, can we please start a nw conventiion? my home dir's getting litterd with .*rc files. Let's start putting them in ~/.etc - if the directory exists, use it. If it doesn't and there's no existing config file, make it. Now my contribution to the CLASSPATH problem. I drop all my java stuff into /usr/java. I thought of scanning from there for *.jar and *.zip but discovered most of the zips are source, so gave scanning for them. I decided doing it every time's not so bright either as it's not especially quick and doesn't change all that often, even though I'm a bit of a software junkie. Besiddes, I don't generally want demo jars in my classpath.. So I scan as needed (with the find command) to create a list of jars. In /etc/profile.d I have drwxr-xr-x 2 root root 1024 Oct 21 20:37 . drwxr-xr-x 22 root root 3072 Nov 25 15:20 .. -rw-r--r-- 1 root root 2499 Oct 21 20:34 java -rwxr-xr-x 1 root root 485 May 17 1998 jdk.csh -rwxr-xr-x 1 root root 775 Oct 21 20:37 jdk.sh "java" contains a list of my jars, created with a find command then editted to remvoe the obvious junk. Here's how I use it: [summer@possum profile.d]$ cat jdk.sh | grep -v ^# if [ -z "${JAVA_HOME}" ] ; then export JAVA_HOME=/usr/lib/jdk-1.1.6 fi if [ -z "${JDK_HOME}" ] ; then export JDK_HOME=/usr/lib/jdk-1.1.6 fi SW=`cat /etc/profile.d/java` SW=`echo ${SW} | sed -e "s/ /:/g"` MYPATH="${JDK_HOME}/lib/classes.zip:${SW}" export CLASSPATH="${MYPATH}" MYPATH="${JDK_HOME}/bin/" echo ":${PATH}:"| grep "${MYPATH}" >/dev/null ||\ PATH="${PATH}:${MYPATH}" export PATH For those who haven't twigged, in a convoluted sequence of events, bash gets to run /etc/profile.d/*.sh (and csh runs /etc/profile.d/*.csh) during login processing. This is on RedHat - it may work a little differently on other distributions. I have to do it a little differently on OS/2 which can't cope with the commandline size needed to set all these jars at once. Here's the find command to locate the jars. The list will need some tweaking to weed out demos and any other junk. find /usr/java -name *.jar Cheers John Summerfield http://os2.ami.com.au/os2/ for OS/2 support. Configuration, networking, combined IBM ftpsites index.
Re: A bug in the parse method? (and more)
> Kontorotsui writes: Kontorotsui> Hello, Kontorotsui> I'm using the JDK 1.1.5, of course the Linux Kontorotsui> version. Kontorotsui> I have to parse a file Kontorotsui> of many lines, each line has 1 float and 4 Kontorotsui> double Kontorotsui> numbers. Kontorotsui> I Kontorotsui> read the lines and for each line I parse the Kontorotsui> 5 numbers and store them in Kontorotsui> the Kontorotsui> variables of a Body object. The line is read Kontorotsui> into the String bodyinfo. Kontorotsui> To parse di string I'm using this method: [...] Get 1.1.7-v1a and try again, 1.1.7 has some bugfixes for the parse methods. The parse-methods are 100% pure Java, so if 1.1.5 Linux and 1.2 Solaris show different behavior it doesn't have to be a Linux bug, but it means that there have been some changes to the java code between 1.1.5 and 1.2. Juergen -- Juergen Kreileder, Universitaet Dortmund, Lehrstuhl Informatik V Baroper Strasse 301, D-44221 Dortmund, Germany Phone: ++49 231/755-5806, Fax: ++49 231/755-5802
java.lang.System
I believe there should be a private constructor in the Transvirtual java.lang.System class: private System() { } Otherwise you can instantiate it :-) The JDK classes contain such a constructor. Note that there's a regression test which will need changing too. Peter -- +-+-+ | Peter Naulls - [EMAIL PROTECTED] | Phone 64-7-854-9478 | | http://chocky.home.ml.org/ | Java and JVM Consultant | | Java for Risc OS and ARM - [EMAIL PROTECTED] | Technical Author| | http://chocky.home.ml.org/java/ | Program performance analyst | +-+-+
(no subject)
unsubscribe
New user
Hi there, people... i have 1 machine redhat 5.1 and need very very to install JDK 1.2.x but i dont found... anibody say to me where i find Thanx. Tobias Ramos Diamantina MG [EMAIL PROTECTED]
Modal Dialog within applets
I have an applet that shows a dialog that is supposed to be modal. Since the only way i have found to display a dialog within an applet, is to create a parent frame for the dialog, the dialog wont be modal for the applet, only for the frame. Because of this the dialog isnt modal within the applet. Can anyone send me the code for creating modal dialogs for applets? Thanks!!
Re: New user
Doesn't exist yet. www.sunsoft.com for details. --troy On Thu, 26 Nov 1998, Tobias ramos wrote: Hi there, people... i have 1 machine redhat 5.1 and need very very to install JDK 1.2.x but i dont found... anibody say to me where i find Thanx. Tobias Ramos Diamantina MG [EMAIL PROTECTED]
Re: Modal Dialog within applets
I used Symantec's Visual Cafe and I created a PasswordDialog (a Modal Dialog with 2 textfields: login and password. Visual Cafe contains 2 classes, which it uses for creating PasswordDialogs: ModalDialog and DialogBox. DialogBox contains the following: --- import java.awt.Button; import java.awt.Event; import java.awt.Frame; import java.awt.Dialog; import java.awt.Rectangle; public class DialogBox extends Dialog { public DialogBox(Frame f,String s,boolean modal) { super(f,s,modal); setResizable(false); } public synchronized void show() { Rectangle bounds = getParent().bounds(); Rectangle abounds = bounds(); move(abounds.width,abounds.height); super.show(); } ... and DialogBox, which is DialogBox's subclass, contains the following: import java.awt.Frame; public class ModalDialog extends DialogBox { public ModalDialog(Frame f,String s) { super(f,s,true); } } That's all for ModalDialog.java You can create any class "AnyDialog.java" which extends ModalDialog.java and will be modal. Your applet should create an AnyDialog's instance. Carlos Alberto Roman Zamitiz Departamento de Ingenieria en Computacion, Facultad de Ingenieria UNAM [EMAIL PROTECTED] On Thu, 26 Nov 1998, Thor Erik Karlsen wrote: > I have an applet that shows a dialog that is supposed to be modal. Since the only >way i have found to display a dialog within an applet, is to create a parent frame >for the dialog, the dialog wont be modal for the applet, only for the frame. Because >of this the dialog isnt modal within the applet. > Can anyone send me the code for creating modal dialogs for applets? > Thanks!! > > >