patrick tang

Ranch Hand
+ Follow
since Dec 16, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by patrick tang

i think u need to install jar.rpm. mount ur first linux cd and ls INDEX.gz | grep jar.rpm (or some command like that). find the path to jar.rpm and rpm -ivh jar.rpm to install...
21 years ago
hi all,
i just bought a d-link dfe-530txs network card and was trying to use it under suse7.1. however, i couldn't find the correct module for it. i checked suse's website and found dfe-530tx is supported. does anybody know how to solve this problem? thanks a lot...
21 years ago
i tried to reinstall and still got the same problem. does anybody know whats going on?
thanks tualha for the help. i'll download
it again and reinstall it.
hi all,
i followed sun's j2ee tutorial and installed j2eesdk1.3.1. originally i have jdk1.3. i also set the environment variable JAVA_HOME, J2EE_HOME
and PATH. the problem is that when i run j2ee -verbose, it gives me the following message:
J2EE server listen port:1050
Naming service started:1050
Exception at thread "main" java.lang.NoSuchMethodError
at com.sun.corba.ee.internal.corba.AnyImpl.createTypeCodeForClass(AnyImpl.java:1256)
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.createTypeCode(ShutdownUtilDelegate.java:223)
at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.writeAny(ShutdownUtilDelegate.java:178)
at javax.rmi.CORBA.Util.writeAny(Util.java:80)
at org.omg.stub.com.sun.enterprise.naming._SerialContextProvider_Stub.rebind(Unknown Source)
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:188)
at com.sun.enterprise.naming.SerialContext.rebind(SerialContext.java:202)
at javax.naming.InitialContext.rebind(InitialContext.java:370)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:192)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:149)
at com.sun.enterprise.server.J2EEServer.bindObject(J2EEServer.java:718)
at com.sun.enterprise.server.J2EEServer.createServerObject(J2EEServer.java:473)
at com.sun.enterprise.server.J2EEServer.run(J2EEServer.java:244)
at com.sun.enterprise.server.J2EEServer.main(J2EEServer.java:972)
i've checked the documentation but still have no idea what causes this error. can somebody pls give me a hint? thanks in advance
hi jim and rob,
just now i used Reader/Writer to replace InputStream/OutStream. the result is very
good. thanks for the help.
actually it took me some time to figure out
how to read the whole stuff from BufferedReader.
it'd be nice if i could find a PrintReader class...
22 years ago
thanks rob and jim for the help. so generally speaking, InputStream/OutputStream for primitive
datatypes and Reader/Writer for others like String
right? i'll try both.
22 years ago
does that mean if i'm dealing with String, use Reader/Writer, and if dealing with primitive datatypes, use InputStream/OutputStream?
oh, that's why there're read/writeByte, Char, etc methods in InputStream/OutputStream. that makes sense.
thanks valentin for the hints. this place is amazing.
i'll try to use DataInputStream instead of RandomAccessFile to read the file. as i may still need to use readUTF,i should be very careful. (i was trying to use writeChar/writeByte from a textarea, but it didnt work. but i may be able to retrive a file into an array(not a textarea) by using readChar or readByte)
will it be more convinient to use Reader/Writer for the purpose of data tokenizing later on? anyway i'll try both.
hi all,
i've a problem about writeUTF method of DataOutputStream. i was trying to write the text from a textarea into a file, and later retrieving the text from that file line by line by using RandomAccessFile, and separate the line into tokens of string by using StringTokenizer.

however, it seems like that when i write the text like "a,b,1,2" to a file, the actual file becomes sth like " a,b,1,2" (or "*a,b,1,2" or "->a,b,1,2" when i print it to the system.out). so i always get ClassFormatError in runtime when i was trying to tokenize the first character.
i dont know what caused it like that. is it because of the writeUTF method itself? if so, is there any way that i can get rid of the leading space? (i wish i could use sed/tr, but unfortunately i can't )
hi all,
i've a problem about writeUTF method of DataOutputStream. i was trying to write
the text from a textarea into a file, and later
retrieving the text from that file line by line and separate the line into tokens of string by using StringTokenizer.
however, it seems like that when i write the text
like "a,b,1,2" to a file, the actual file becomes
sth like " a,b,1,2" (or "*a,b,1,2" or "->a,b,1,2"
when i print it to the system.out). so i always get ClassFormatError in runtime when i was trying to tokenize the first character.
i dont know what caused it act like that. is it because of the writeUTF method itself? if so, is there any way that i can get rid of the leading space? (i wish i could use sed/tr, but unfortunately i can't :roll: )
22 years ago
thanks shivaji and flynn for your prompt reply.
i appreciate it.
i'll try to use getPath instead of getName and
hopefully this will work fine.
btw, i just went to api documentation and read two methods again,


public String getName()
Returns the name of the file or directory denoted by this abstract
pathname. This is just the last name in the pathname's name sequence.
If the pathname's name sequence is empty, then the empty string is
returned.
Returns:
The name of the file or directory denoted by this abstract pathname,
or the empty string if this pathname's name sequence is empty



public String getPath()
Converts this abstract pathname into a pathname string. The resulting
string uses the default name-separator character to separate the names in the
name sequence.
Returns:
The string form of this abstract pathname


will getPath return a "dir/file"-like string? coz
i cant try it now. i remember it just returns a string which is the filename. anyway,i can try it later on.
thats why i'm confused.
as there're 2 stores in the mall, in for block,
1st loop:
s1=mall\store2
s2=mall\store1
2nd loop:
s1=mall\store2
s2=mall\store2
you can see s1 and s2 are the same strings but it wont print yes and return store2.
hi rodney, thanks for pointing out that
error. it's actually a typo. sorry about
that. i'll fix it soon.
i've actually compiled and run the program
couple of times. i've put a line:
System.out.println("yes") in if(s1.equals(s2))
block. it doesnt print yes.
hi all, i have a question about io

method findStore(String s) is supposed to be able to find the store with the same name as parameter string s from a store list under the mall directory. however, it doesnt work properly. i try to create 2 stores and use findStore("store2") to search for store2, but it wont return store2, even string s1 and s2 are exactly the same.
i also checked documentation of String's equals method as follows,


equals
public boolean equals(Object anObject)
Compares this string to the specified object. The result is true if and only
if the argument is not null and is a String object that represents the same
sequence of characters as this object.
Overrides:
equals in class Object
Parameters:
anObject - the object to compare this String against.
Returns:
true if the String are equal; false otherwise.


it looks like i'm using this method properly.but i just dont get the good result. can anybody pls help me out...again? thanks.
[ February 19, 2002: Message edited by: patrick tang ]
[ February 19, 2002: Message edited by: patrick tang ]
[ February 19, 2002: Message edited by: patrick tang ]