Mohit J Kumar

Ranch Hand
+ Follow
since Apr 08, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mohit J Kumar

Hey Bill,
Thanks for the reply.

I tried the recommendations there but I am still not able to run the code. In case you have done something similar, please guide.

Thanks,
Mohit
10 years ago
Hi All,

I had posted this problem in full detail at StackOverflow.com here http://stackoverflow.com/questions/26540782/spring-nested-exception-is-java-lang-noclassdeffounderror-org-aopalliance-aop and here at coderanch itself https://coderanch.com/t/561715/Spring/configiring-Spring-aspects. Somebody please help.

I am not using Maven.

Please let me know if I need to paste the problem here too. Also, if anyone has managed to run Spring In Action's AOP example from chapter 1, without using Maven, it will be sufficient help for me.

Thanks,
Mohit
10 years ago
Hell Everyone,

I am getting the exact same error. I am also following Spring in Action 3rd edition and trying the same example.

After a lot of google search I found that the best possible way to resolve this is to add aopalliance.jar seperately.

I also tried adding: aopalliance.jar & aopalliance-alpha1.jar individually and together but the error won't go away.

Please help.

Is there any other jar I need to add in addition to aopalliance.jar. I am using Spring 3.2

Thanks
~Mohit
10 years ago
Hello Everybody,

In this amazing book the author Josh Bloch mentions:

"Oh, and one more thing: there is a severe performance penalty for using finalizers. On my machine, the time to create and destroy a simple object is about 5.6 ns. Adding a finalizer increases the time to 2,400 ns. In other words, it is about 430 times slower to create and destroy objects with finalizers."

Is there a way we can delete and object in java?
I thought we can simply let the objects fall out of scope or reset them to null.
I intend to experiment this on my machine, seems like a fun idea but I am not sure how to delete and object.

Thanks in advance,
Mohit
10 years ago
Hi all,

For a class with an array field Josh says if the clone method merely returns super.clone(), the resulting class instance will have the correct values in primitive fields, but its array field will refer to the same array as the original class instance. Modifying the original will destroy the invariants and vice-versa.

He used the example of custom Stack implementation, I am using a simple Student class



Please note: I didn't invoke clone() on my array field in my clone method's override.

Then I did:



Output:



I was wondering that changing array in original instance would change the array in my clone too, because I mentioned above "array field will refer to the same array as the original instance"

With my implementation of clone I should have seeing changes in the clone s2 too. The proper implementation would've been:



Have I misunderstood this? Can someone please explain what is going on?


Thanks
~Mohit
10 years ago
Well I don't want to mess with my javascript code every time I need to change/manipulate my DOM.
I am planning to create a tool which will create an HTML DOM out of this XML file.
So here I will do it in three steps.

Step 1 : Get HTML DOM (which I need to manipulate) serialized to well formatted XML file.
Step 2 : Make changes in XML.
Step 3 : Use the XML to reflect the changes in the HTML DOM.

<input tabindex="7" name="button" type="button" class="button"
style="width:100;height:30" Value="Continue" onclick='login()' />

Now in Step1 I am not able to get onclick='login()' information in my XML.
There may be other events like this e.g, onBlur, onFocus etc.

Actually I was trying to serialize HTML DOM into XML.

what I did to do this was :



What I am getting from this is an XML :




Now Suppose I have :

<input tabindex="7" name="button" type="button" class="button"
style="width:100;height:30" Value="Continue" onclick='login()' />

All I want to do now is to get onClick in my XML or any event associated like onBlur() etc.


Thanks
Hi everyone,

I have an HTML document.
It is possible to get the events associated with every Element in a particular FORM element in the document using javascript.

var element = document.forms[i].elements[j];

This way I can get j th element in i th form, But can I get the event associated with the element.
There can be any number of elements in a form.I am using IE 8.

I am a total beginner in javascript/javascript event handling.


Thanks
Pat is quite right.
Also there is one more issue to consider and that is testing your code.
With first approach all of your code is loosely coupled and in case of change in GoByTrainFast implementation
you need not to test all you tested code (GoByTrain) again.
Since Motor class is pretty small now, you may think this as pretty simple to test again and again but as
it grows bigger and bigger it will become a maintenance nightmare.

Please Google "Strategy Pattern" OR you may read 1st chapter of "Head First Design Patterns"

Enjoy...
13 years ago
Hi all,
I have found the solution myself.

var objSampleApp = {
// fills the dummy values to the form.
FillForm: function(){

document.getElementById('sad').value = 0;
document.getElementById('sss').value = 0;
document.getElementById('ddd').value = 'eBusinessware india pvt. ltd.';

}

};
objSampleApp.FillForm();

this is how I can access and set the values.
Hi,
I have a table inside which I have a form and again inside that form I have a table.
Now can I access the text-field defined inside the second table.

Thanks
//================MyJs.js=========================

var objGreeting = {
Greetings : function() {
toolbardiv = document.createElement('toolbardiv'); // create div tag dynamically
toolbardiv.setAttribute('id',"toolbar"); // give id to it
toolbardiv.className="top"; // set the style classname

//set the inner styling of the div tag
toolbardiv.style.position="absolute";

//set the html content inside the div tag
toolbardiv.innerHTML="<input id='Greeting-Button' type='greet' value='Login' onClick='objHello.SayHello()'/>"
}
},

var objHello = {

SayHello: function() {
alert("Hello World");
}
};

Right now this all is in a single JS file and it's working fine.

Now I want to separate the two classes above into two different js files.
But after doing this I am not able to call the SayHello method.

I am using "GreaseMonkey for IE" and IE8 to run this script.

Hi Eric,
Thanks for the reply.
Right now I am doing exactly what you are saying.
I was wondering if I could manage multiple JS files.
Hi,

I have a javascript file which creates a button using innerHTML
like


div = document.createElement('div');
div.innerHTML="<input type='button' value='Login' />";

this is demo.js


Now I want to call a method say hello() which is in some other javascript file say hello.js

e.g,

var objHello = {

sayHello: function() {
alert("Hello World");
}
};

I have to run this demo.js using GreaseMonkey4IE on IE,
Right now it successfully creates the button but the problem is to call sayHello() method of hello.js (because it is an external file).
In html we can simply use <Script> tag using src="jsName" but I have no idea how to do it here.


Please help
Hi guys,

Do you have any idea about how to open a .xul file for IE.

For Mozilla my code is working perfectly fine.
In my main .js file I am doing :

window.openDialog("chrome://QHubToolbar/content/login.xul", "Login to QHub", features, params);

to open login.xul file.

But it is just not working for IE.
I am using greasemonkey4IE , I had manually added my script using extention.list .
Is there any alternative or is there any way to find if the above code i.e, window.openDialog is causing problem.

My xul file is stored on my local system.

Thanks to all