vinita Kh

Ranch Hand
+ Follow
since Feb 19, 2002
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 vinita Kh

I tried using chmod u+x shartup.sh, but still getting the same error "Cannot execute".
it shows execute permission on this script and I'm running this as super user.
I'm just wondering, does it has anything to do with unzip/untarring using winzip on windows and copying to solaris?
Any suggessions would be greatly appreciated.
20 years ago
I have Apache, Jaserv installed and running on Solaris machine.
I am trying to instaal Tomcat 4 on this machine.
I download Tomcat4 and unziped using winzip and copies it to /usr/local folder on unix.
I set CATALINA_HOME and JAVA_HOME environment variables already.
When I tried to run startup.sh, it says cannot execute.
can anybody help me with this.
20 years ago
My VB Program sends compressed data as string from a VB Socket.
Java Socket receivs this data as String.This is the Code for that:
public static void main(String args[]) {
ServerSocket serverSocket = null;
try {
serverSocket = new ServerSocket(12345);
System.out.println("Listening on port: 12345");
} catch (IOException e) {
System.err.println("Could not listen on port:12345");
System.exit(1);
}
Socket clientSocket = null;
try {
clientSocket = serverSocket.accept();
System.out.println("VB Client accepted");
} catch (IOException e) {
System.err.println("Accept failed.");
System.exit(1);
}
PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);
BufferedReader in = new BufferedReader(
new InputStreamReader(
clientSocket.getInputStream()));
String inputLine,data,inMsg;

while ((inputLine = in.readLine()) != null) {
data = "";
data = data + inputLine;
while (true) {
//to mark end of line received
if ( data.indexOf(';') == -1 ) {
break;
}
//to empty data in inMsg, & get it ready for nextInput
inMsg = data.substring(0,data.indexOf(";") + 1 );
data = data.substring(inMsg.length());
System.out.println(decompress(inMsg));
}
}
out.close();
in.close();
clientSocket.close();
serverSocket.close();
}
I'm using java 1.4.1-b21 and zlib 1.4.1.
I'm using above decompress routine to decompress it, with slight modification in Encoding instead of "ISO-8859-1", I'm using "Cp1252".
Now This works with small strings, but with large strings say 100 bytes, it throws exception as:
DataFormatException : Too many length or distance symbols
at java.util.zip.InflateBytes<Native Method>
20 years ago
My java program communicates with a VB Program using socket connection. I'm using Zlib.dll for compression at VB side & Inflator for decompression at java side. At java side if I define byte[] buff = new byte[256], then if I send a string of size more than 256 bytes, althought compressed size less than 256, then on java side while decompressing, I get only first 256 bytesof the original string, thats true because buffer size is 256.
So to resolve this I tried to increase the buffer size, So now I'm getting decompressed size as 0.
Can nebody explain how to solve this problem.
Here is my decompression routine in Java:
public static String decompress(String inStr){
byte[] b2 = new byte[inStr.length()];
//b2 = inStr.getBytes();
System.out.println(inStr);
try {
b2 = inStr.getBytes("ISO-8859-1");
} catch (java.io.UnsupportedEncodingException e)
{
System.err.println(e);
}

Inflater decompresser = new Inflater(true);
decompresser.setInput(b2,0,b2.length);
byte[] b3 = new byte[4096];
int xxxxx =0;
try {
xxxxx = decompresser.inflate(b3);
}
catch (Exception e) {
System.out.println("decompress exception ...");
e.printStackTrace();
}
System.out.println("decompress ... " + inStr.length() + " out: " + xxxxx);
decompresser.end();
String outStr = new String(b3,0,xxxxx);
outStr.trim();
return outStr;
}

