Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Abhishk Gupta

+ Follow
since Oct 08, 2008
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 Abhishk Gupta


The class which I am exposing as a AXIS2 web service has import statements. These imports statements are not visible as they reside in jars residing at different system.
What would be the most appropriate way to include these jars inside axis archive(.aar) file.

10 years ago

Jesper de Jong wrote:
When you have a very long string (for example you read the contents of a file into a String object) and you take a substring out of it, then the JVM will retain all the data of the original string in memory - even if you discard the original String object, because the String object created with substring() still holds a reference to the whole character array with all the data.

Nice explanation jasper. But I do have a doubt. Would not JVM retain all data once is invoked.
IMO, Above creates a new String instance but the older one will still resides in the memory.

Let me know if I got it wrong.

10 years ago
Hi Sanjey,

Let me put in simple words.
this operator returns the object of current class. Here in this case Farmer.this will return an object of the class Farmer and you are trying to access class member variable age with the help of that object.

10 years ago
Disclaimer: Please move this post to right forum, if this is not the one.

Problem Statement: We have a set of numbers. Let's say {1,2,3,4,5,6,7,8,9}. We need to find out, summation of what combination of number will produce 9, 15 or any other number.



I have knowingly taken a smaller set. In real world, this would be huge. Hence trying to figure out a highly optimized solution.

10 years ago
Here is my doubt:

What actually goes behind the scene when JVM sees this statement. How does it recognize “abc” as a String instance and what function of String class are called to act.
10 years ago
Dear Madhuri...posting entire code will only make it messy widout much/no description.
e.g. your ContentProperties does not make any sense to me.

you mentioned you want to validate image name and dimension but I dont see that in the code posted. Moreover, I am yet to understand your problem.

Please go through the link provided by Rob TellTheDetails.
11 years ago
Hey Madhuri,

Lester and Rob are very much right in their own way. Your question is very specific to a class which would not make sense unless the reader has some background of that.

Anyways...what I could make out on my own is, you have two images and you want to compare them for their height and width.
If I my udnerstanding of your probolem is correct you should see java.awt.Image class.

Pl correct my if I got you wrong.
11 years ago
wow...why it didn't strike me

Anyways Congrats folks:thumbup:
finally your cummulative efforts changed the value of pi
11 years ago
wooohh....That was quite a discussion but allow me to divert it

John de Michele wrote:

pete stein wrote:But wouldn't it then not be a constant?

Not necessarily. Static means that the variable or reference would be associated with the class, and not an individual object. Making the variable or ref final would mean that you could have a constant for each object.


Does this mean, I can change the value of pi with each new object?

Please elaborate what you mean when you say "you may want a different final value
in each object"

11 years ago
did immmediate=true didn't work

reloads the page and display error messages, if any
11 years ago
Frankly speaking I could not find anything wrong with the code. Moreover there is no validation in the page(atleast in the code shared).
But as we know the unpredictable behavior of ajax4jsf, try this:

<a4j:support event="onblur" action="#{msrFormBB.reOrderDetails}" reRender="myInput" immediate="true "></a4j:support>
instead of
<a4j:support event="onblur" action="#{msrFormBB.reOrderDetails}" reRender="myInput"></a4j:support>.

Please note, this is not a solution but just a workaround.
To check what's happening here, put it in your jsp
<a4j:outputPanel ajaxRendered="true">
<h:messages />

11 years ago

Henry Wong wrote:
Here is how I would do this problem, using regexes...

Loved your solution Henry
12 years ago

Henry Wong wrote:Abhishk, it is generally *not* a good idea to give "read made solutions" -- as the JavaRanch is a learning site, and there isn't much learning when you are given the answer.

Henry, I am new here so not much aware of the customs of JavaRanch. I have taken a note of the point.
As far as regex solution suggested by you is considered, I am not much comfortable with that.

Henry Wong wrote:
If you want to attempt a regex solution, I would recommend that you look at the find(), appendReplacement(), and appendTail() methods. The replaceAll() method is a bit too high level to do this operation efficiently (meaning it won't be able to do this in a single pass).

I think even this would involve complexities of customizing Matcher and Pattern classes.
This is just my opinion...Please share your thoughts on it.
12 years ago
well...I think I have some readymade solution...

Check if it helps...may be some modifications are required.
12 years ago