Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

Aman Singh

Ranch Hand
+ Follow
since Oct 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 Aman Singh

Hi Greg,

Thanks a lot for your help. It is solved now
8 years ago
Hi Greg,

Thanks for the help.

I quite new to this, so please excuse my silly mistakes

This is what I tried but getting an error on the very last line.

8 years ago
Hi folks,

I am stuck here with populating a nested HashMap.

the relationship I am looking for is:

Area Code Zone Code Value
001 111 10.34
001 222 11.98
001 333 12.99
. . .
. . .
001 666 15.99
002 111 24.39
002 222 25.69
. . .
. . .
002 666 31.34

and so on.

The above structure can be represented as following:

{001 => {111 => 10.34, 222 => 11.98}, {002 => {111 => 24.39, 222 => 25.69}} so on....

so the final outcome I look for is:

On Area code I can call the Zone code and fetch the corresponding value for that zone code.

The structure I have is like this:

Map<Integer, Map><Integer, Double>> areaPrices = new HashMap<Integer, Map><Integer, Double>>();
Map<Integer, Double> zonePrices = new HashMap<Integer, Double>();

areaPrices HashMap will contain "AREA" as key and zonePrices HashMap as value.

I am trying to populate it from my DB code, but its not giving the expected result.

8 years ago
Hi Gary,

Thanks for the help. I will read it. I came up with this, Am I anywhere close?




[edit: we do not allow students to post actual code for the Cattle Drive, since it would deprive other students of learning opportunities]
8 years ago
@ David,

I am trying to satisfy these three conditions:

Leap occurs:-

on every year that is evenly divisible by 4

except every year that is evenly divisible by 100

except every year that is evenly divisible by 400.
8 years ago
Hi Folks,

Could you please hint me with what am I doing wrong with this problem.





[edit: we do not allow students to post actual code for the Cattle Drive, since it would deprive other students of learning opportunities]
8 years ago
Hi David,

Thanks
if length is zero, dont process.
8 years ago
Hi fred,

I actually wanted to handle ArrayIndexOutOfBounds, but couldnt implement it.
How do I handle this condition if user doesnt enter any arguments?
8 years ago
Hi Sri,

Thanks for the reply
I apologize I kept it that way. Any other issue?
8 years ago
Hi folks,

I just got done with the first problem of Cattle Drive (Printing a name 100 times).

I am getting the correct output, but do you guys see any issues with this code or something I can do to improve it. I know its a real small problem



[edit: we do not allow students to post actual code for the Cattle Drive, since it would deprive other students of learning opportunities]
8 years ago
Hi fellows,

I got few java problems on some site. This question is really bugging me.
As per the policy I am not posting the answer here, so that other people can learn too... but I am really confused over its solution. Why its coming that way.

8 years ago
Thanks Bear.

HTML is flawed then. None of the option is showing selected.

Now the question, why? I have the exact same condition on another page and it works fine, only difference, dropdown in hardcoded there and in this case if generated from a loop.
8 years ago
JSP
I apologize Paul. I didnt get, what you meant earlier.

Bear, I am trying to debug. I just checked the HTML, it is being passed perfectly.

One thing I didnt mention before.

There is one option which is hardcorded in the HTML.

<option value="YYYY" ><c:if test="${transaction eq 'YYY'}"> selected='selected'</c:if> >YYY</option>

and this is the one its always defaulting too.
8 years ago
JSP
Hi Paul,

Thats not the problem. Lets say, if I picked CCC from the dropdown, so this will trigger the form to submit, which in turn returns some data back on the page. After this refresh, I want the same CCC value to be highlighted in the dropdown.
8 years ago
JSP
I apologize for the trouble. I am still a newbie

Thanks for the syntax, it isnt throwing any erros, but problem still persists
8 years ago
JSP