Thursday, November 23, 2006

General:Windows Update nagging you to restart after an update

After Windows Automatic Updates has downloaded updates to your computer, it may display a dialog that says: "Updating your computer is almost complete. You must restart your computer for the updates to take effect. Do you want to restart your computer now?" Its painful, if you are in the midst of an importantb stuff(assume, everybody is!!)

Solution:

Click Start, Run and enter the command net stop wuauserv

This will stop the Windows Update service until the next restart of the computer, which will stop the reminders to restart your computer for this update.

XP professional:
-------------------
1)-Start->Run . Type gpedit.msc
2)-Computer Configuration->Administrative templates->Windows Component->Windows Update->
3)-Double click on last but 1 entry.
4)-
Choose "Enable". Specify the minutes "1440".
Apply


Relaxed till the next restart of the computer or laptop.

Friday, November 17, 2006

Science:Bernoulli's challenge and Newton

In 1696 John Bernoulli challenged mathematicians
(i) to determine the brachistochrone, and
(ii) to find a curve such that if any line drawn from a fixed point O cut it in P and Q then OP^n+OQ^n would be constant.

Leibnitz solved the first of these questions after an interval of rather more than six months, and then suggested that they be sent as a challenge to Newton and others. Newton received the problems on Jan. 29, 1697, and the next day gave the complete solutions to both, at the same time generalising the second question. An almost exactly similar case occurred in 1716 when Newton was asked to find the orthogonal trajectory of a family of curves. In five hours Newton solved the problem in the form in which it was propounded to him, and laid down the principles for finding trajectories i.e integral calculus

Science:Newton vs. Leibniz- The Calculus Controversy

Like most discoveries, calculus was the culmination of centuries of work rather than an instant epiphany. Mathematicians all over the world contributed to its development, but the two most recognized discoverers of calculus are Isaac Newton and Gottfried Wilhelm Leibniz. Although the credit is currently given to both men, there was a time when the debate over which of them truly deserved the recognition was both heated and widespread.

As the renowned author of Principia (1687) as well as a host of equally esteemed published works, it appears that Newton not only went much further in exploring the applications of calculus than Leibniz did, but he also ventured down a different road. Leibniz and Newton had very different views of calculus in that Newton’s was based on limits and concrete reality, while Leibniz focused more on the infinite and the abstract (Struik, 1948). However, regardless of the divergent paths these two scholars chose to venture down, the question of who took the first step remained the primary issue of debate.

Unaware that Newton was reported to have discovered similar methods, Leibniz discovered “his” calculus in Paris between 1673 and 1676 (Ball, 1908). By 1676, Leibniz realized that he was onto something “big”; he just didn’t realize that Newton was on to the same big discovery because Newton was remaining somewhat tight lipped about his breakthroughs. In fact, it was actually the delayed publication of Newton’s findings that caused the entire controversy. Leibniz published the first account of differential calculus in 1684 and then published the explanation of integral calculus in 1686 (Boyer, 1968).

Newton did not publish his findings until 1687. Yet evidence shows that Newton discovered his theories of fluxional calculus in 1665 and 1666, after having studied the work of other mathematicians such as Barrows and Wallis (Struik, 1948).. Evidence also shows that Newton was the first to establish the general method called the "theory of fluxions" was the first to state the fundamental theorem of calculus and was also the first to explore applications of both integration and differentiation in a single work (Struik, 1948). However, since Leibniz was the first to publish a dissertation on calculus, he was given the total credit for the discovery for a number of years. This later led, of course, to accusations of plagiarism being hurled relentlessly in the direction of Leibniz.

There was speculation that Leibniz may have gleaned some of his insights from two of Newton's manuscripts on fluxions, and that that is what sparked his understanding of calculus. Many believed that Leibniz used Newton's unpublished ideas, created a new notation and then published it as his own, which would obviously constitute plagiarism. The rumor that Leibniz may have seen some of Newton's manuscripts left little doubt in most people’s minds as to whether or not Leibniz arrived at his conclusions independently. The rumor was, after all, believable because Newton had admittedly bounced his ideas off a handful of colleagues, some of who were also in close contact with Leibniz (Boyer, 1968).

