Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Vijay Bhuruk

Ranch Hand
+ Follow
since Feb 28, 2008
Vijay likes ...
MyEclipse IDE
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vijay Bhuruk

Bill, Thanks for reply.

Creating comment node with text seems a only workaround for now.

Node method- getTextContent() returns "Required Information". so newly created comment node will be like

<!-- Required Information -->

is there any way to get text string with node name. like "<tile>Required Information</title>". so that comment will be like

<!-- <title>Required Information </title> -->

I need way to comment out particular node/element in xml file.

what I am doing is
1.parse xml file using dom parser.
2.traverse through child nodes. check node values if it matches to given input value.
3. comment out entire node whose node value==given input.

I can create new comment node and insert or append in document or child. but want to comment already existing node.

here, I want to comment node <title>

Do you want to pass information from servlet to html form?

As above code is to show you how to display static html page, to create dynamic html page, see JSP tutorials.
11 years ago
Steve, Thanks much.

Actually, I am not storing customer's credit card details.

This database will store only IIN ranges for identifying type of credit card (for more info please see [edit] IIN ranges allocated to issuing networks)when user enters credit card number, my application will search for match in the table and return "CCType" i.e credit card type.

example, if user enter enter a credit card number that starts with 5018, application will return "Maestro".


11 years ago
fred, Thanks much for your guidance.

11 years ago
Hi friends,

I am working on a application functionality for searching credit card details(card type, if issue number required, etc) for credit card number provided by user.

Custmomer will provide credit card number ranges for identifying these card details in CSV file format.

my question is,
should i directly search in CSV file for Credit card number or
store Rrecode from csv file into database like MS SQL server when application start and then search in database on customer request?

which one is better in performance . is there another way?


11 years ago
@Rajendra Prakash
dont try it at home. This testing needs professioanl programmers.

Is there any body professioanl who can do it for us?

Thanks in advance.
11 years ago
salvin came, salvin saw (a chicken), salvin set a new standard (for chicken to cross the road).

A java developer or a chicken..... must follow standards!!!
Thanks Maneesh Bhau

Well begun is half done.
I just wanted you to help me in 'Right begining' to do work.

Campbell Ritchie,I will take care now onwards.Thanks much.
12 years ago
my application have a frame with seven buttons i.e login,ready,notready,call,releasecall,logout,cancel at client side.
when i click on button a request is sent to server.
client process request and send response back to client.
on the basis of response received read write buttons are enabled.
i don't know how to code this in Swing.
can anybody please tell me in details how to use threading in this scenario?

Thanks in advance.

12 years ago

Java Memory Puzzle
Instead of telling you some mystery of Java memory, it is time for you to put on your thinking caps. I had a discussion a few weeks ago with one of my subscribers of whether you should null your local variables, to make things easier for the garbage collector. His understanding was that the local variables will be stored on the stack and thus popped off at the end of the method call anyway, so nulling them was a waste of time. In almost all situations, he is right. However, he had a class that did something most peculiar, something like this:

When you run this you will always get an OutOfMemoryError, even though the local variable data is no longer visible outside of the code block.

So here comes the puzzle, that I'd like you to ponder about a bit. If you very politely ask the VM to release memory, then you don't get an OutOfMemoryError:

Copyright Heinz Kabutz 2009
Aristotelous 84, Korakies, Akrotiri, Chania, Crete, 73100, Greece

Why does this work?
12 years ago
Hi friends,

Can you please confirm that possible to code below steps in java?I am new to these stuff such as network-byte order.
Please can you suggest me tutorials on the same?
Thanks in advance.

To pack a CTI message:

Step 1 Allocate a continuous block of memory.
Step 2 Add the message header to the beginning of the memory block.
Reserve a 4-byte place for the BodyLength field to fill in later when you accurately know the message
body length (when you have added all the Body fields). Convert the 4-byte MessageTypeID to
network-byte order and add it to the memory block after the reserved BodyLength field.
Step 3 Convert each of the fixed message fields, one by one, to network-byte order, if needed, and add them to
the memory block in the appropriate order according to the MessageTypeID.
Step 4 Convert the floating data fields, one by one, if needed, to the network-byte order. Add the fields in the
floating part of the message into the memory block without any gap between the fields.
Step 5 Repeat this process to pack the rest of the floating fields until the end of the message.
Step 6 Remember to convert the BodyLength bytes from host-byte order to network-byte order. Then update
the BodyLength field in the message header part of the memory block after all the floating fields are
added to accurately reflect the message body length.
To unpack a CTI message:

Step 1 Read the first 4 bytes as an unsigned integer. This value is the message BodyLength. Remember to
convert the BodyLength bytes from network-byte order to host-byte order.
Step 2 Make sure all the BodyLength bytes are available from the network before further unpacking.
Step 3 Read the next 4 bytes and convert them to a host-byte-order unsigned integer. This value is the
Step 4 Based on the MessageTypeID, you can then use the message body definition to find out the fixed fields
and their appropriate order in the fixed part of the message.
Step 5 Read each field, one by one, and convert it to host data-byte order, if needed.
Step 6 Based on the FieldDataID value and its definition, convert the floating data fields to the host-byte order,
if necessary.
Step 7 Repeat this process to unpack the rest of floating fields until the end of the message. The end of the
message is determined by the Message BodyLength.
13 years ago