Harshil Mehta

Ranch Hand
+ Follow
since Mar 17, 2005
Merit badge: grant badges
For More
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 Harshil Mehta

anthony ward wrote:
So I don't know if I should look into Java 7 parallel processing with CPU or if threads are good?



Hi Anthony, can you please provide more details about the machine where the program is running? If it got multiple cores available, new Java7 fork/pool feature can be used.
Hey Raj,

Look at List of world's most expensive cities

London is the second most expensive city to live in. After spending just 4 months here in London, I can say its's true. This rating is of current year only.

Not comparing with any other than any Indian city though, in India you can buy a 12inch pizza of Pizzahut at max Rs.300. Same size of Pizza would cost you around �12-15 in London. To use a bus, a small journey w/o having an Oyester card would cost �2, has anyone thought of paying Rs.160 for going to Borivali from Vile Parle in Mumbai? No doubt the bus service is far better than BEST, I just want to say that living in London is not cheaper.
16 years ago
Hello Ranchers,

I have been studying openAMQ, implementation of AMQP from imatix, since a long. I am not able to figure out the difference between it and JMS. Both are messaging middlewares. The document for AMQP says: AMQP differs from JMS as it also defines wire level protocol.

AMQP is application level protocol similar to HTTP, FTP or SMTP. This makes the picture somewhat clear to me, however I need a clear understanding of the overall scenario.

Can anyone please let me know how AMQP and JMS differ?

--Harshil
Hello Ranchers,
I gave exam today only. I passed SCJP 1.5 with 70%.
I am also unable to register at certmanager. Is the registration mandatory or certificate comes as per address given on score report without registering?
16 years ago


How come this line prints -1? After sorting the array using ReSortComparator, the array contains elements in the order:
[two three one four]

So the output of the line at #5 should be 2. I am not getting why it prints -1?
[ June 30, 2007: Message edited by: Harshil Mehta ]
Hi Nilesh/ Sai Priya,
I am also getting the similar problem.
My application is on apache/tomcat server.
I have included multiple jsp's in my index.jsp, e.g. header, login, right_navigation etc..
When user logs in the application through the included login jsp, it creates a session.
Strange thing is that when he clicks on the "Home" link available on the login.jsp, the same session is retained but when he click on the "Home" link available on the header.jsp, a new session is created.
Session related code is only in the login.jsp.

Interestingly this code works fine in my local machine where I am using tomcat 5.0.28, but it shows above behaviour on the remote Apache server with multiple tomcat 5.0.28 instances.

Do anyone knows any specific reason for such behaviour??
16 years ago
JSP
When variable i is declared as final, compiler knows what value it shall have at runtime, and in this case it is 100 which is in range of byte primitive -128 to 127. So no compile time error.

However if you remove word final, some other value might have been assigned to variable i before value of i is assigned byte b, so explicit time cast is required this time. Same thing, if you change value of i to be more than 127 even if it is final.

if so then what about overriding the run from Runnable interface?



if you put synchronized keyword in any superclass/interface method, it is still a legal overriding.
17 years ago
Hello Ranchers,
reopening a very old post! further to solution given by Mohamed Yousuff, what if the window opened by parent window is not on the same domain?

Is there really no way to make communication possible between parent window and child window specially calling parent window's javascript function by child window's java script function?

I am facing this problem as:
  • My parent page has a select box where person's names are supposed to be displayed.
  • In order to enter names in this box, user is dependent on centralized repository of names.
  • This is not a database like sybase or oracle so my java code cannot user it directly via jdbc. So the user clicks on a button that opens up a child window with URL of different domain.
  • This window loads content where user can search for users which are required to be entered and upon finishing search, user clicks on button of child window which calls a javascript function of parent window with passing search result as string as parameter to it.

  • Here the error Permission Denied appears on child window. I am really stuck. Is there any workaround of this problem?

    --Harshil

    [ October 10, 2006: Message edited by: Harshil Mehta ]
    [ October 10, 2006: Message edited by: Harshil Mehta ]
    Hey Gregg,
    I am sorry for not putting the sentence properly.
    Yeah, it is the case that it is running fine with Tomcat 5, but not with iPlanet 6.
    17 years ago
    Hello Ranchers,

    Please help me in a strange problem which I am facing since last two days.
    My requirement is one of the simple requirements. e.g. in a simple web application, user generally creates a web report. Among other input fields like report title, report data, etc. there is one input fields named 'report owner'. It is a select box with options populated from database by a DAO.

    Now when the user tries to create report and finds no entry for say person named 'A' in the dropdown select box of 'report owner', he should be able to add the person 'A' in the user table and continue report creating.

    I need to incorporate this functionality into this MVC web application. App has single controller which serves requests based on the querystring. Now on the report page, when user clicks on 'new', a popup window opens in which the form is present to capture name of user. Now when user clicks on 'Save' on the page, the form gets submitted to a handler and db operation takes place. Now I want to show result of the operation on the popup window which is still open.

    For this I forward the request to url of popup window, however even after finishing forward, nothing gets displayed in popup window. No server error log messages are also displayed.

    I am unable to understand that when user clicked on 'new', the same url was passed to window.open() function. That time it travelled to the page via controller only and page was displayed on popped up window, now when i submit form on the popped up window whose action is same url, respons does not reach to that page.

    I am using iPlaner app server v6.0. I tried in Tomcat 5, and it is running fine. Am i missing something?
    17 years ago
    Hello Ranchers,
    In this one I am really confused, please help me sort out it.
    I am using Lotus Domino R5 on one machine designamted as 'Server'. My machine has Lotus Notes R6.

    From my machine I am trying to connect to the 'Server' and access NAB of it with following code:

    I have included 'NCSO.jar' file which I got from 'Server's Lotus Home/domino/data/domino/java/ folder.

    I am getting this exception:


    I googled a lot for resolving the error and have a lead that the NCSO.jar file which i got may not be the correct one. Even I tried to run the prog with java -noverify option but some other kind of CORBA related exception is thrown.

    Can any one please tell me the jar file I am using for Notes R6 as client and Domino R5 as server is correct? Or any other mistake in my code or setting.

    p.s. http and diiop task are running correctly on 'Server' and i am also able to get the IOR from 'Server' using getIOR() method.

    Hoping for correct reply.
    [ July 04, 2006: Message edited by: Harshil Mehta ]
    17 years ago

    My Code is not printing Session Created. What setting should be done so that this code will be able to create a session of Domino Server?

    As such i have done:
    I have included Notes.jar in my classpath and path is been setted to the lotus\notes folder of Lotus Notes Server.

    Its giving me a error as:
    1. Connection Refused.
    2. UnspecifiedLinkError.
    17 years ago
    Shailey,
    In case of

    Compiler just gives a warning, else there is no compiling error encountered.
    However I am more interested in the question you asked earlier,


    What if i need to have a method taking array as parameter,
    and also need to invoke the varargs of the same type?



    Did you try the solution given by Charles,
    would work for
    .

    I am not able to compile this code.
    Are you able to compile it?
    No we can't.

    Read following from lang specs.


    Note that a method declared in an interface must not be declared strictfp or native or synchronized, or a compile-time error occurs, because those keywords describe implementation properties rather than interface properties. However, a method declared in an interface may be implemented by a method that is declared strictfp or native or synchronized in a class that implements the interface.

    17 years ago