It is also known that Leibniz and Newton corresponded by letter quite regularly, and they most often discussed the subject of mathematics (Boyer, 1968). In fact, Newton first described his methods, formulas and concepts of calculus, including his binomial theorem, fluxions and tangents, in letters he wrote to Leibniz (Ball, 1908). However an examination of Leibniz' unpublished manuscripts provided evidence that despite his correspondence with Newton, he had come to his own conclusions about calculus already. The letters may then, have merely helped Leibniz to expand upon his own initial ideas.

The question of the date at which these extracts were made is therefore all important. It is known that a copy of Newton's manuscript had been sent to Tschirnhausen in May, 1675, and as in that year he and Leibniz were engaged together on a piece of work, it is not impossible that these extracts were made then. It is also possible that they may have been made in 1676, for Leibniz discussed the question of analysis by infinite series with Collins and Oldenburg in that year, and it is a priori probable that they would have then shown him the manuscript of Newton on that subject, a copy of which was possessed by one or both of them. On the other hand it may be supposed that Leibniz made the extracts from the printed copy in or after 1704. Leibniz shortly before his death admitted in a letter to Conti that in 1676 Collins had shown him some Newtonian papers, but implied that they were of little or no value, - presumably he referred to Newton's letters of June 13 and Oct. 24, 1676, and to the letter of Dec. 10, 1672, on the method of tangents, extracts from which accompanied the letter of June 13, - but it is remarkable that, on the receipt of these letters, Leibniz should have made no further inquiries, unless he was already aware from other sources of the method followed by Newton (Ball, 1908).

While Newton had many allies rallying in his favor, Leibniz had only one: John Bernoulli, who in a letter, tried to cast doubt upon Newton’s credibility. When Bernoulli was later asked to comment on the letter, he denied ever writing it, which caused Newton to aver: I have never grasped at fame among foreign nations, but I am very desirous to preserve my character for honesty, which the author of that epistle, as if by the authority of a great judge, had endeavored to wrest from me. Now that I am old, I have little pleasure in mathematical studies, and I have never tried to propagate my opinions over the world, but I have rather taken care not to involve myself in disputes on account of them (Ball, 1908).

In 1715, just a year before Leibniz death, the Royal Society handed down their verdict crediting Sir Isaac Newton with the discovery of calculus. It was also stated that Leibniz was guilty of plagiarism because of certain letters he was supposed to have seen (Ball, 1908). It later became known that these accusations were false, and both men were then given credit, but not until after Leibniz had already died. In fact, the controversy over who really deserved the credit for discovering calculus continued to rage on long after Leibniz’ death in 1716 (Struik, 1948). Newton and his associates even tried to get the ambassadors of the London diplomatic corps to review his old manuscripts and letters, in the hopes that they would endorse the finding of the Royal Society that Leibniz had plagiarized his findings regarding calculus. Another argument on the side promoting the idea of Leibniz as a plagiarist was the fact that he used an alternate set of symbols. Leibniz specifically set out to develop a more meticulous notation system than Newton’s, and he developed the integral sign ( I ) and the 'd' sign, which are still used today (O’Connor, 1996) However this action was argued by many to be merely a way for Leibniz to “cover his tracks” so as not to get accused of stealing Newton’s material (Boyer, 1968). The fact that the method was more efficient was considered to be an ancillary benefit. The fact is that Leibniz sent letters to Newton outlining his own presentation of his own methods, and these letters focused quite stringently upon the subject of tangents and curves. Because Newton had been approaching calculus primarily in regards to its applications to physics, he purported curves to be the creation of the motion of points while perceiving velocity to be the primary derivative. Conversely, the calculus of Leibniz was applied more to discoveries in geometry made by scholars such as Descartes and Pascal. Since "Leibniz' approach was geometrical," the notation of the differential calculus and many of the general rules for calculating derivatives are still used today, while Newton's approach, which has in many aspects, fallen by the wayside, was "primarily cinematical" (Struik, 1948).

