tag:blogger.com,1999:blog-248738832023-11-15T22:03:52.356+05:30wonder!!!Unknownnoreply@blogger.comBlogger51125tag:blogger.com,1999:blog-24873883.post-4962862878434984042007-02-02T09:14:00.000+05:302007-02-02T10:07:31.039+05:30EMI computationsI am recently working on setting up my farmland. To compute the cost of paying back my own investments to myself from the farm income, I was faced with an EMI like situation where the infrastructure investment is amortized over (say) 10 years and I expect some constant amounts to be payed back towards that investment at regular intervals (say once a year or once in 3 months or whatever). Obviously I will also charge myself an interest rate tied to the interest rates of some pessimistic instruments like fixed deposits at a bank (8.5% in India now).<br /><br />This is a formula I have derived from first principles 2-3 times over in my life so far and each time I seem to lose it (easy as it is to re derive). So as blogging is the right idiom to log that (as long as my blog website is around , at least) here goes.<br /><br />Some symbols I need to use:<br /><dl><br /><br /><dt>r</dt><br /><dd>the rate of interest as a fraction of 1. 8% is 0.08 and so on. rate of interest in percentage divided by 100, if you will. </dd><br /><dt>m</dt><br /><dd>Number of units of time elapsed between payments.(See y below). Number of months, or number of weeks or whatever - as long as it is in the same level as y below.</dd><br /><dt>y</dt><br /><dd>number of units that go into making up an year. If weeks - you can take it to be 52. If months you can take it to be 12. If days you can take to be 365.</dd><br /><dt>P</dt><br /><dd>Initial Investment - P for 'principal'.</dd><br /><dt>E</dt><br /><dd>Equated Monthly Instalment - when payed monthly. For this more generalized computation its more like Equated Periodical Instalment</dd><br /><dt>n</dt><br /><dd>Number of payments (once in each m units of time) over which the principal would be completely payed back , along with compound interest.</dd><br /></dl><br /><br />Now We define a handy term called <em>R</em> which is basically <br><em>(1+ (r*(m/y)))</em><br> This represents the rate at which the residual amount inflates due to interest burden. The residual amount is taken to inflate in bursts or as a single step once in every <em>m</em> units of time. [[ Obiter Dictum: rather than in a continuous manner - though even that could be done : using calculus.]]<br /><br />So a principal amount <em>P</em> grows to be <em>P*R</em> after m units of time. Left to itself, without any payments, it grows exponentially. After n units of times it would amount to <em>R*R^n</em>, where <em>^</em> means exponentiation, "raised to the power".<br /><br />But every <em>m</em> units of time a sum <em>E</em> is payed back.[[Obiter Dictum: part of which goes to pay the interest and the remaining part goes to pay the principal. The part towards principal in negligible in the beginning and most of the payment is towards interest. the situation is reversed by the end of n payments.]]. This changes the situation.<br /><br />After m units of time, whats remaining to be payed back is <br /><em>P*R - E</em><br /> During the second m units the remaining amount grows again by a factor <em>R</em> to <br /><em>(P*R - E)*R</em><br /> And during the third unit the same procedure gives <br /><em>((P*R - E)*R - E)*R</em><br /><br /><br />After <em>n</em> paybacks the remaining amount should be 0(zero, cipher, nill, shunya).After all, that's the definition of EMIs. So we have<br /><br /><em>(...((P*R - E)*R - E)*R ...)*R - E = 0</em><br /><br /><br />Or with some basic regrouping (where ^ is again exponentiation and 1 is chosen to be written as R^0):<br /><br /><em>P*R^n - E(R^(n-1) + R^(n-2) + ... + R^0) = 0</em><br /><br /><br />Now using the summation formula for a geometric series the same equation can be written as:<br /><br /><em>P*R^n - E*((R^n - 1)/(R-1)) = 0</em><br /><br /><br />Therefore <em>E</em> can be found to be:<br /><br /><em>E=P*R^n*(R-1)/(R^n - 1)</em><br /><br /><br />The above closed form formula for computation of EMI is very amenable for entry into a good calculator. In fact on my Casio calculator I have now stored the above as a function and I simply assign values to P, r, m, y and n and I can compute E very easily using that function.<br /><br />A small example computation.<br /><br />Say you have borrowed 1 lakh rupees. You want to pay back that 1 lakh rupees in proper EMIs, every month over ten years. Say the rate of interest charged to you is 10% (more then the housing loans in India but less than the rate for other loans).<br /><br />So <em>R</em> for this situation is <em>(1 + 0.1 * (1/12))</em>. <em>m</em> is 1 as it is payed every one unit of time (a month in this case). and <em>y</em> is 12 as there are 12 months in a year. Notice that if we artifically chose weeks for this case <em>m</em> would be 4 and <em>y</em> would 52 making it the same R. So in short R is 1.00833.<br /><br />Its good to calculate <em>R^n</em> and keep it handy (in case you dont have functions - like on this windows calculator I am using right now). <em>R^n</em> is 2.70704 as n is 120 (12*10).<br /><br />Now therefore the EMI is <br /><br><em>E = 100000 * 2.70704 * (1.00833 - 1) / (2.70704 - 1) = 1320.97 or 1321 </em><br>.<br /><br />So after 120 payments you would have payed back <em>1321*120 = 158520 rupees</em>.<br /><br />If you wanted to do the same repayment in annual instalments.<br /><br /><em>R</em> is <em>(1 + 0.1 * (1/1))</em> or 1.1. <em>n</em> is 10. <em>R^n</em> is 2.59374. And E is<br /><br>E = 100000 * 2.59374 * (1.1 - 1) /(2.59374 - 1) = 16274.55 or 16275 <br>.<br /><br />Now you would have payed back 162750 rupees.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-31322036024547679982007-02-01T22:16:00.000+05:302007-02-01T22:29:54.447+05:30Conditional ProabilityHere is an example of conditional probability from real life. I have found the confusion addressed here in many minds.<br /><br />Scenario: A couple has a child already. Call it a girl. If they are pregnant again, many people assume its most likely to be a boy this time as overall there has to be balance. In fact if you see around <span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)">don't</span> you see a mix more often than two boys? yes. And than two girls? yes again.<br /><br />Actually, the second child is not really a dependent trial (on the first one). Again this time its as likely to be a boy as it is to be a girl. So what trips the conventional logic in the above is that though the mix is more likely than either of "two boys" and "two girls" when seen as same sex versus different sexes the outcomes are equally likely.<br /><br />To analyze in a more explicit way: Possible child sex combinations are BB,<span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)">BG</span>,GB,<span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)">GG</span>. Now if the first child is already a boy the probabilities of each of those outcomes is 0,0,0.5,0.5 although before the first child was born it was 0.25,0.25,0.25,0.25.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-65575014325779809282007-02-01T19:26:00.000+05:302007-02-01T19:41:24.406+05:30Internet Explorer 7Tried out the IE7 today. It quite obviously has learn lessons like tabbed browsing, search bar, <span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)">RSS</span> feeds from <span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)">firefox</span>/<span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)">mozilla</span>/opera etc.<br /><br />It has also exceeded the other browsers with their "quick tabs" ,"new tab", and "clear type" concepts. The <a href="http://blogs.msdn.com/ie/archive/2006/03/03/543181.aspx">clear type</a> is certainly more easy on the eyes. Quick Tabs is a cool way to select the tab you want and new tab is quite handy (though I type <span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)">CTRL</span>-T most of the time).<br /><br />On the whole I think its quite cool (I am usually a MS <span class="blsp-spelling-error" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)">basher</span> but what with having to move to a windows based development job now and everything I am learning things like C# etc and using windows more - there are some cool concepts. I expect to post soon about my critical appreciation of C# as a language - I think its quite cool - I initially though it was simply a java <span class="blsp-spelling-corrected" id="SPELLING_ERROR_5">clone</span> - its not just that).<br /><br />And there is also a phishing warning (dont know if oit works well or anything - but its certainly better than nothing, I suppose).<br /><br /><br />Post Script:<br />the tabs could use their close buttons even when they are not high lightedUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-49982456206022757762007-01-30T18:42:00.000+05:302007-01-30T18:53:50.987+05:30How about usability?The title links to a sample page from <span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)">MSDN</span>.<br /><br />Notice that the breadcrumbs section (which lists the parent topic names all the way to the root topic) has a drop down that pops up (<span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)">that's</span> a funny expression) for each parent topic which lists all the peer topics at that level. This is a cool information architecture.<br /><br />BUT<br /><br />the usability of the implementation is bad. Notice that the <span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)">pop-ups</span> cover other topic names and its nuisance to have to move the <span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)">mouse</span> or hit <span class="blsp-spelling-corrected" id="SPELLING_ERROR_4">escape</span> button to lose the pop up that popped up because you overshot the mouse.<br /><br />May be the usability testers tested with a few topics in the crumbs. The problem starts when there are many topics. Whats the way out? Nothing easy. Thats probably the reason why it is deployed that way.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-80866699837360820192007-01-19T09:27:00.000+05:302007-01-19T09:32:39.631+05:30Blog Entries or comments?After posting <a href="http://wonder31415.blogspot.com/2007/01/good-math-bad-math-description.html">this</a> I got thinking about whether that should have been a comment on that blog.<br /><ul><li>if I make a comment there I lose an entry on <span style="font-style: italic;">my</span> blog.</li><li>my blog is a collection of <span style="font-style: italic;">my</span> thoughts (so what if that main article inspired it) - I would rather have them in one place<br /></li><li>tools like <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0">technorati</span> get at my comments anyway (if a reader of a blog entry wants to know). This possibility has a side effect which is more <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_1">important</span> than the effect-main. Those who want to other's thoughts on <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2">someone's</span> thoughts can decide how to understand those thoughts by seeing the collage at my blog and they may even decide to skip my comment altogether based on my blog ranking.</li></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-45143821499638543872007-01-19T08:57:00.000+05:302007-01-19T09:21:22.277+05:30Good Math, Bad Math, ???? descriptionOver at <a href="http://scienceblogs.com/goodmath/2007/01/basics_standard_deviation_1.php">Good Math, Bad Math</a>, the author writes (in other articles) about how people don't "get it" with maths ...<br /><br />Generally those articles are fun to read. But on many an occasion the author's posts themselves are corrected by some commenter or other. But this obviously is a lesser sin. The author does pick the right things to object to. And they might make those mistakes mainly because of the nature of good blogging : that which is done in the heat of the moment, without too much polishing etc.<br /><br />Now with that preamble laid out...<br /><blockquote>In the article linked to here, the author says<br />The standard deviation, which is usually written σ is a <em>root mean-square</em> measure - which means that it's the mean (average) of the square root of the difference between the points and the mean squared. The sum of the squares is also a useful figure, called the <em>variance</em>; the variance is just the mean of the squares - that is σ<sup>2</sup><br /></blockquote>The <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0">RMS</span> expands into <span style="font-style: italic;">root (of the) mean (of the) square(s of the deviation from the mean)</span><br />not <span style="font-style: italic;">mean of the root</span>, as described above. In fact, <span style="font-style: italic;">mean of the square root of the difference between the points and the mean squared</span> is a cool measure too. Its something like the first moment of the absolute difference or the <span style="font-style: italic;">mean absolute deviation </span>(when the positive root alone is considered).<br /><span style="font-style: italic;"><br /></span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-82818455287916010482007-01-15T21:32:00.000+05:302007-01-15T21:35:30.976+05:30language independent languageMost of our languages seem to be made of arbitrary sounds assigned to objects. language is called a bhashe in kannada to stress the point.<br /><br />Even then, language seems to be be made of language independent features in many parts of the brian which interpret actions. My mirror neurons which eventually "hear" 'run' act the same way as when I hear 'Odu'.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-10553177795711582222007-01-15T21:31:00.000+05:302007-01-15T21:32:53.861+05:30on poetrylook at me disrobe<br />I will remove even this garment<br />I will remove now the skin, the tissues<br />I will remove my marrow now. one up.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-72624814253339741102007-01-15T21:27:00.000+05:302007-01-15T21:31:38.112+05:30well designed presentation of thoughtsWell recursively, this thought itself is rehearsed many times over with self and friends. But ...<br /><br />Blogging should be a rather spontaneous registration of thought process : rather than a well thought out, polished 'article' : though many bloggers seems to do this, going by private knowledge of what they do or by actual year end admissions I saw recently.<br /><br />The spontaneous blog idiom is claimed by some to actually replacethe letters between scientists (or intellectuals in general) of yester years which acts as a basis of knowing the process by which many results or whatever were arrived at which is fast being lost : replaced by emials and telephones.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-24873883.post-78383550322052864952006-12-25T18:01:00.000+05:302006-12-25T18:26:40.347+05:30Science,...Coninuing discussion(rather continuing quoting from) on <a href="http://wonder31415.blogspot.com/2006/12/why-read-literary-fiction.html">John Fowles's "the frech lieutenant's woman"</a> ...<br /><br />-------------(pages 51-52)<br />He would have made you smile, for he was carefully equipped for his role. He wore stout nailed boots and canvas gaiters that rose to encase Norflok breeches of heavy flannel. There was a tight and absurdly coat to match;...and a voluminous rucksack, from which you might have shaken out an already heavy array of hammers, wrappings, notebooks, pillboxes, adzes and heaven knows what else. Nothing is more incomprehensible to us than the methodicality of the Victorians;...<br /><br />Well, we laugh. But perhaps there is somethign admirable in this dissociation between what is comfortable and what is most recommended. ... If we take this ... as mere stupidity, blindness to the empirical, we make, I think, a grave - or rather a frivolous - mistake about our ancestors; because it was men not unlike Charles, and as overdressed and over-equipped as he was that day, who laid the foundations of all our modern science. ... They sensed that current accounts of the world were inadequate; that they had allowed thier windows on reality to become smeared by convention, realigion, social stagnation; they knew, in short, they had things to discover... We think (unless we live in a research laboratory) that we have nothing to discover, and the only things of the utmost imporotance to us concern the present of man. So much the better for us? We are not the ones who will finally judge.<br />-----------------------------<br /><br />But here I find something that contradicts what I quoted before about how intelligent, lazy people set their sights are set too high. But then may be not. One describes the attitude of a generalist and the otehr describes the actions they do( because their sights are set too high).<br /><br />------------------Page 53<br />Just as you may despise Charles for his overburden of apparatus, you perhaps despise him for his lack of specialization. But you must rememeber that the natural history had not then the pejorative sense it has today of a flight from reality ....<br />---------------------------------<br /><br />Now this is certainly in contradiction. :-)<br /><br />---------------Page 53<br />...but think of Darwin ... The origin of Species is a triumph of generalization, not specialization; and even if you prove to me that the latter would have been better for Charles the ungifted scientist, I should still maintain the former was better for Charles the human being<br /><br />---------------------------------<br /><br />Thats something I agree with. Its after my own passions. I am not a practisisng scientist and I tend to condone a breadth of view than a deep specialization. Specialization in anything has never appealed to me.<br /><br />A small diversion for my almost non-existent readers:<br /><br />A surgeon was met by an old lady in a party. The old lady asked "What are you?". The surgeon said "I am a naval surgeon".<br />"Oh, the way you people specialize these days!".<br />.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-24873883.post-69667732995094699062006-12-23T11:40:00.000+05:302006-12-23T11:54:47.804+05:30Madeira - MadiraContinuing <a href="http://wonder31415.blogspot.com/2006/12/why-read-literary-fiction.html">this</a> ,<br />--------Page 40<br />...he called, sipped madeira, and said - and omitted - as his ecclesiastical collegue had advised.<br />------------------<br /><br />This word caught my eye. A look into my Webster's dictionary told me that this refers to amber or white wine from Madeira an island near spain. (<a href="http://dictionary.reference.com/browse/madeira">This</a> is not as good as my Webster's, but its something handy)<br /><br />And a simple google search will show you a lot of that.<br /><br />But then this word is used in hindi, kannada etc as madira to mean intoxicating drink. And sanskrit has words like madya to mean an intoxicating drink.<br /><br />A brief study of Monier Milliams showed that madira indeed exists from the time of Mahabharata (unless, of course, one chooses o argue that this is from a prakshipta part, that is, a part that has been added to Mahabharata by someone down the line.) . If you dont have the hard copy , you can see it for yourself at <a href="http://students.washington.edu/prem/mw/m.html">http://students.washington.edu/prem/mw/m.html</a>.<br /><br />It would be relaly interesting to know how that island got that name(assuming this word is from sanskrit/india). My hypothesis is that the Arabs (Remember? some time in the past they were the most open of cultutres and learnt a lot off Indians and Europeans. I refer you to folks like Al Beruni who translated sanskrit works into Arabic, and whose works now tell us about some lost works of Sanskrit :-) ) took this word with them to spain which they ruled.<br /><br />Aside: The distillations by Arabs were very popular with indian kings (Moghals included).Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-21998039748208292362006-12-23T11:04:00.000+05:302006-12-23T11:27:07.053+05:30Why read literary fiction?This is a discussion I have had with friends many times over.<br /><br />I am now reading "The French lieutenant's woman" by John Fowles. So some thoughts based on the first 40 pages. (This is also a nice use of this idiom to gather together bits of the work into a statement on what I liked in a work of literary fiction).<br /><br />-----------------------(page 21-22)<br />[Period 1850s-1860s]<br />Laziness was, I am afraid, Charles's distinguishing trait. Like many of his contemporaries he sensed that the earlier self-responsibility of the century was turning into self-importance: that what drove the new Britain was increasingly a desire to seem respectable, in place of teh desire to do good for good's sake. He knew he was over-fastidious. But how could one write history with Macaulay so closely behind? Fiction or poetry in the midst of the greatest galaxy of talent in the history of English literature? How could one be a creative scientist, with Lyell and Darwin still alive? Be a statesman, with Disraeli adn Gladstone polarizing all the available space?<br />You will see that Charles set his sights high. Intelligent idlers always have, in order to justify their idleness to their intelligence.<br />-------------------------<br /><br />----------(Page 26)<br />["her" in the following is Mrs Poulteney, who was "like some plump vulture, endlessly circling in her enless leisure and endowed in the first field with a miraculous sizth sense as regards dust,infigermarks [and immorality]"]<br /><br />In her [Mrs Poulteney] fashion, she was an epitome of all the most crassly arrogant traits of the ascendant British Empire. Her only notion of justice was that she must be right; and het only notion of governament was an angry bombardment of the impertinent populance<br />----------------------<br /><br />------------------- (page 37)<br />(Vicar is trying extract a favour from Mrs Poulteney)<br /><br />Vicar: "...the french barque was driven ashore ... . His leg had been crushed at the first impact, but he clung o a spar and was washed ashore. You must surely have read of this?"<br /><br /><p>Mrs Poulteney: "Very probably. I do not like the french"</p><p>(The dots in the following are form the original - not my omissions :-) )</p><p>Vicar: "Captain Talbot, as a naval officer himself, most kindly charged upon his household the care of the ...[sic] foreign officer"</p><p>------------------------------------------</p><p> </p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-30557519127231547512006-12-19T20:46:00.000+05:302006-12-19T21:03:33.234+05:30URA MiscellanyThe title is lifted from an anecdote narrated by Dr BGL Swamy in his "mysore diary".<br /><br />Ha Ma Nayak: U R A Miscellany<br />BGL Swamy: you say all my life's work in botany, literature, history etc is a miscellany?<br />Ha Ma Nayak: No I mean U R Ananthamurthy's miscellany ...<br /><br />Having said that , going by news paper reports, he is becoming ever more overbearing.<br /><br />In the past he has said "until every child in karnataka can attend an English school, no one should be allowed to". This is just him posing as a socialist. I call upon him to say<br /> * "until every man(person) can wear nice coats"<br /> * "no one(meaning HIM) should wear a coat ...<br /> * "until everyone in karnataka has been given a site by the government, I wont accept mine (apparently he has been granted a site for his "scholarly" achievements)<br /> * ... until everyone can become a university teacher (can become - need not become - but equal opportunities must exist): I wont draw salary/pension from such posts<br />... HA<br /><br />And recall what he did with the dattajayanti etc some time back.<br /><br />Latest is that he refuses to attend Kannada sahitya sammelana as some politicians might attend it and he never participates in a public function along with a politician. Nice try. How do you define a man to be a politician My Ananthamurthy? What must a man do in order to become one? (Is what you did to bairappa politics? How did you get the gyanapeetha ? Without any politicking, eh?)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-31300990552493719872006-12-13T12:13:00.000+05:302006-12-13T12:18:14.414+05:30TWiki Checklist pluginThe <a href="http://twiki.org/cgi-bin/view/Plugins/ChecklistPlugin">TWiki checklist plugin (v1.018)</a> caused some problems with my TWiki version 1.1.<br /><br />The problem was that when I went to the InstalledPlugins topic of my TWiki web: the Checklist plugin would not show up as na installed plugin at all. Nor would it work: things like %CLI% would simply show up as themselves.<br /><br />I had to edit LocalSite.cfg file and add<br /><pre>$TWiki::cfg{Plugins}{ChecklistPlugin}{Enabled} = 1;</pre><br />to get it working.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-24873883.post-75840789368555661632006-12-07T09:25:00.000+05:302006-12-07T09:35:43.907+05:30musicindiaonline and greasemonkey<a href="http://www.musicindiaonline.com"><span style="text-decoration: underline;">musicindiaonline</span></a> has tons of indian music. The problem is that on linux, their javascript does not work well (I see some errors in the JS console).<br /><br />I went ahead and wrote some <a href="http://greasemonkey.mozdev.org/">greasemonkey</a> based code that finds the links that point to music clips, performs some transformation on them(this, I learnt from their scripts) and finally pops up a popup window that works well with realplayer 10 on linux (you will still face the code problems with some of thier clips. That is beyond this solution).<br /><br />Here is the code<br />----------------<br /><pre><br /><br /><br /><span style="color: rgb(0, 139, 139);">function</span> scanForMusicLinks()<br /><span style="color: rgb(0, 139, 139);">{</span><br /> <span style="color: rgb(0, 139, 139);">var</span> menuDiv = <span style="color: rgb(165, 42, 42);"><b>document</b></span>.getElementById(<span style="color: rgb(255, 0, 255);">'divMenu'</span>);<br /><br /><br /> <span style="color: rgb(0, 139, 139);">var</span> musicRE = <span style="color: rgb(255, 0, 255);">/\/p\/x\//</span>;<br /><br /> <span style="color: rgb(0, 139, 139);">var</span> anchors = <span style="color: rgb(165, 42, 42);"><b>document</b></span>.getElementsByTagName(<span style="color: rgb(255, 0, 255);">'A'</span>);<br /><br /> <span style="color: rgb(0, 139, 139);">var</span> nLinks = 0;<br /><br /> <span style="color: rgb(0, 139, 139);">var</span> anchorData = <span style="color: rgb(0, 139, 139);">[]</span>;<br /><br /> <span style="color: rgb(165, 42, 42);"><b>for</b></span>(<span style="color: rgb(0, 139, 139);">var</span> i = 0; i< anchors.length;i++)<br /> <span style="color: rgb(0, 139, 139);">{</span><br /> <span style="color: rgb(165, 42, 42);"><b>if</b></span>(musicRE.exec(anchors<span style="color: rgb(0, 139, 139);">[</span>i<span style="color: rgb(0, 139, 139);">]</span>.href))<br /> <span style="color: rgb(0, 139, 139);">{</span><br /> <span style="color: rgb(0, 139, 139);">var</span> href = anchors<span style="color: rgb(0, 139, 139);">[</span>i<span style="color: rgb(0, 139, 139);">]</span>.href + <span style="color: rgb(255, 0, 255);">'play.smil'</span>;<br /><br /><br /> href = href.replace(<span style="color: rgb(255, 0, 255);">'/p/x/'</span>,<span style="color: rgb(255, 0, 255);">'/g/r/'</span>);<br /><br /> <span style="color: rgb(0, 139, 139);">var</span> content = anchors<span style="color: rgb(0, 139, 139);">[</span>i<span style="color: rgb(0, 139, 139);">]</span>.innerHTML;<br /><br /> anchorData.push(<span style="color: rgb(0, 139, 139);">{</span>href:href,content:content<span style="color: rgb(0, 139, 139);">}</span>);<br /><br /><br /> <span style="color: rgb(0, 139, 139);">}</span><br /> <span style="color: rgb(0, 139, 139);">}</span><br /><br /> <span style="color: rgb(165, 42, 42);"><b>if</b></span>(anchorData.length > 0)<br /> <span style="color: rgb(0, 139, 139);">{</span><br /> processAnchorData(anchorData);<br /> <span style="color: rgb(0, 139, 139);">}</span><br /><br /><span style="color: rgb(0, 139, 139);">}</span><br /><br /><span style="color: rgb(0, 139, 139);">function</span> playThis(index)<br /><span style="color: rgb(0, 139, 139);">{</span><br /> <span style="color: rgb(0, 139, 139);">var</span> playerSpan = <span style="color: rgb(165, 42, 42);"><b>document</b></span>.getElementById(<span style="color: rgb(255, 0, 255);">"playerSpan"</span>);<br /><br /><br /> playerSpan.innerHTML = <span style="color: rgb(255, 0, 255);">'<EMBED TYPE="audio/x-pn-realaudio-plugin" NAME="RAPlayer" SRC="'</span> +<br /> anchorData<span style="color: rgb(0, 139, 139);">[</span>index<span style="color: rgb(0, 139, 139);">]</span>.href<br /> + <span style="color: rgb(255, 0, 255);">'" AUTOSTART="TRUE"></EMBED>'</span>;<br /><br /><span style="color: rgb(0, 139, 139);">}</span><br /><br /><span style="color: rgb(0, 139, 139);">function</span> processAnchorData(anchorData)<br /><span style="color: rgb(0, 139, 139);">{</span><br /> <span style="color: rgb(0, 139, 139);">var</span> html = <span style="color: rgb(255, 0, 255);">'<HTML><HEAD><SCRIPT language="JavaScript1.2">'</span>;<br /><br /> html += <span style="color: rgb(255, 0, 255);">'var anchorData = ['</span>;<br /><br /> <span style="color: rgb(165, 42, 42);"><b>for</b></span>(<span style="color: rgb(0, 139, 139);">var</span> i = 0; i< anchorData.length;i++)<br /> <span style="color: rgb(0, 139, 139);">{</span><br /> <span style="color: rgb(165, 42, 42);"><b>if</b></span>(i > 0)<br /> <span style="color: rgb(0, 139, 139);">{</span><br /> html += <span style="color: rgb(255, 0, 255);">','</span>;<br /> <span style="color: rgb(0, 139, 139);">}</span><br /><br /> html +=<br /> <span style="color: rgb(255, 0, 255);">'{href:"'</span> + anchorData<span style="color: rgb(0, 139, 139);">[</span>i<span style="color: rgb(0, 139, 139);">]</span>.href +<br /> <span style="color: rgb(255, 0, 255);">'",content:"'</span> + anchorData<span style="color: rgb(0, 139, 139);">[</span>i<span style="color: rgb(0, 139, 139);">]</span>.content + <span style="color: rgb(255, 0, 255);">'"}'</span>;<br /><br /> <span style="color: rgb(0, 139, 139);">}</span><br /><br /> html += <span style="color: rgb(255, 0, 255);">'];'</span>;<br /><br /> html += playThis;<br /><br /> html += <span style="color: rgb(255, 0, 255);">'</SCRIPT></HEAD><BODY>'</span> +<br /> <span style="color: rgb(255, 0, 255);">'<SPAN id="playerSpan">'</span> +<br /> <span style="color: rgb(255, 0, 255);">'Player will appear here</SPAN><OL>'</span>;<br /><br /> <span style="color: rgb(165, 42, 42);"><b>for</b></span>(<span style="color: rgb(0, 139, 139);">var</span> i = 0; i< anchorData.length;i++)<br /> <span style="color: rgb(0, 139, 139);">{</span><br /> html += <span style="color: rgb(255, 0, 255);">'<LI><A href="javascript:playThis('</span> + i + <span style="color: rgb(255, 0, 255);">');">'</span> +<br /> anchorData<span style="color: rgb(0, 139, 139);">[</span>i<span style="color: rgb(0, 139, 139);">]</span>.content + <span style="color: rgb(255, 0, 255);">'</A></LI>'</span>;<br /> <span style="color: rgb(0, 139, 139);">}</span><br /><br /> html += <span style="color: rgb(255, 0, 255);">'</UL></BODY></HTML>'</span>;<br /><br /><br /> <span style="color: rgb(0, 139, 139);">var</span> popup = <span style="color: rgb(165, 42, 42);"><b>window</b></span>.open(<span style="color: rgb(255, 0, 255);">''</span>,<span style="color: rgb(255, 0, 255);">'Play list'</span>,<span style="color: rgb(255, 0, 255);">'width=200,height=500,toolbar=0'</span>);<br /><br /> popup.<span style="color: rgb(165, 42, 42);"><b>document</b></span>.open();<br /><br /> popup.<span style="color: rgb(165, 42, 42);"><b>document</b></span>.write(html);<br /><br /> popup.<span style="color: rgb(165, 42, 42);"><b>document</b></span>.close();<br /><span style="color: rgb(0, 139, 139);">}</span><br /><br /><span style="color: rgb(165, 42, 42);"><b>window</b></span>.addEventListener(<span style="color: rgb(255, 0, 255);">'load'</span>,scanForMusicLinks,<span style="color: rgb(255, 0, 255);">true</span>);<br /><br /></pre><br /><br />----------------<br /><br />To get this working for you:<br /><ul><li> install greasemonkey</li><li>save the above content into a file (say musicindiaonline.user.js) : make user the name matches .*\.user.js</li><li>in your browser(firefox, of course) type the address of that file like 'file:///home/foobar/tmp/musicindiaonline.user.js' and hit enter(or simply browse to that file using file browsing capabilities of firefox)<br /></li><li>greasemonkey pops up some controls on the top of your window - click Install.</li><li>Map the newly installed script to http://www.musicindiaonline.come/music/* and you are ready to go.</li></ul>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-24873883.post-58297218833331942572006-11-21T19:49:00.000+05:302006-11-22T08:39:44.979+05:30representation is NOT the representedeyes see object A, ears hear note A,olfactory things feel smell/taste signature A :<br /> processes in the mind form a representation of A(rep-A)<br />eyes see something like object A, ears hear something like note A,olfactory things feel something like smell/taste signature A:<br /> processes in the mind lookup rep-A<br />we conclude something like object A, something like note A,something like smell/taste signature A was actually stored in the mind<br />what is stored has nothing do with A<br />and what is stored is the same as what is used to store some other "thing"<br /><br />HmmmmmmmmUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1163684273066098782006-11-16T19:02:00.000+05:302006-11-16T23:31:46.094+05:30antiphysics in moonrakerSaw moonraker on TV last night.<br /><br />It has some interesting antiphysics at the end of the movie.<br /><br /><ul><li>In space you see the laser beams from the side. Normally one can see (especially laser) beams because of scatterring by dust particles etc. What sactters this stuff in space. Unless, of course, this beam was of electorns or some such fermions which refuse to occupy the same state as some other fermion, and due to errors of collimation scatter against each other and reach the camera (or eye as the case may be) to produce a "burn" image.</li><li>When the space-soldiers fight they seem to be able to abruptly move up and stop without any momentum cancelling jet bursts</li><li>The space station spinning to produce gravity can suddenly stop(how?) when james bond flicks that button</li><li>the space station goes up in flames! where was enough oxygen for such burning? And also, the smoke shown the usual rolling effect which is possible only due to immiscible flow of smoke (matter) against air. In space even smoke would fly in a straight line.</li></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1162093836701289782006-10-29T09:17:00.000+05:302006-11-16T23:31:45.992+05:30Euclid's postulatesಯೂಕ್ಲಿಡ್ ಯೂಕ್ಲಿಡ್, ಪಾಶ್ಚುಲೇಟ್ಸ್ ಎಷ್ಟು ಅಂದ್ರೆ<br /><br />ನಾಕು ... ಮತ್ತೊಂದು ಅಂದ್ನಂತೆUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1158506421222373042006-09-17T20:48:00.000+05:302006-11-16T23:31:45.862+05:30Daivajna Somayaji discovers antigravityDaivajna Somayaji proclaimed in his show telecast by E-TV this morning( A show on Vaastu) that fire (Agni) is not affected by gravity. It is demonstrated by the simple observation that it rises upwards.<br /><br />Hmmmm.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1157548750679823022006-09-06T18:36:00.000+05:302006-11-16T23:31:45.707+05:30Microscope : a nice toy to own!I went and bought myself a microscope. A student microscope from olympus. I did some reading about buying a good scope: I found a comprehensive set of tips at <a href="http://www.greatscopes.com/microscope.htm">http://www.greatscopes.com/microscope.htm</a>. And olympus scope had most of what is spoken about there.<br /><br />And I have seen some stuff I had never seen in 30+ years of my life so far.<br /><br />The most amazing things is the intricate structure of the mosquito wing. It has very hair like structures and along the veins and at the periphery there are small leaf like structures hanging. Amazing stuff!<br /><br />I wonder how that affects/modifies the flight of the mosquito.<br /><br />Some sites claim that they help by reducing the drag. That seems counter intuitive. More features means more turbulence and hence more drag. (For example <a href="http://www.astrographics.com/GalleryPrintsIndex/GP2109.html">http://www.astrographics.com/GalleryPrintsIndex/GP2109.html</a> claims so - thought the picture they have (except for the coloring) is very god. Colouring is misleading: you see nothing like that :-) )<br /><br />Also see the interesting wing picture at <a href="http://www.entomology.cornell.edu/MedEnt/MosquitoFS/MosquitoFS.html">http://www.entomology.cornell.edu/MedEnt/MosquitoFS/MosquitoFS.html</a>.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1156043736713516402006-08-20T08:28:00.000+05:302006-11-16T23:31:45.529+05:30Logistic map - some undestandingSome time back, <a href="http://wonder31415.blogspot.com/2006/08/logistic-maps-1toolset.html">I had put forth my view</a> that a depiction of successive iterations of the logistic map will impart a better understanding of the (continuous :-) ) emergence of chaotic behaviour rather than a usual web diagram.<br /><br />The map considered continues to be the logistic map something like:<br /><pre>x(n+1) = r * x(n) * {1 - x(n))</pre><br /><br />So I went ahead and modified my toolset a little - and captured last five iteration in a iteration run of 30 iterations. I also sampled at a much smaller interval on the parameter (x). This did throw some light on the behaviour. <br /><br />Ignore the depiction at the extreme ends of the graphs - I think its an artifact of the cspline fitting as there is an unstable fixed point at x=0.<br /><br />In stable zone (r<3):<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/2.9.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/2.9.png" border="0" alt="" /></a><br /><br />You can see that the at most of the x's there is no change in x and things settle down to the stable fixed point equal to <pre>1 - 1/r</pre>.<br /><br />Even at r=3<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.png" border="0" alt="" /></a><br /><br />you can see the oscillatory behaviour between two values (the bifurcation). Basically the successive iterator values stay at one value for some time, then jump to the other value and stay there for some more time and eventually jump back. The fixed point is no longer stable (note that the fixed point continues to be at (1 - 1/r) : only things stay there in an unstable way. And succcessive iterations keep oscillating around it. One value abve and one value below the stable point.<br /><br />At some x values the behaviour of oscillation reverses - in the sense that at any given iteration, some disjoint ranges of x values are above the fixed point and the others its below the fixed point and then a few iterations later the rols have reversed. Those that were above have switched to the values stayed at by those that were below!<br /><br />Now at successive r values upto r = 3.5 (Actually its not such a rational number : more actual irrational representation can be found at <a href="http://mathworld.wolfram.com/LogisticMap.html">the math-world page</a>)), there is a narrowing of the gap between the x ranges where the switchings of values I described above occur.<br /><br />Two samples:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.2.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.2.png" border="0" alt="" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.4.1.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.4.1.png" border="0" alt="" /></a><br /><br />Now at r=3.5 similar behavior to the above happens but at a recursive level. Ther eis a finer split yielding four values but there is a "lower frequency wave" of switching between the values above the fixed point to the values below the fixed point. This recursion is also clearly visible in the standard bifurcation diagrams for the logistic map (one is up at <a href="http://mathworld.wolfram.com/images/eps-gif/LogisticEquationBifurcation_900.gif">the math word page</a>).<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.5.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.5.png" border="0" alt="" /></a><br /><br />Now there is a critical r value at 3.5699.... and my tool skps to 3.6 but the rest of the stages are displayed below to impart of sense of the chaotic unsettling behaviour at each x with small zones where there is some settling into cycles and gradual weakening of that behaviour.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.6.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.6.png" border="0" alt="" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.7.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.7.png" border="0" alt="" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.8.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.8.png" border="0" alt="" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3594/1730/1600/3.9.png"><img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.9.png" border="0" alt="" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1155665751982553412006-08-15T23:40:00.000+05:302006-11-16T23:31:45.399+05:30logistic maps 1(toolset)I am studying a book by Prof N Kumar of RRI on deterministic chaos (University press, India <book details go here>).<br /><br />The chapter on logistic maps made me somewhat confused - so started an internet search. The booke deals with the web representation for discussing the works - bifurcations , etc.<br /><br />Found an interestinng representation (non-web) at http://mathworld.wolfram.com/LogisticMap.html. See the graphs on the top. I dont have Mathematica - so what do I do to get the maps? I spent an hour and created the follwoing perl script which in turn lanuches gnuplot to make plots simialr to the ones at the web site - slightly deeper. (Ugh - I am on windows - linux did not work that great on my laptop).<br /><br />Some images:<br /><br />At r = 3.4<br /><br /><a href="http://photos1.blogger.com/blogger/3594/1730/1600/3.4.0.png"><img style="margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3594/1730/320/3.4.0.png" border="0" alt="" /></a><br /><br /><br />Perl Script :<br /><pre><br />#!/usr/bin/perl<br /><br /><br />my $r_inc = 0.2;<br />my $x_inc = 0.001; #Change this to smaller values to get better pictures<br /><br />for(my $r = 2;$r <= 4;$r += $r_inc)<br />{<br /> my %data = ();<br /><br /> for(my $x0 = 0; $x0 <= 1; $x0 += $x_inc)<br /> {<br /> my $x = $x0;<br /><br /> for(my $i = 0; $i <= 10; $i++)<br /> {<br /> if(not defined $data{$i})<br /> {<br /> $data{$i} = [];<br /> }<br /> <br /> push @{$data{$i}},[$x0,$x];<br /><br /> $x = f($r,$x);<br /> }<br /><br /> }<br /><br /> open SCR,">script_$r.scr";<br /> print SCR "set xrange [0:1]\nset yrange [0:1]\n";<br /> print SCR "set term png\nset output \"$r.png\"\nset title \"r=$r\"\nplot ";<br /><br /> my $first = 1;<br /> foreach my $i (sort {$a <=> $b} (keys(%data)))<br /> {<br /> my $data_file = "data_".$r."_".$i.".dat";<br /> open OUT,">".$data_file;<br /> foreach my $x (@{$data{$i}})<br /> {<br /> print OUT "${$x}[0]\t${$x}[1]\n";<br /> }<br /> close(OUT);<br /><br /> if(!$first)<br /> {<br /> print SCR ", ";<br /> }<br /> print SCR "\"$data_file\" title \"$i\" smooth csplines";<br /> $first = 0;<br /> }<br /><br /> print SCR "\n";<br /> close SCR;<br /><br /> system("./plot.sh script_$r.scr");<br />}<br /><br />sub f<br />{<br /> my $r = shift;<br /> my $x = shift;<br /><br /> return ($r * $x * (1-$x));<br />}<br /><br /></pre><br /><br />Shell script plot.sh:<br /><pre><br />#!/bin/bash<br /><br />c:/Program\ Files/gnuplot/bin/wgnuplot.exe $*<br /></pre><br /><br />What do I learn from all this? Not much - nothing yet. I am tired for the day. Actul study postponed to another day.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1154617226193686802006-08-03T20:26:00.000+05:302006-11-16T23:31:45.268+05:30Maven2, compiling with jdk 1.5Struggled for time with some 1.5 stuff: actually google search with the error message from the compiler (obviously ;-) )would have fixed it .... and eventually google search did the trick.<br /><br />Found <a href="http://mail-archives.apache.org/mod_mbox/maven-users/200510.mbox/%3C107ABF7E-C287-4969-AF98-0AF73D60078B@mac.com%3E">this</a> which says<blockquote><br />Although if you want to tinker with the source and target settings <br />just do this:<br /> <plugins><br /> <plugin><br /> <groupId>org.apache.maven.plugins</groupId><br /> <artifactId>maven-compiler-plugin</artifactId><br /> <configuration><br /> <source>1.5</source><br /> <target>1.5</target><br /> </configuration><br /> </plugin><br /> </plugins><br /><br />link is at http://maven.apache.org/maven2/plugins/maven-compiler- <br />plugin/howto.html</blockquote><br /><br />So why am posting this?<br /><br />Because that misses the "build" tag outside of the plugin. Without taht the project xml (pom.xml) is invalid.<br /><br />Make it look like<br /><pre><br /> <build><br /> <plugins><br /> <plugin><br /> <groupId>org.apache.maven.plugins</groupId><br /> <artifactId>maven-compiler-plugin</artifactId><br /> <configuration><br /> <source>1.5</source><br /> <target>1.5</target><br /> </configuration><br /> </plugin><br /> </plugins><br /> </build><br /></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1154586070422580152006-08-03T11:48:00.000+05:302006-11-16T23:31:45.142+05:30Words of wisdomIn <a href="http://groups.google.co.in/group/comp.lang.lisp/browse_frm/thread/453814e621f5deb5/988b9b5f94232411#988b9b5f94232411">thread</a> , Nathan Baum <a href="http://groups.google.co.in/group/comp.lang.lisp/tree/browse_frm/thread/453814e621f5deb5/988b9b5f94232411?rnum=1&_done=%2Fgroup%2Fcomp.lang.lisp%2Fbrowse_frm%2Fthread%2F453814e621f5deb5%2F988b9b5f94232411%3F#doc_5d5e6cbe3ad07ac8">says</a> <br /><blockquote>I think this is, to some extent, because Lisp doesn't need to learn from<br />other languages. Lisp *programmers* can learn from other languages and<br />augment Lisp to fit their fancy. </blockquote>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-24873883.post-1154492772714793322006-08-02T09:43:00.000+05:302006-11-16T23:31:45.009+05:30Maven2 mysteriesI am at a phase where I can actually experiment with a non-ant build system for a java with other tools (including a lisp based code generator) project.<br /><br />One of the key requirements is to do very modular development with modules depending on other modules only in a binary way: that is the build system must build the dependency modules if necessary and place the binary deliverables of those modules into classpath or some such thing for any module.<br /><br />I thougt maven is a good idea and it still seems so ...<br /><br />Downloaded maven2 (version 2.0.4) based on advice at their <a href="http://maven.apache.org/index.html">web site</a>. Also downloaded "maven 2.0.4 tasks for ant" thinking I might need them and placed it into the lib folder of maven installation. I still think I need them, but read on ...<br /><br />Then I launched something like:<br /><pre><br />/cygdrive/d/projects >mvn archetype:create -DgroupId=org.bar -DartifactId=foo -DarchetypeArtifactId=maven-archetype-quickstart<br /></pre><br /><br />And duly received the following exception:<br /><pre><br />[INFO] ------------------------------------------------------------------------<br />[ERROR] FATAL ERROR<br />[INFO] ------------------------------------------------------------------------<br />[INFO] org.apache.maven.profiles.ProfileManager.loadSettingsProfiles(Lorg/apache<br />/maven/settings/Settings;)V<br />[INFO] ------------------------------------------------------------------------<br />[INFO] Trace<br />java.lang.NoSuchMethodError: org.apache.maven.profiles.ProfileManager.loadSettingsProfiles(Lorg/apache/maven/settings/Settings;)V<br /> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)<br /> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)<br /> at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br /> at java.lang.reflect.Method.invoke(Method.java:585)<br /> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)<br /> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)<br /> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)<br /><br /> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)<br />[INFO] ------------------------------------------------------------------------<br /></pre><br /><br />I must say I was not expecting this behaviour. I wasted like 3-4 hours doing google search, nopes no help (and hence this blog - in case <em>you</em> happen to search for it).<br /><br />After some frustration and contemplation on whether I should give up etc, I noticed the error carefully. It struck me (obviously based on past experience) that may be there is a problem with the class in that the class does not precisely look like it was supposed to. that is the loading class expects the loaded class to look different.<br /><br />Then I launched a small handy tool which I use to locate classes : the tool is a shell script that looks like this<br /><pre><br />root_dir="$1"<br />substring="$2"<br /><br />if [ -z "$substring" ]<br />then<br /> substring="$root_dir"<br /> root_dir="."<br />fi<br /><br />if [ -z "$substring" ]<br />then<br /> cat <<EOS<br />Usage $0 [root-to-search-from] search-string. <br /> root-to-search-from is optional - defaults to . <br /> The search-string can even hold parts of the package structure<br />EOS<br /> exit 1<br />fi<br /><br />substring=`echo $substring|tr '.' '/'`<br /><br />old_pwd="`pwd`"<br />cd "$root_dir"<br />for j in `find . -name '*.jar' -print`<br />do<br /> echo "--- $j -------"<br /> jar tvf $j | grep $substring | sed -e 's/^.* //'<br /> echo "++++++++++++++"<br />done<br />cd "$old_pwd"<br /><br /></pre><br /><br />The launch results looked like<br /><pre><br />.../maven-2.0.4 >find-class ProfileManager<br />--- ./core/boot/classworlds-1.1.jar -------<br />++++++++++++++<br /><snip><br />--- ./lib/maven-artifact-ant-2.0.4-dep.jar -------<br />org/apache/maven/profiles/DefaultProfileManager.class<br />org/apache/maven/profiles/ProfileManager.class<br />++++++++++++++<br />--- ./lib/maven-artifact-manager-2.0.4.jar -------<br />++++++++++++++<br /><snip><br />--- ./lib/maven-project-2.0.4.jar -------<br />org/apache/maven/profiles/DefaultProfileManager.class<br />org/apache/maven/profiles/ProfileManager.class<br />++++++++++++++<br /><snip><br />.../maven-2.0.4 ><br /></pre><br /><br />Ah! There are two implementations of ProfileManager.<br /><br />I nuked <code>maven-artifact-ant-2.0.4-dep.jar</code> from the lib directory and then the project got created peacefully.<br /><br />Now, is that jar required? May be, who knows?Unknownnoreply@blogger.com1