This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Harry Singh

Ranch Hand
+ Follow
since May 02, 2001
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 Harry Singh

The form values comes from another JSP. so from that JSP, the values are filled in text boxes and then the action is called and all works fine.

However I want to link this action or the result page from another JSP, which doesn't have this form.
11 years ago
Hi,

I'm just a started on struts. So I just want to know how can I pass the parameters on the submit of the button to the action.

Basically I want to call one action on the button click.On the button click , I would like to send username in the query string to the action, so that only this user reports can be fetched.

I'm doing this on my button on click event


The action getSynchReport.do is defined in config file as


and this is the form definition of SynchReportForm


So basically I want to set the username field of the form. How do I do that. I thought I could do it by query string, but it doesn't seem to work.

Any Pointers.

Thanks & Regards,
Harry
11 years ago
Thanks Mark for your inputs.

Indeed this was the problem. I noticed that may be I will have to apply a patch to make this DST change to happen in Java.
11 years ago
Hi All,

I'm having problems converting GMT date time to other timezone formats. Basically I can convert the date time but it doesnt take into effect the day light saving time. I'm doing something like this.



This code works fine. However It should return GMT+ 11 time in Australian tiem due to day light savings. But it just gives me back GMT+ 10. Any pointers as to how to fix this problem?

Thanks in advance,
Harry
11 years ago
Hi,

I have to display a tree structure on my JSP page and for that i am getting data from microsoft Active Directory. Basically i want to display a LDAp tree structure like context and then child of that conext and then so on.

On other side of page, i have to display a grid of checkboxes. Like i want to have 3 rows and 4 columns and each column will correspond to different function like admin, library, enquiry, finance and then the checkboxes on these columns can be checked/unchecked. Can anyone help me in telling the frameworks or exisitng tag libraries that i can use for this. Any help on this will be highly appreciated.

Thanks in advance,
Harry
14 years ago
JSP
Hi Guru's,

I have created a tree with all the tree nodes and then stored everything in TreeMap and this way i have created a tree with each tree node having refernce to its parent and children...

So can anyone tell me ho can i traverse this tree to find the maximum weight (profit)by following path in the tree...

Class Tree Node is



and i am constructing a Tree as



so can Anyone telll me how can i find a path which is having max weight..i Actually dont need a path, i just need to get max weight (profit)..

Any ideas...
14 years ago
Well with all of your help, i have made a skeleton of the TreeNode class and i have been able to make a tree(atleast i think so). Im putting up a code here, so if you guys can tell me if i got everything right..

Here is a Tree Node class


& then i am storing everything in Tree Map along with node number and its respective TreeNode object.



where treeData is an Arraylist containing data for making tree...

So can you guys lemme know if my interpretation of things is right... and if yes, then now how can i traverse the tree and get the maximum profit by following a path of the tree...

Thanks in advance
Harry
14 years ago
yeah, Good idea to use that Tree class of swings. but in my case i want to have profits associated with nodes... so probably better off by making my own Tree class...but kinda stuck with that....
14 years ago
Thanks Henry...

so that means for every node in Tree, i will have to create an instance of class Node and add respective data into each instance...or is there a way i can just create a single instance and then add node and data of each node..

Any sample skeleton of the class would be very helpful...
14 years ago
Any help on this guys!!!
14 years ago
Thanks Mate.

but how can i create a tree then.. Can i have your email address, i iwll try & send u the PDF file for this problem.. if thats not a problem to you..

Essentialy a problem is of trees and paths.. so from that integer value i have to create trees and then profit is the value associated with each path of the tree... and i have to calculate the max profit by traversing through the paths (but thats a second part,cnt even complete first part )

and y is nothing but an integer... if u start from 1.. then first pair will be smthing like 0 -1.. where 0 is the parent and -1 is the profit associated with it...
[ October 19, 2005: Message edited by: Ernest Friedman-Hill ]
14 years ago
Thanks Aadi,

This is the kind of input that i have


100
0 -33 1 -45 1 -47 1 21 3 -12 4 5 1 1 5 5 4 -36 8 26 4
-4 6 3 7 -8 0 49 1 -38 7 -33 14 18 13 22 1 -44 3 -36 5 -21 14 25 16 -23 17 -5 24 -45 1 5 7 -12 23 -14 11 30 20 -34 25 48 14 36 6 40 4 36
12 37 34 46 35 -12 22 -7 14 45 10 33 17 -37
36 -20 32 -4 29 27 27 -15 0 -39 37 35 7 -49 14 -24 7 -42 7 13 46 -17 27 -31 22 -30 44 -25 5
-7 15 46 40 38 51 -48 48 -23 30 13 12 23 30 -20 6
49 20 -32 31 -26 34 21 47 -30 7 -42 55 -22
25 -43 56 16 35 -50 3 -1 16 -27 0 -8
8 28 54 -10 31 -8 47 46 35 30 23 -24 40 32 46 42
76 23 37 28 1 12 20 43 63 -19 85 24 9 -39 81 -37 76 4 81 -37 12 14 91 44 38 36 29 -43 62 0

The first line contains an integer n, 1 ≤ n ≤ 500000, indicating the number
of nodes, including the entrance node, implicitly labelled 0.

This is then followed by one or more lines, containing n-1 pairs of integers. All integers are separated by single spaces or newlines. The y�th
intersection is defined by the y�th pair of integers 'x p', where 1 ≤ y < n, 0 ≤ x < y, -1000 ≤ p ≤ 1000. & P is the profit value...


So its kind of weighted graph and then i have to traverse this graph and calculate the max profit...

so for this i tokenize the input.. put it in arraylist and then trying to create a tree from this Arraylist.. and then traverse through that tree to get the results... but im stuck...

So any pointers for this...
14 years ago
Thanks Layne..

got it what u r saying.. i can use arraylist or vectors for that... but i am kinda confused as if i create a object of that Node class everytime.. then the stacks gonna overflow... i think i am getting something wrong here. well i will try once more..
14 years ago
Thanks Aadi for the reply..

But i dont want to create a Binary Tree so i can have any number of children, depending on the input in file... so i dont know how mny children really..

and i cnt cant create nodes like this or in any other generic way as if there are many nodes (like say 5000) it will be stack overflow error...

So any pointers on this...
14 years ago
Hi Gurus,

Can anyone let me know how can i construct a basic tree in java.. All i am looking for is to create a Tree(not a binary tree) and then traverse through that tree to find maximum weights of the tree paths.. but i cant figure out what wil be the structure of the Tree class (as java doesnt have pointers, so hwo to keep track of nodes)

Thanks in Advance,
Harry
14 years ago