tag:blogger.com,1999:blog-362290782024-03-18T02:15:17.541-07:00Anandita Mishra Maths(IPL-Sri Chaitanya-SR Nagar)Anandita(Buimama's) Maths Inventions AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.comBlogger22125tag:blogger.com,1999:blog-36229078.post-68784341196664311792023-01-17T22:34:00.001-08:002023-01-17T22:34:58.307-08:00Anandita's Triangle<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKfD6R_S21GfmcgImNYeYyL2xcdwFxONsxd5-24MDBQUebVv8Dp-UNJNjutKOquSOrELDlzrFpR5uYIABHoOGxQYbDh4E9grbMH-c3KBgubW60NXs62i75DsoYfg784-7uYtHBo9hLV9wvm71PFR_oWpzGKb4vAi_cM9qQD0Z-M2GZhBq56Q/s1600/Screenshot%202023-01-18%20at%2012.03.38%20PM.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="894" data-original-width="2876" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKfD6R_S21GfmcgImNYeYyL2xcdwFxONsxd5-24MDBQUebVv8Dp-UNJNjutKOquSOrELDlzrFpR5uYIABHoOGxQYbDh4E9grbMH-c3KBgubW60NXs62i75DsoYfg784-7uYtHBo9hLV9wvm71PFR_oWpzGKb4vAi_cM9qQD0Z-M2GZhBq56Q/s1600/Screenshot%202023-01-18%20at%2012.03.38%20PM.png"/></a></div>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-73431161528628141162022-10-17T01:50:00.005-07:002022-10-17T01:55:27.794-07:00<h2 style="clear: both; text-align: left;"> Anandita Mishra Theorem : General Numerical Approximation Formula for Sum of (n) terms in a Harmonic Progression (HP)<br /></h2><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><br /></div><br />
<iframe height="800px" src="https://drive.google.com/file/d/1Oq5rrZMW1YMN7ihVO0rt92Sv6RrLRLp7/preview?usp=sharing" width="100%"></iframe>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.comtag:blogger.com,1999:blog-36229078.post-60413888712480517122020-02-01T13:07:00.003-08:002020-03-19T14:48:56.622-07:00Buimama Anandita Theorem-Mathematics(Sri Chaitanya Techno School-Ameerpet)<div dir="ltr" style="text-align: left;" trbidi="on">
<style type="text/css">
@page { size: 21cm 29.7cm; margin: 2cm }
p { margin-bottom: 0.25cm; direction: ltr; color: #000000; line-height: 115%; text-align: left; orphans: 2; widows: 2; background: transparent }
p.western { font-family: "Liberation Serif", serif; font-size: 12pt; so-language: en-IN }
p.cjk { font-family: "Songti SC"; font-size: 12pt; so-language: zh-CN }
p.ctl { font-family: "Arial Unicode MS"; font-size: 12pt; so-language: hi-IN }
</style>
<br />
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<b>Introduction: Anandita Theorm:</b></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
Anandita : This theorem talks about an alternate formula of Gauss Theorem of
addition of (n) WHOLE numbers </div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<b>Reference:</b></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<b>Gauss Theorem:</b></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
Sum of first N Natural Numbers{N} like 1+2+3+4+5+6+....n = n(n+1)/2</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<b>As
per Anandita's theorem:</b></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<b>Sum of first N Whole Numbers STARTING WTH 0 </b>(Whole Numbers{W}
= 0 + {N}) = n(n-1)/2</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
Where
n = Number of digits in Whole Number Series including 0.(i.e as per
Gauss Theorem n = n + 1)</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
Proof...</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
As per Gauss Theorem: 1+2+3+4 = 4x(4+1)/2 = 4x5/2 = 10 (Using
nx(n+1)/2 theorem)</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
But,
Sum Of Whole Numbers(Means 0 is included in that Series of Sum, so
number of terms n changes, i.e it becomes n+1)</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
=>
0+1+2+3+4 = 5x(5-1)/2= 5x4/2 = 10 (Here n= number of terms = 5
including 0)</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
So,
the Sum is same as nx(n+1)/2.</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
I
didn't understand first,but in her Theorem , 0 is added as a number in
the series, because when 0 is added, the series becomes a Whole
Number Series.</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
As
its a sum of Whole Numbers, where 0 is added.</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
So
when 0 is added, Sum value is un-altered. But Gauss theorem is not
applicable there, as Number of terms changes.</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
nx(n+1)/2
becomes nx(n-1)/2 when 0 is added to Gauss Theorem series.</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
where
n = Number of Natural Numbers + 1(i.e 0 which is a Whole Number)</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
Note:
0 is not a Natural Number{N}, but a whole Number{W}</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
I
tried a lot to prove the theorem wrong.But I failed..Simple logic is,
0 is added, where Sum is not altered, but Number of terms altered and</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
a
polynomial equation of nx(n+1)/2 and nx(n-1)/2 remains same, when n =
n+1</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
This
is main(Anandita doesn't know abt Polynomials yet in detail, but true)</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
A
solution of 2 polynomial equations i.e nx(n+1)/2 and nx(n-1)/2
remains same, when n = n+1</div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
<br /></div>
<div class="western" style="line-height: 100%; margin-bottom: 0cm;">
if
we replace n with (n-1) in Gauss Theorem, we reach there, but at least
the statement <b>Sum of first N Whole Numbers STARTING WTH 0 </b>(Whole
Numbers{W} = 0 + {N}) = n(n-1)/2 doesn't exist in Maths world yet.</div>
</div>
AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com1tag:blogger.com,1999:blog-36229078.post-1163827822606333562006-11-17T21:27:00.000-08:002006-11-17T21:30:22.613-08:00Science:Bernoulli's challenge and Newton<span style="font-size:85%;">In 1696 <span style="font-weight: bold;">John Bernoulli</span> challenged mathematicians<br /><blockquote>(i) to determine the brachistochrone, and<br />(ii) to find a curve such that if any line drawn from a fixed point O cut it in P and Q then <span style="font-weight: bold;">OP^n+OQ^n</span> would be constant. </blockquote><br /><span style="font-weight: bold;">Leibnitz</span> 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 <span style="font-weight: bold;">Newton</span> and others. Newton received the problems on Jan. 29, 1697, and the <span style="font-weight: bold;">next day</span> 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 <span style="font-weight: bold;">orthogonal trajectory of a family of curves</span>. In <span style="font-weight: bold;">five hours</span> 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</span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com1tag:blogger.com,1999:blog-36229078.post-1163826765314179042006-11-17T21:09:00.000-08:002006-11-17T21:12:45.326-08:00Science:Newton vs. Leibniz- The Calculus Controversy<span style="font-size:85%;">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 <span style="font-weight: bold;">Isaac Newton</span> and <span style="font-weight: bold;">Gottfried Wilhelm Leibniz</span>. 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.<br /><br /> As the renowned author of <span style="font-weight: bold;">Principia (1687)</span> 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.<br /><br /> 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).<br /><br />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.<br /><br /> 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).<br /><br /> 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.<br /><br /> 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).<br /><br /> While Newton had many allies rallying in his favor, Leibniz had only one: <span style="font-weight: bold;">John Bernoulli</span>, 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).<br /><br /> 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).<br /><br /> 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).<br /><br /> 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.</span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com1tag:blogger.com,1999:blog-36229078.post-1163671845963516472006-11-16T02:09:00.000-08:002006-11-16T21:04:29.683-08:00BC4J:EOImpl.revert()<div class="storycontent"> <p><span style="font-weight: bold;">EOImpl.revert() method:</span><br />-----------------------<br /><span style="font-size:85%;">Calling this method will either reset the attribute values to their database<br />values or revert them to their default values. If the Entity Object is<br />posted, all the attributes revert to the unread state, so that a subsequent<br />getAttribute() call will refresh all attributes from the database.</span></p> <p><span style="font-size:85%;">It internally calls</span></p> <pre> <span style="font-weight: bold;">EOImpl.refresh(REFRESH_WITH_DB_FORGET_CHANGES)</span></pre> </div>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com5tag:blogger.com,1999:blog-36229078.post-1163649202547359352006-11-15T19:51:00.000-08:002006-11-15T19:53:22.556-08:00Oracle Apps:Concurrent programs different Execution Methods<span style="font-size:85%;">Following are the possible execution methods which are commonly used in oracle applications Concurrent programs.</span><br /><br /><ul> <li> * Oracle Reports – used for the RDF reports</li> <li> * Host – used for shell scripts, basically the language of the host operating system</li> <li> * PL/SQL Stored procedure – used to run the stored procedure through oracle applications</li> <li> * SQL*Loader – used to run the sql loader programs</li> <li> * SQL*Plus - used to run the anonymous PL/SQL blocks. It will get executed in the same fashion as</li> <li> you are running on SQL Plus.</li> <li> * Java Stored Procedure – The execution file is a Java stored procedure.</li> <li> * Java Concurrent Program – Used for program written in Java.</li> <li> * Spawned – used for c or pro*c Program. Mainly used by standard oracle interfaces.</li> <li> * Perl Concurrent Program – used for programs written in CGI Perl.</li> <li> * Request Set Stage Function – PL/SQL stored function that can be used to calculate the </li> <li> completion statuses of request set stages.</li> <li> * Immediate – execution file is a program written to run as subroutine of the concurrent manager. </li> <li> Oracle doesn’t recommend use of this executable type.</li> <li> * Multi-Language function – execution file is an MLS function that supports running concurrent program in multiple languages.</li> </ul><br /><span style="font-size:85%;">PL/SQL Stored Procedure, Oracle Reports, Host, SQL*loader, SQL*Plus, Java Concurrent Program are the most commonly used executable types.</span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com30tag:blogger.com,1999:blog-36229078.post-1163512650631447082006-11-14T05:39:00.000-08:002006-11-14T05:57:33.786-08:00General:Retreive back hidden windows task-barIn WIndows-XP and 2000, sometimes the taskbar gets hidden. Its because of<br /><pre><br />1)-Multiple Hanged Windows Explorer Programs<br />2)-Low virtual memory when the CPU utilization is around 100%.<br /></pre><br />Its really irritating.<br />Here are the steps to get the same back.<br /><pre><br />1)-CTRL+ALT+DEL.<br />2)-Task Manager<br />3)-Close all the windows explorer programs.<br />4)-Click on "Run New Task".<br />5)-Type "Explorer".<br /></pre><br />That should bring up the Hidden task Bar.AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com1tag:blogger.com,1999:blog-36229078.post-1162901070813423662006-11-07T04:03:00.000-08:002008-03-06T21:37:17.380-08:00J2EE:Creating POJOs from Database tables using Oracle Toplink feature<span style="font-size:85%;">Maynot be a frequent requirement, but sometimes developers may need to create <strong>Plain Old Java Objects(POJOs)</strong> out of Database Tables.This can be easily created by using the <strong>Oracle Toplink</strong> feature available in JDeveloper.<br /><br /><pre>1)-Create a new Application, say ToplinkResearch.<br />2)-Add a project to this Application, say ToplinkResearch.<br />3)-Click New->Business Components->select Toplink/JPA.<br />4)-It will ask for the Database connection and at the same time an offline database<br /> schema it asks for to maintain in the middle-tier.(You can create at the same time <br />as well!!)<br />5)-Select the Table name from the List, just we select for an Entity Object.<br />6)-Thats all and the POJO is created and ready to be compiled.<br />7)-This class can be refactored to be used in any other project.<br />8)-Right click on the POJO class and select "New Sample Java Client.." and it will <br />create a sample Java client that uses this POJO(However, in JM8, this client class <br />gives runtime exception).</pre><br /><br /></span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com11tag:blogger.com,1999:blog-36229078.post-1162801280958488912006-11-06T00:19:00.000-08:002006-11-06T00:21:20.966-08:00BC4J:Understanding EODefImpl class<span style="font-size:85%;"> 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?<br /> EODefImpl class, bahaves as the<span style="font-weight: bold;"> "home" or "factory"</span> 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).<br /><br />Every EOImpl.java has a method like below..<br /><br /><blockquote style="color: rgb(0, 0, 102);"> /**Retrieves the definition object for this instance class.<br /> */<br /> public static synchronized EntityDefImpl getDefinitionObject() {<br /> if (mDefinitionObject == null) {<br /> mDefinitionObject = (EntityDefImpl)EntityDefImpl.findDefObject("oracle.apps.fusion.schema.server.CustomerEO");<br /> }<br /> return mDefinitionObject;<br /> }</blockquote><br />This is where the handle to the Home or factory i.e the DefImpl class is obtained.<br />How to make use of a user defined DefImpl class method in the base EOImpl.class.<br /><br />Here is an example<br /><blockquote style="color: rgb(0, 0, 102);"> CustomerDefImpl home = (CustomerDefImpl)CustomerImpl.getDefinitionObject();<br /> if(home != null &&<br /> home.existsDuplicateCutomerEmail(this.getDBTransaction(), getCustEmail()))<br /> {<br /> raise JboException;<br /> }</blockquote></span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1162469138710475012006-11-02T04:01:00.000-08:002006-11-02T04:05:38.720-08:00Groovy:Expression Example Codes<span style="font-size:85%;">Below are few example codes for the Groovy Expressions.<br /><br />1)-Use of Boolean expression<br /><span style="color: rgb(51, 0, 153);"></span><blockquote><span style="color: rgb(51, 0, 153);"> def x = false</span><br /> <span style="color: rgb(51, 0, 153);"> return x</span></blockquote><span style="color: rgb(51, 0, 153);"></span><br /><br />2)-Use of IF statement<br /><span style="color: rgb(51, 0, 153);"></span><blockquote><span style="color: rgb(51, 0, 153);"> def x= newValue</span><br /> <span style="color: rgb(51, 0, 153);"> if (x <><br /> <span style="color: rgb(51, 0, 153);"> return true;</span><br /> <span style="color: rgb(51, 0, 153);"> else</span><br /> <span style="color: rgb(51, 0, 153);"> return false;</span></blockquote><span style="color: rgb(51, 0, 153);"></span><br /><br />3)-Use of ArrayList<br /><span style="color: rgb(51, 0, 153);"></span><blockquote><span style="color: rgb(51, 0, 153);">def myList=[10,20,30,40,50]</span><br /> <span style="color: rgb(51, 0, 153);">if(myList.get(2) == 30){</span><br /> <span style="color: rgb(51, 0, 153);"> return false</span><br /> <span style="color: rgb(51, 0, 153);">}</span><br /> <span style="color: rgb(51, 0, 153);">else{</span><br /> <span style="color: rgb(51, 0, 153);"> return true</span><br /> <span style="color: rgb(51, 0, 153);">}</span><br /> </blockquote><br /><br />4)-Use of HashMap<br /><blockquote style="color: rgb(51, 0, 153);"> def myMap=[1:"A",2:"B", 3:"C"]<br /> if(myMap[2] == null){<br /> return false<br /> }<br /> else{<br /> return true<br /> }<br /> <br /></blockquote><a href="http://groovy.codehaus.org/Tutorial+1+-+Getting+started">http://groovy.codehaus.org/Tutorial+1+-+Getting+started</a><br /><br /></span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1162459836754109152006-11-02T01:29:00.000-08:002006-11-16T23:50:53.263-08:00JDeveloper:Autogenerate Javadoc comments<span style="font-size:85%;">----------------------------<br />We can create Javadoc automatically for any methods we want in a class.<br /><pre>1)-Click on the Java file.<br />2)-Double Click on any method name.<br /> e.g <strong>public void doDML()</strong><br /> select <strong>"doDML"</strong> word by double clicking the left mouse button.<br />3)-Select Source->Add Javadoc comments from the menu on top.</pre></span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com7tag:blogger.com,1999:blog-36229078.post-1162459488174372672006-11-02T01:23:00.000-08:002006-11-16T23:51:20.326-08:00JDeveloper:Override Methods<span style="font-size:85%;">-------------------------------<br />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.<br />I used to do this by typing <strong>"this."</strong> which popsup the method list popup and then select the method, else by going through Javadoc and typing the method signature.<br /><br />But this is fairly simple..<br /><pre>1)-Open the required java file in the editor.<br />2)-Click on "Source" from meny , then "Override Methods".<br />3)-Select one or multiple methods and it will create the empty body methods with the signatures.</pre><br />It also provides an annotation called "@Override" just before the method signature.</span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1162380377854316652006-11-01T03:21:00.000-08:002006-11-01T03:27:40.313-08:00JDBC:A framework for calling a stored procedure.<div class="storycontent"> <p><span style="font-size:85%;">Here is a generic code snippet for calling a PLSQL stored procedure using JDBC.<br />It takes the stored procedure callablestatement and an array of variables which need to be passed to this procedure.<br /></span></p> <pre><pre> <span style="color: rgb(0, 0, 102);">protected void callStoredProcedure(String stmt, Object[] bindVars) {</span><br /><span style="color: rgb(0, 0, 102);"> PreparedStatement st = null;</span><br /><span style="color: rgb(0, 0, 102);"> try {</span><br /><span style="color: rgb(0, 0, 102);"> st = getConnection().createPreparedStatement("begin " + stmt + "; end;", 0);</span><br /><span style="color: rgb(0, 0, 102);"> if (bindVars != null) {</span><br /><span style="color: rgb(0, 0, 102);"> for (int z = 0; z != bindVars.length-1; z++) {</span><br /><span style="color: rgb(0, 0, 102);"> st.setObject(z + 1, bindVars[z]);</span><br /><span style="color: rgb(0, 0, 102);"> }</span><br /><span style="color: rgb(0, 0, 102);"> }</span><br /><span style="color: rgb(0, 0, 102);"> st.executeUpdate();</span><br /><span style="color: rgb(0, 0, 102);"> } catch (SQLException e) {</span><br /><span style="color: rgb(0, 0, 102);"> throw new SQLException(e);</span><br /><span style="color: rgb(0, 0, 102);"> } finally {</span><br /><span style="color: rgb(0, 0, 102);"> if (st != null) {</span><br /><span style="color: rgb(0, 0, 102);"> try {</span><br /><span style="color: rgb(0, 0, 102);"> st.close();</span><br /><span style="color: rgb(0, 0, 102);"> } catch (SQLException e) {</span><br /><span style="color: rgb(0, 0, 102);"> }</span><br /><span style="color: rgb(0, 0, 102);"> }</span><br /><span style="color: rgb(0, 0, 102);"> }</span><br /><span style="color: rgb(0, 0, 102);"> }</span><br /></pre><br /></pre> </div>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1162355740038244812006-10-31T20:34:00.000-08:002006-10-31T20:35:40.046-08:00Spring Framework:The advantages<span style="font-size:85%;">Spring Framework:<br />----------------<br /> The main aim of Spring framework is to elliminate the complexities of writing a complex J2EE application.e.g in a typical J2EE env, if you want to access EJB, then Spring takes away the pain of using JNDI or if you need to use JDBC, then it takes away the pain of using "try" "catch" "finally" blocks etc.<br /><br /><pre>1)-Helps designing and organizing the components(web-tier as well as<br />the server side bsuiness components) in a much layered manner(Just like BC4J, but more than that)<br />2)-It uses simple POJOs as the business logic class instead of EJBs.<br />3)-It has got a greater support for Dependency Injection as each layer of<br />code in Spring framework works in isolations. So essentially developers<br />can pull out any layer and test them in isolation.<br />4)-It has a great JDBC wrapper in it.<br />5)-It has Inversion of Control container and AOP.(Please google for these two terms)<br />6)-Most importantly, it provides an env to have a Test Driven Development.</pre><br /><br />Listen to <a href="http://www.theserverside.com/tt/talks/videos/RodJohnson2004/interview.tss?bandwidth=real">this webcast</a> by Rod Johson, the founder of Spring Framework.</span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1162285021666204522006-10-31T00:56:00.000-08:002006-10-31T00:57:01.676-08:00BC4J:transaction-level postChanges() is hazardous!!<span style="font-size:85%;">The <span style="font-weight: bold;">transaction-level postChanges()</span> method that exists to force the transaction to post unvalidated changes without committing them is not recommended for use in web applications unless you can guarantee that the transaction will definitely be committed or rolled-back during the same HTTP request. Failure to heed this advice can lead to strange results in an environment where both application modules and database connections can be pooled and shared serially by multiple different clients.</span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1161938962675704612006-10-27T01:47:00.000-07:002006-10-27T01:49:22.683-07:00Gen Tech:How to copy HTML data from browser to an Excel sheet.<span style="font-size:85%;"><span class="postbody"> There is a pretty simple way of exporting an HTML data into an Excel file without much effort of writing any program.<br />I have tested many times and it works.<br />Note: It works only in IE.<br /><br />Please follow the steps below.<br /></span></span> <ul> <li><span style="font-size:85%;"><span class="postbody"> 1)-Open MS Excel in your pc and keep it in taskbar. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 2)-Access any URL which gives an HTML table output. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 3)-Select the whole of the data you want to export. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 4)-After selecting just see the mouse where it is. DOnt move the mouse and by pressing the left button drag the mouse towards the taskbar to the top of the Excel icon. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 5)-Dont yet release the mouse even if the mouse icon changes. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 6)-Keep the left button pressed and keep on top of the excel button.It automatically maximizes the Excel spreadsheet. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 7)-Dont release the mouse button in the whole process. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> 8 )-Just drag the mouse with left button pressed towards the start of the Excel sheet and release the mouse button. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> Thats all.. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> The whole trick is not to release the left mouse button. </span></span></li> <li><span style="font-size:85%;"><span class="postbody"> Please try in IE and see if it helps you. I have tried number of times.</span></span></li> </ul>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com1tag:blogger.com,1999:blog-36229078.post-1161324423035252132006-10-19T23:05:00.000-07:002006-10-19T23:08:15.520-07:00Oracle Apps:Programmatically Compile a KFF View<span style="font-size:85%;">Sometimes its required an API to call from our PL/SQL package to compile the KFV view in Apps.<br /></span><small><span style="font-family:Arial;"><small><big></big></small><blockquote><small><big>request_id :=</big> </small>fnd_request.submit_request('FND',<br /> 'FDFCMPK',<br /> 'Compiling Flexfield',<br /> SYSDATE,<br /> FALSE,<br /> 'K', -- Type of FF<br /> <i><application></application></i>, -- Application short name<br /> p_ff_name, -- FF name<br /> TO_CHAR(l_flex_num) -- ID_Flex_Num); </blockquote></span></small>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1161181143489427762006-10-18T07:12:00.000-07:002006-10-18T07:19:03.506-07:00Java:Programmatically compiling a java file<pre>The class com.sun.tools.javac.Main.compile provides the programming interface for javac.<br />sample code is :<br /><br /><blockquote style="font-weight: bold; color: rgb(0, 153, 0);"> <code> int errorCode = com.sun.tools.javac.Main.compile(new String[] {<br /> "-classpath", "bin",<br /> "-d", "/temp/dynacode_classes",<br /> "dynacode/sample/Foo.java" });<br /></code></blockquote><code><br />errorCode return 0 for Sucess and some non-zero number for any compilation failure.<br /><br />Also to print the compilation error messages to an o/p file,<br />it has another overloaded method.<br /><br /></code><blockquote style="font-weight: bold; color: rgb(0, 153, 0);"> <code> // Defined in com.sun.tools.javac.Main<br /> public static int compile(String[] args);<br /> public static int compile(String[] args, PrintWriter out);<br /></code> </blockquote><br /></pre>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com1tag:blogger.com,1999:blog-36229078.post-1161166761972130722006-10-18T03:12:00.000-07:002006-10-18T03:19:21.993-07:00Perl: XML Parsing program in Perl using XML module<span class="postbody">Here is a sample code snippet on how we can easily parse an XML doc in PERL (tested in Linux).<br /><br /><pre><br /><span style="font-weight: bold; color: rgb(255, 0, 0);font-size:85%;" ><span style="font-family: courier new;">#!usr/local/bin/perl </span><br /> <br /> <span style="font-family: courier new;">##Programs for XML parsing. </span><br /> <br /> <span style="font-family: courier new;">use XML::Parser; </span><br /> <br /> <span style="font-family: courier new;">my $p = XML::Parser->new(Style => "Tree"); </span><br /> <span style="font-family: courier new;">my $input = '/home/ammishra/perl/ip.xml'; </span><br /> <br /> <br /> <span style="font-family: courier new;">traverse( $p->parsefile( $input ) ); </span><br /> <span style="font-family: courier new;">exit(0); </span><br /> <br /> <br /> <span style="font-family: courier new;">sub traverse </span><br /> <span style="font-family: courier new;">{ </span><br /> <span style="font-family: courier new;"> my $node = shift; </span><br /> <span style="font-family: courier new;"> while ( defined ( my $element = shift @{ $node } )) </span><br /> <span style="font-family: courier new;"> { </span><br /> <span style="font-family: courier new;"> my $child = shift @{ $node }; </span><br /> <span style="font-family: courier new;"> if ( ref $child ) # if $child is yet another arrayref node </span><br /> <span style="font-family: courier new;"> { </span><br /> <span style="font-family: courier new;"> my %attr = %{ shift @{ $child } }; </span><br /> <span style="font-family: courier new;"> # yank the attributes out of the grandchild </span><br /> <span style="font-family: courier new;"> print "$element has attributes @{[ %attr ]}\n"; </span><br /> <span style="font-family: courier new;"> traverse( $child ); </span><br /> <span style="font-family: courier new;"> # child element is now just a list of element/children pairs </span><br /> <span style="font-family: courier new;"> } </span><br /> <span style="font-family: courier new;"> else # otherwise, if $child is just some text </span><br /> <span style="font-family: courier new;"> { </span><br /> <span style="font-family: courier new;"> print "$child\n"; </span><br /> <span style="font-family: courier new;"> } </span><br /> <span style="font-family: courier new;"> } </span><br /> <span style="font-family: courier new;">}<br /></pre><br /></span></span></span><span style="font-size:85%;"><config servertype="sunhosts" reporttype="patches and levels"></config></span><span style="font-weight: bold; color: rgb(255, 0, 0);font-size:85%;" ><config style="font-family: courier new;" servertype="sunhosts" reporttype="patches and levels"></config></span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1161163018674661822006-10-18T02:10:00.000-07:002006-10-18T02:16:58.676-07:00BC4J+OA Framework:Get number of rows in a ViewObject without fetching all rows to middletier<span style="font-size:85%;">In BC4J(Business Component for Java),Lets assume, we have a View Object(VO) based on a SQL.<br />The code below prints i as "0" i.e no rows are fetched to the middle tier.<br /><br /></span><tt><b> vo.setMaxFetchSize(-1);<br /> vo.executeQuery();<br /> int i = vo.getFetchedRowCount();<br /> System.out.println("i="+i);<br /><br /></b>Now use </tt><tt><b>getRowCount() instead of getFetchedRowCount();<br /></b>and it would print correct no of records.<br /><br />Explanation:<br />------------<br /> </tt><tt><span style="font-weight: bold;">executeQuery()</span> doesn't actually fetch the first batch of rows right then and there.</tt><tt> The next operation that requires a query (such as first(), for example) will do this.</tt><tt> <span style="font-weight: bold;">getRowCount()</span> forces the <span style="font-weight: bold;">last()</span> row to be retrieved. But getRowCount() might be a costly affair in cases where we dont want the rows to be fetched from the DB, say we just want the count.<br /><br /></tt><tt>using <span style="font-weight: bold;">getEstimatedRowCount()</span> if you want the count without fetching all the rows, solves the same purpose.</tt><br /><tt><br /><br /><b><br /></b></tt>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com0tag:blogger.com,1999:blog-36229078.post-1161162498098695952006-10-18T02:06:00.000-07:002006-10-18T02:08:18.106-07:00Oracle Apps:Open a Conc program Output in your favourite Program<span style="font-size:85%;">There is a profile option called <span style="font-weight: bold;">"Viewer:Application for Text"</span> in Apps.<br /> Logon to Oracle Applications , use System Administrator Responsibility and Navigate as :-<br /> Install -> Viewer Options<br /> to open the Form "Viewer Options"<br /><br /> Then do the entry as shown below :-<br /><br />File Format Mime Type Description<br />Text application/msword Microsoft Word(.doc)<br />Text application/vnd.ms-excel Excel (.xls)<br />Text text/plain Notepad(.txt)<br /><br /> Then ensure that the profile option<br /> Viewer: Application for Text<br /> is set to BLANK at the Site Level.<br /><br /> Then ensure that the profile option<br /> Viewer: Text<br /> is set to Browser at the Site Level<br /><br /> Submit a Concurrent Request that generates Text Output File<br /> Click on View Output Button<br /> You will see a LOV showing<br /> Microsoft Word(.doc)<br /> Excel (.xls)<br /> Notepad(.txt)<br /></span>AMulya.Mishrahttp://www.blogger.com/profile/18098072062787258561noreply@blogger.com4