Rudradutt Joshi

Ranch Hand
+ Follow
since Dec 06, 2008
Rudradutt likes ...
Fedora Google Web Toolkit Java
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 Rudradutt Joshi

Hey Ritchie,

Campbell Ritchie wrote:

Rudradutt Joshi wrote: . . . I had just provided a work around for calculating correct percentage to enable below code in correct manner.
. . .

Please explain why that won't work. And it is unnecessarily complicated.

I preferred Michael Duff's solution. I have a solution of my own, where I multiplied the count by 100 and 1000 and divided twice to get % and 0.1% values. Do you really want the length of the string as the denominator of the division?

I came to that conclusion because

(((Integer) letterCount.elementAt(ch)) / textLength)

returns integer. And will result in 0 in general cases.

And Duff, the map returned by analyze method will be printed once the execution of the method completes.
So calling method will be printing the correct map.

Tell me if I am missing something.

8 years ago
I hguess you will not encounter with the problem Fred mentioned with the above notion, where the dataMap is reiterated once after string parsing completes, so its one time operation in the end.

And you can do all the beautification for displaying data by enhancing toString for the wrapper object, and to further by a method to print map object the way you like.
8 years ago
A cleanly written code is as much as readable as it is with or without a break,continue or equivalent.

But I like the way Campbell has given and I would try using that one now onwards.
8 years ago

I have used Spring and GWT.
Basically I liked the notion to isolating front end and back end, so I was using GWT as front end and Spring with RESTful services as back end.
This way you can have loose coupled GUI.

And as far as spring MVC is concerned, one may achieve it with little changes(complex though).

And if you like to use plain spring and hibernate with GWT, you may use it on server side. I don't see any problem on that side. After all they are java framework with configuration.

P.S : you can check out smartgwt api for such purpose. It may provide support for ORM.
8 years ago
Why don't you try like

8 years ago

Vijitha Kumara wrote:Hint: Using a break; statement in a loop causes the loop (inner most loop if you have more than one) to terminate and jump out of it.

Also labels are available in java to tell JVM to get out of which loop.
8 years ago

Campbell Ritchie wrote:

rudradutt joshi wrote: . . . for correct results you should use double as holder of length.


Nonsense. It's an int. that is about the one bit that is correct. A double can introduce imprecision, and cause the loop to malfunction.

Thanks Sheriff for your lovely comments.
I had just provided a work around for calculating correct percentage to enable below code in correct manner.

I am not able to understand byte thing as 1 = 1.000000000.
What I understood is Anything it has to do with precision apart from converting

((Integer) letterCount.elementAt(ch)) / textLength)

to double is increase precision.

I think below snippet will be of some help to the owner of the thread

8 years ago

I am not getting your precise point, but for correct results you should use double as holder of length.

8 years ago
Are you planning to use javascript to modify the div you are creating?
8 years ago
I hope I am not to late. Rather I do (That means your problem is resolved).
What appears to me is the request is not reaching the Async back end RemoteServiceServlet.
So have you mapped the servlet in Deployment descriptor?
8 years ago
Hi All,

I was having this discussion with my friend regarding Marker interface.

Where a generalize statement is "Interface without any method is Marker interface". We were discussing up to what extent it is correct.

Argument : Interface without any method is Marker interface.
Counter Argument : What if the code using particular interface is not using it as marker purpose.
Support statemetns :
Case : 1) Interface is having constants and no methods.
Case : 2) There is an interface 'I' without any methods, but no one is implementing that interface. Is it still Marker interface?
Case : 3) Serializable is marker interface, after only the code using serializable object to converts it in to bytes.
8 years ago
What comes to my mind is
what's wrong in using same FTPClient object???
more to that limit the number of instances of the object to say 100 Instances. That will limit your number of active TCP connections, which will provide more controlled environment.
Or may I see the piece of code ??
Correct me if I am wrong about the way you are using the FTP Connection.
As far as I can guess, you are getting connected to the FTP server, performs transactions,disconnects and then again cycle repeats(with the same Object of FTPClient).

In such a case API for the Client says

Because the handling of sockets on different platforms can differ significantly, the FTPClient automatically issues a new PORT command prior to every transfer requiring that the server connect to the client's data port.

As FTP uses TCP connection to perform the operations, the above statement may create lots of trouble.

Rudradutt Joshi.
You don't need any special APIs for this
in Java default OS File separator can be obtained by


(i.e. whatever /,\,//,$,,:| )
so, for example if you are specifying file "sample.txt" for reading
you may write


for absolute path


for relative path

Note the appearance of "File.Seprator" , and some one please put this post to "Beginning Java" section

Rudradutt Joshi
9 years ago
Hi All,

I am using

variable for generating relative path for navigation in my JSP pages,
Now I have to make the host entry in "${Windows}/system32/driver/etc/hosts" as 'mysite'
In this condition I am not being able to generate links for my images(and everything else) as they are missing '/mysite/'
a big problem.

I got the path some how by


But now when I am trying to use it with include tag as it was
And it throws exception with unterminated tag '%'.

I hope you got my problem. I want shortest way to resolve the problem. (And systematic also. )

Rudradutt Joshi.
10 years ago