Despite the ruling of the Royal Society, mathematics throughout the eighteenth century was typified by an elaboration of the differential and integral calculus in which mathematicians generally discarded Newton's fluxional calculus in favor of the new methods presented by Leibniz. Nevertheless, in England, the controversy was viewed as an attempt to pilfer Newton's glory simply because of international egotism. Consequently, as a matter of “national pride”, England refused to teach anything but Newton’s discoveries of geometrical and fluxional methods for over a century. So while other countries were integrating various findings that occurred over time and were progressing in their discoveries, England remained essentially stagnant in the realm of mathematic discovery. In fact, it wasn’t until 1820 that England finally agreed to recognize the work of mathematicians from any other countries (Ball, 1908).

With modern controversies covering such volatile topics as abortion and gun control, a debate over who discovered calculus may seem somewhat trivial by contemporary standards. However at the time, this was a serious issue that not only involved matters of mathematical discovery but also matters of national pride and allegiance. What is important to keep in perspective is that no matter who actually discovered calculus first, both Newton and Leibniz made great contributions to the advancement of mathematical processes, and both deserve credit for that.

Thursday, November 16, 2006

BC4J:EOImpl.revert()

EOImpl.revert() method:
-----------------------
Calling this method will either reset the attribute values to their database
values or revert them to their default values. If the Entity Object is
posted, all the attributes revert to the unread state, so that a subsequent
getAttribute() call will refresh all attributes from the database.

It internally calls

  EOImpl.refresh(REFRESH_WITH_DB_FORGET_CHANGES)

Wednesday, November 15, 2006

Oracle Apps:Concurrent programs different Execution Methods

Following are the possible execution methods which are commonly used in oracle applications Concurrent programs.

  • * Oracle Reports – used for the RDF reports
  • * Host – used for shell scripts, basically the language of the host operating system
  • * PL/SQL Stored procedure – used to run the stored procedure through oracle applications
  • * SQL*Loader – used to run the sql loader programs
  • * SQL*Plus - used to run the anonymous PL/SQL blocks. It will get executed in the same fashion as
  • you are running on SQL Plus.
  • * Java Stored Procedure – The execution file is a Java stored procedure.
  • * Java Concurrent Program – Used for program written in Java.
  • * Spawned – used for c or pro*c Program. Mainly used by standard oracle interfaces.
  • * Perl Concurrent Program – used for programs written in CGI Perl.
  • * Request Set Stage Function – PL/SQL stored function that can be used to calculate the
  • completion statuses of request set stages.
  • * Immediate – execution file is a program written to run as subroutine of the concurrent manager.
  • Oracle doesn’t recommend use of this executable type.
  • * Multi-Language function – execution file is an MLS function that supports running concurrent program in multiple languages.

PL/SQL Stored Procedure, Oracle Reports, Host, SQL*loader, SQL*Plus, Java Concurrent Program are the most commonly used executable types.

Tuesday, November 14, 2006

General:Retreive back hidden windows task-bar

In WIndows-XP and 2000, sometimes the taskbar gets hidden. Its because of

1)-Multiple Hanged Windows Explorer Programs
2)-Low virtual memory when the CPU utilization is around 100%.

Its really irritating.
Here are the steps to get the same back.

1)-CTRL+ALT+DEL.
2)-Task Manager
3)-Close all the windows explorer programs.
4)-Click on "Run New Task".
5)-Type "Explorer".

That should bring up the Hidden task Bar.

Tuesday, November 07, 2006

J2EE:Creating POJOs from Database tables using Oracle Toplink feature

Maynot be a frequent requirement, but sometimes developers may need to create Plain Old Java Objects(POJOs) out of Database Tables.This can be easily created by using the Oracle Toplink feature available in JDeveloper.

