Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can anyone tell what this code will do  RSS feed

 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got following snippet from my friend who asked me what actually is happening here.
I am unable to answer because

I DON'T KNOW

then ranch comes in my mind. i m confused about this scriptlet



it is getting some value in results and putting in resultset, don't know what it is doing after that

could anyone explain me it in layman language
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just walk through the code, line by line, and figure it out? There are only a few lines. Where specifically do you stop understanding what's happening?
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i m not getting that

i have output and this snippet wid me
output is that it display some results
and this is one of snippet basically want to understand bottom four lines...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, so. What does line 1 do?
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya what does it do?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You tell me. I guess we'll have to break it down with even more granularity.

What does request.getRequestURL().toString() do?

I'm asking you to try to work this out on your own (and line 3, since we have no idea what "objResult" is, you'll have to figure that one out anyway, although it looks like it's returning a resultset).

So what does line 1 do?
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What David Newton is asking you is the right way of thinking.

If you don't know what one line is doing, you might be able to find out checking line by line.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!