Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!

mansi gupte

Ranch Hand
+ Follow
since Dec 30, 2008
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 mansi gupte

Campbell Ritchie wrote:So what is the maximum value on your Slider? Why are you dividing it by 100?





The maximum value is 100 , minimum is 0 and middle is 50.I got this formula from a book, (2^50 -1), for calculating the value when slider changes its position.
10 years ago
Hello,

I am writing an applet that will display me four different polygons using four buttons.Also, i have a slider that is used to change the sizes of the displayed shape.Using this slider, when for example a rectangle is displayed, moving it ahead will increase it's size and vice versa.

I wrote the code, but i cannot increase/decrease the size using slider.I am sure the slider can listen to the event.But, i am not sure where it's going wrong.Please help.

Note: I have four classes for the four polygons to initialize the co-ordinate points.




10 years ago
Ranchers!

I need your help, actually , a direction.
I have MS Access database that i am working on.Also, i am learning Java GUI (swings basically) . I need to connect these two, so that i can get a sophisticated application that can show tables, run query, print reports, using Java GUI.

Any idea, how do i start. What all things will i need? Any good resources where i can read up and work.I am pressed on time. I still have to complete the database, and can start after that.
This is my next project on hand.Currently, i am using MS Access forms and reports, but i want to improve.

Henry Wong wrote:
The only "token ring" that I have ever worked with ... was an obsolete networking standard, invented by IBM. It was a competitor to, and lost to, ethernet. This was also many many years ago -- meaning slow networking (10 base T for ethernet was even available yet). Surely, you can't mean this?

Henry



It is a an implementation as follows:

there are a group of nodes in a ring.A token is being passed between them.A node can have the token only once in ring traversal.Does that make picture clear.Networking classes etc are not to be used here.It is like a general java program using collections which will store the ids of the nodes and check which node has the token.Does that make picture clear??
11 years ago

Bert Bates wrote:let's try this question in the 'general' forum...



Isn't there anyone who can answer this on javaranch???
11 years ago

Henry Wong wrote:

piya rai wrote:

Henry Wong wrote:

piya rai wrote:
The problem is that when i run, i get the constructor undefined error at line -->children.add(new MSS(counter++, this, id_start )); , which i am not able to find why??

can someone explain the reason?



Well, does the MSS class have a constructor that takes an int, an Network instance, and an int as the three parameters?

Henry




yes it does..



Well, your compiler says otherwise. So... As many has already mentioned, show us the code. Or we really can't help you.

Henry



11 years ago
i don't know if this is the right forum.I wish to implement the token ring algorithm for mobile hosts.I have information as below for the algorithm.

A fundamental algorithm in distributed systems consists of circulating a token amongst participants in a logical ring. Each participant executes as follows:
– wait receipt of token from its predecessor in the ring;
– enter <critical region>, if desired;
– send token to its successor in the ring.

The algorithm trivially satisfies two important properties:
(1) mutual exclusion is trivially guaranteed to the current holder of the token

(2) it allows fair access to the token by allowing each participant to access the token atmost once in one traversal of the ring.

Now this is the first algorithm i am attempting in java , till now i have theoretical knowledge.

Ranchers , can you please help me in getting to the starting point from which i can begin??

Please help.
11 years ago
I don't know if this is the right forum.I wish to implement the token ring algorithm for mobile hosts.I have information as below for the algorithm.

A fundamental algorithm in distributed systems consists of circulating a token amongst participants in a logical ring. Each participant executes as follows:
– wait receipt of token from its predecessor in the ring;
– enter <critical region>, if desired;
– send token to its successor in the ring.

The algorithm trivially satisfies two important properties:
(1) mutual exclusion is trivially guaranteed to the current holder of the token

(2) it allows fair access to the token by allowing each participant to access the token atmost once in one traversal of the ring.

Now this is the first algorithm i am attempting in java , till now i have theoretical knowledge.

Ranchers , can you please help me in getting to the starting point from which i can begin??

Please help.

Henry Wong wrote:

piya rai wrote:
The problem is that when i run, i get the constructor undefined error at line -->children.add(new MSS(counter++, this, id_start )); , which i am not able to find why??

can someone explain the reason?



Well, does the MSS class have a constructor that takes an int, an Network instance, and an int as the three parameters?

Henry




yes it does..
11 years ago
This is my code



The problem is that when i run, i get the constructor undefined error at line -->children.add(new MSS(counter++, this, id_start )); , which i am not able to find why??

can someone explain the reason?
11 years ago
Hi all,
I have two questions:

1] When i say final Fizz f1 = new Fizz();
Fizz f2 = new Fizz();


does f1 and f2 point to two different Fizz objects or the same Fizz object??



2] How should i read the lines 6 and 7 with respect to Garbage collection eligibility?


3. Eco e1 = new Eco();
4. Eco e2 = new Eco();
5. Eco e3 = new Eco();



Please someone explain.

Thanks,
Piya
Hi all,

I have read posts complaining the blunders done during the SCJP exam with respect to the interface and all.I mean to say for instance the drag and drop questions and not marking them for review.Are there any other useful suggestions and instructions that we all can follow during the exam?

Please all those who have already taken the exam , do reply.

Thanks,
Piya
@Keerthi Kumar,

I have PM you regarding a query of mine, request you to answer.


Thanks,
Piya

Narendhiran Nagarajan wrote:I mean, the till the end of stack(Main method).

I see that, we have to handle the checked exceptions.
Yes ,I agree.

Also, I understand that we can throw checked Exceptions fro main method

In which situation
the checked Exceptions are thrown from the main method.? (main method is the last chance to handle the chk excep)




A checked exception should be declared and handled.This means that if a method say m1 declares an exception but does not handle it, it may be handled by m2, m3 0r m4 etc. methods within the same code.This 'passing the buck' situation is called Propagating Uncaught Exceptions.If an exception is not caught even by the main method which is at the bottom of the stack, then compiler issues displays the stack trace, and stops further execution of program.

Eg:

The following code throws an exception

Jim Toy wrote:Wouldn't the answer be "unpredictable" since the output of either thread can not be guaranteed? Even though there is no contention, the thread pool scheduler will run/stop/run then in its own sweet time.




Will the output still be unpredictable , even if the method is synchronized?

Please explain someone??