1)-Create a new Application, say ToplinkResearch.
2)-Add a project to this Application, say ToplinkResearch.
3)-Click New->Business Components->select Toplink/JPA.
4)-It will ask for the Database connection and at the same time an offline database
schema it asks for to maintain in the middle-tier.(You can create at the same time
as well!!)
5)-Select the Table name from the List, just we select for an Entity Object.
6)-Thats all and the POJO is created and ready to be compiled.
7)-This class can be refactored to be used in any other project.
8)-Right click on the POJO class and select "New Sample Java Client.." and it will
create a sample Java client that uses this POJO(However, in JM8, this client class
gives runtime exception).


Monday, November 06, 2006

BC4J:Understanding EODefImpl class

Most of the time, while creating an EO, we choose the custom EOImpl class to be generated. In the same EO wizard->Java Panel, we have another option of "Create DefImpl class".So whats this?
EODefImpl class, bahaves as the "home" or "factory" for the Entity Object. We can define custom, factory level methods(mostly the validation methods for the entire set of rows in the VO cache and/or in the underlying DB table).

Every EOImpl.java has a method like below..

/**Retrieves the definition object for this instance class.
*/
public static synchronized EntityDefImpl getDefinitionObject() {
if (mDefinitionObject == null) {
mDefinitionObject = (EntityDefImpl)EntityDefImpl.findDefObject("oracle.apps.fusion.schema.server.CustomerEO");
}
return mDefinitionObject;
}

This is where the handle to the Home or factory i.e the DefImpl class is obtained.
How to make use of a user defined DefImpl class method in the base EOImpl.class.

Here is an example
CustomerDefImpl home = (CustomerDefImpl)CustomerImpl.getDefinitionObject();
if(home != null &&
home.existsDuplicateCutomerEmail(this.getDBTransaction(), getCustEmail()))
{
raise JboException;
}

Thursday, November 02, 2006

Groovy:Expression Example Codes

Below are few example codes for the Groovy Expressions.

1)-Use of Boolean expression
def x = false
return x


2)-Use of IF statement
def x= newValue
if (x <>
return true;
else
return false;


3)-Use of ArrayList
def myList=[10,20,30,40,50]
if(myList.get(2) == 30){
return false
}
else{
return true
}


4)-Use of HashMap
def myMap=[1:"A",2:"B", 3:"C"]
if(myMap[2] == null){
return false
}
else{
return true
}

http://groovy.codehaus.org/Tutorial+1+-+Getting+started

JDeveloper:Autogenerate Javadoc comments

----------------------------
We can create Javadoc automatically for any methods we want in a class.
1)-Click on the Java file.
2)-Double Click on any method name.
e.g public void doDML()
select "doDML" word by double clicking the left mouse button.
3)-Select Source->Add Javadoc comments from the menu on top.

JDeveloper:Override Methods

-------------------------------
Often times we need to override methods in java classes, e.g. for classes like VOImpl, VORowImpl, EOImpl, AMImpl etc etc. So how do you find the methods and their signatures.
I used to do this by typing "this." which popsup the method list popup and then select the method, else by going through Javadoc and typing the method signature.

But this is fairly simple..
1)-Open the required java file in the editor.
2)-Click on "Source" from meny , then "Override Methods".
3)-Select one or multiple methods and it will create the empty body methods with the signatures.

It also provides an annotation called "@Override" just before the method signature.

Wednesday, November 01, 2006

JDBC:A framework for calling a stored procedure.

Here is a generic code snippet for calling a PLSQL stored procedure using JDBC.
It takes the stored procedure callablestatement and an array of variables which need to be passed to this procedure.

 protected void callStoredProcedure(String stmt, Object[] bindVars) {
PreparedStatement st = null;
try {
st = getConnection().createPreparedStatement("begin " + stmt + "; end;", 0);
if (bindVars != null) {
for (int z = 0; z != bindVars.length-1; z++) {
st.setObject(z + 1, bindVars[z]);
}
}
st.executeUpdate();
} catch (SQLException e) {
throw new SQLException(e);
} finally {
if (st != null) {
try {
st.close();
} catch (SQLException e) {
}
}
}
}