java.util.zip.DataFormatException:Invalid stored block lenght java.util.zip.Inflater.InflateBytes<NativeBytes>
Can anybody please sort this out, whats happening?
Is it because string compression in VB using Zlib.dll resulting different encoding than what java is expecting? It is working fine for a normal string(uncompressed string). But if I send compressed string than this exception is shown.
Any help would be greatly appreciated.
20 years ago
Hi,
My java program communicates with a VB Program using socket connection. I'm using Zlib.dll for compression at VB side & Inflator for decompression at java side. At java side if I define byte[] buff = new byte[256], then if I send a string of size more than 256 bytes, althought compressed size less than 256, then on java side while decompressing, I get only first 256 bytesof the original string, thats true because buffer size is 256.
So to resolve this I tried to increase the buffer size, So now I'm getting decompressed size as 0.
Can nebody explain how to solve this problem.
Here is my decompression routine in Java:
public static String mydecompresser (byte[] b) {
// Create the decompressor and give it the data to compress
Inflater decompressor = new Inflater();
decompressor.setInput(b);
// Create an expandable byte array to hold the decompressed data
ByteArrayOutputStream bos = new ByteArrayOutputStream(b.length);
// Decompress the data
byte[] buf = new byte[512];
while (!decompressor.finished()) {
try {
int count = decompressor.inflate(buf);
bos.write(buf, 0, count);
}
catch (DataFormatException e) {e.printStackTrace();}
}
try {
bos.close();
} catch (IOException e) { e.printStackTrace();
}
// return the decompressed data
return bos.toString();
}

But it works for smaller string as 15 bytes sometimes more, but for longer strings it shows exception :
java.util.zip.DataFormatException:Incorrect Data Check
java.util.zip.Inflater.InflateBytes<NativeBytes>
Can anybody please sort this out, whats happening?
Is it because there are some characters in the received string which are not understood by java?
I appeared for beta 1.4, as most of us here...but just can't make it.
I'm surprised I had scored above 80-100% in all the mock tests listed on mahaanna's site.
I just don't know what went wrong.
But now I want to start all over again...I'm determined to succeed, thats it!
How to make sure that now i'm ready for the exam, as even mock scores have illuded me once..though it was beta & i think beta was very much tougher that all the mocks I have appeared.
Would the real 1.4 be that tough?
Vinita
21 years ago
Is there neone else here, who did not receive examination score report for SCJP1.4 beta?
Can nebody tell where can i find my registration number (ofcourse apart from score report) in order to logon to certManager?
thanks,
Vinita
21 years ago
thnaks Aamir,
but....As it was a beta exam, so i didn't get any score sheet at the end of the exam.
So where can I can Registration number?
Need help, as I want to update my demographic details also.
Vinita
21 years ago
Hi,
I appeared for sCJP1.4 beta on 16th May, I want to know about my result...but I'm not able to assign initial passowrd to login at this database.
Mailed to sun also, but no reply.
nebody plz help.
Please note I appeared for any sun certification exam for the first time.
whats the difference between candidate ID and registration number?
what i know is candidate ID is Prometric testing ID. but ehat is registration number, & where can i get one.
Plz help
Vinita
21 years ago
Hi Guys,
does beta test yesterday!
For me it was a surprize the the test was 161 questions & 3 hrs only!!, though sun has mentioned it would be for 4 hours.
But nehow i had to manage with 3 hrs only.
I found the questions little bit difficult as compared to mocks even marcus Green.
I had scored above 80% in almost all the mocks i have given listed on maha_anna mock exams & Even in the rules-round up i use to score 100%,but i'm not satisfied with my performance in real test.
neways..
basic questions on assertion.
lot of questions on threads, & ++, --, Wrapper class, have a look at general methods of Wrapper class, what they return & what they take as parameter.
Read from JLS what exactly equals() does in all the class which override it.
A lot of questions on Collection framwork
only a few questions on inner classes
prepare interfaces very well, differentiate between is-a and has-a
Operator precendence
......i think thats it from my side.

This was my first experience for any certification exam!, though very bad too.
At the first place when i went for the test, i was informed that i have been registered for exam & given SP code from sun, but my exam is not available.
once they managed to get the exam from sun,& i started with.After just 1/2 hr date on the PC changed & it gave message saying, ur session is expired!
This happened 3-4 times.
At last i was shifted to a different PC then i could finish it.
so overall it took 8 hrs for me!!
neways..
All the best to all who r yet to appear.
Vinita
Corey,
will u plz explain for me why the output of
i<<31 is a negave number with this value.

Originally posted by Corey McGlone:

Corey

so we can sum up as:
"if o1.equals(o2) ---> true then
o1.hashCode() == o2.hashCode() -----> always return true"
"if o1.equals(o2) ---> false then
o1.hashCode() == o2.hashCode() -----> May be true or false"
exactly Clement!
that means wat i said is true, right?
plz comment if i'm wrong
Mark- I believe that
if o1.equals(o2), then it ensures that o1.hashCode()==o2.hashCode
, but i'm not sure of the other way around.
can nebody comment
thanks chintan!
May be he's talking about if condition as the inner loop.