tag:blogger.com,1999:blog-49171643061437032142024-03-21T03:07:52.685+05:303chevronsArkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-4917164306143703214.post-89743738221834365822011-07-20T17:51:00.019+05:302011-10-02T19:51:41.758+05:30SCHEMENAUER AND THE XOR GATE<b><span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">SCHEMENAUER AND THE XOR GATE </span></span></b><br />
<div style="font-family: "Trebuchet MS",sans-serif;">
<span style="font-size: small;"><br />
</span></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<u><span style="font-size: small;">IMPLEMENTING ANN IN PYTHON</span></u></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
I was searching for Artificial Neural Networks (ANN) implementation in Python. I came across the following;</div>
<ol>
<li style="font-family: "Trebuchet MS",sans-serif;"> <a href="http://leenissen.dk/fann/wp/">FANN</a> - C library with python bindings</li>
<li style="font-family: "Trebuchet MS",sans-serif;"><a href="http://pybrain.org/">PyBrain</a></li>
<li style="font-family: "Trebuchet MS",sans-serif;"><a href="http://code.google.com/p/neurolab/">NeuroLab</a></li>
<li style="font-family: "Trebuchet MS",sans-serif;"><a href="http://neuralensemble.org/trac/PyNN/">PyNN</a> </li>
<li style="font-family: "Trebuchet MS",sans-serif;"><a href="http://arctrix.com/nas/python/bpnn.py">BPNN</a> - Not a library, solitary script by Neil Schemenauer</li>
</ol>
<u><span style="font-family: "Trebuchet MS",sans-serif; font-size: small;">THE XOR PROBLEM</span></u><br />
<div style="font-family: "Trebuchet MS",sans-serif; text-align: justify;">
<br /></div>
<div style="font-family: "Trebuchet MS",sans-serif; text-align: justify;">
The <a href="http://home.agh.edu.pl/%7Evlsi/AI/xor_t/en/main.htm">XOR problem</a> has some history in the evolution of ANN methods. The XOR function is not linearly separable and cannot be realised using only one layer of ANN. </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<u>TINKERING WITH <span style="font-size: small;">SCHEMENAUER'S CODE</span></u><br />
<br />
<div style="text-align: justify;">
Schemenauer's code has default training values for a 2 input XOR gate<span style="font-size: small;">.</span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjucf8bv4YkVg2r0wOjon_7T3Vrkl3Bd-77BYlb_JXYfkQbtzJQ2JaVo52MgeSH-QzT-cpLeRrOzzyNPoyNvT5gw1xLifVnoZUOWoOSnfZpZtYFq85fRGTlY3CP2hrSoJ0d2YI8vVM2lz0/s1600/xor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjucf8bv4YkVg2r0wOjon_7T3Vrkl3Bd-77BYlb_JXYfkQbtzJQ2JaVo52MgeSH-QzT-cpLeRrOzzyNPoyNvT5gw1xLifVnoZUOWoOSnfZpZtYFq85fRGTlY3CP2hrSoJ0d2YI8vVM2lz0/s1600/xor.png" /></a></div>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
Schemenauer recommends using of a (2,2,1) network (viz. a network with two input, two hidden, and one output nodes) and the output is very much as desired, in the limits of errors of the ANN. </div>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
XOR Output for a (2,2,1) Back Propogation Neural Network;</div>
<blockquote style="font-family: "Trebuchet MS",sans-serif;">
<div style="text-align: justify;">
<b><span style="font-size: small;">([0, 0], '==', [0.025608579041218795])</span></b></div>
<div style="text-align: justify;">
<b><span style="font-size: small;">([0, 1], '==', [0.98184578447794768])</span></b></div>
<div style="text-align: justify;">
<b><span style="font-size: small;">([1, 0], '==', [0.98170742564066216])</span></b></div>
<b><span style="font-size: small;">([1, 1], '==', [-0.021030064439813451])</span></b></blockquote>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
However, playing around with the number of hidden layers has interesting results,</div>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
<br /></div>
XOR Output for a (2,1,1) Back Propagation Neural Network;<b><span style="font-size: small;"> </span></b><br />
<blockquote>
<span style="font-size: small;"><b>([0, 0], '==', [0.0020536886211772179])</b></span><br />
<span style="font-size: small;"><b>([0, 1], '==', [0.68437587415369783])</b></span><br />
<span style="font-size: small;"><b>([1, 0], '==', [0.68413753288547252])</b></span><br />
<span style="font-size: small;"><b>([1, 1], '==', [0.6856616998850974])</b></span></blockquote>
The output of (2,1,1) clearly confirms the XOR problem !<br />
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; font-family: "Trebuchet MS",sans-serif; text-align: justify;">
Increasing the number of hidden layers indiscriminately, leads to anomalous output.</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br />As an example, XOR Output for a (2,25,1) Back Propagation Neural Network;</div>
<blockquote style="font-family: "Trebuchet MS",sans-serif;">
<span style="font-size: small;"><b>([0, 0], '==', [0.99999643777993841])</b></span><br />
<span style="font-size: small;"><b>([0, 1], '==', [0.99999911082329096])</b></span><br />
<span style="font-size: small;"><b>([1, 0], '==', [0.99999280130316026])</b></span><br />
<span style="font-size: small;"><b>([1, 1], '==', [0.99999824824488848])</b></span></blockquote>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br />
Anomalous behaviour comes into play from about 12 hidden nodes.<br />
<br />
<br />
<b>REFERENCES </b><br />
(1) <a href="http://www.ibm.com/developerworks/library/l-neural/"><span style="font-size: small;">An introduction to neural networks</span></a></div>
</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
</div>
Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com17tag:blogger.com,1999:blog-4917164306143703214.post-69140919675532498242010-07-28T11:58:00.009+05:302011-06-01T13:32:40.886+05:30FIREFOX EASTER EGGS<span style="font-weight: bold;font-family:trebuchet ms;" >FIREFOX EASTER EGGS</span><br />
<br />
<span style="font-family:trebuchet ms;">In mozilla firefox type in <a href="about:robots"><span style="font-style: italic; font-weight: bold;">about:robots</span></a> and then see the magic unfurl !</span><br />
<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikz0VFZDqKqEe-0-i7-5y1xjNTSkI0Nhp9TyZP8tZLCAfAC02uBfirj775X8LY1Q7MXGlOx2Q_4PeYljhKgn4yRhdufC1iHANHrEXjHyVvY4Sg_-gRCycLyz2MyiEhzg0ZJu5iAsBiDwg/s1600/Screenshot.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 71px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikz0VFZDqKqEe-0-i7-5y1xjNTSkI0Nhp9TyZP8tZLCAfAC02uBfirj775X8LY1Q7MXGlOx2Q_4PeYljhKgn4yRhdufC1iHANHrEXjHyVvY4Sg_-gRCycLyz2MyiEhzg0ZJu5iAsBiDwg/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5508090895763177810" border="0" /></a><br />
<span style="font-weight: bold;font-family:trebuchet ms;" >ABRACADABRA ! .......</span><br />
<br />
<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUF-1SIR-6GQGdKtkzvhyphenhyphendR1vOWmKkoP3_QtpkXbCwpPMxqBBkLLDHdMEhBaJ4byX3TxlM8eEwcH1bMObprTecFS1qc8me9j2eOkiSo7dKcelkJJJOUJqOizuVM9ZE4jZ_WpQ4xW2Eunw/s1600/Screenshot.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 202px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUF-1SIR-6GQGdKtkzvhyphenhyphendR1vOWmKkoP3_QtpkXbCwpPMxqBBkLLDHdMEhBaJ4byX3TxlM8eEwcH1bMObprTecFS1qc8me9j2eOkiSo7dKcelkJJJOUJqOizuVM9ZE4jZ_WpQ4xW2Eunw/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5498840568492610898" border="0" /></a><br />
<span style="font-family:trebuchet ms;">..... if you can handle surprises then try </span><span style="font-weight: bold; font-style: italic;font-family:trebuchet ms;" ><a href="about:mozilla">about:mozilla</a><br />
<br />
</span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7OFcwrYQCn_H_9K0_ndSJz9kadRv5bJEp7IJWxVOTnCellQkf1P2yD-0h_S59lVpbszDsaF-1FUrjSpbQub-TP_-EovmDRAbqMQvLesYflUOBGMPANrIwTw3pKKGPHoU1d3qN8Wf3LaY/s1600/Screenshot.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 88px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7OFcwrYQCn_H_9K0_ndSJz9kadRv5bJEp7IJWxVOTnCellQkf1P2yD-0h_S59lVpbszDsaF-1FUrjSpbQub-TP_-EovmDRAbqMQvLesYflUOBGMPANrIwTw3pKKGPHoU1d3qN8Wf3LaY/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5508950553456161922" border="0" /></a><br />
<span style="font-weight: bold; font-style: italic;font-family:trebuchet ms;" ><br />
</span>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com2tag:blogger.com,1999:blog-4917164306143703214.post-16727809131237317882010-06-20T15:49:00.004+05:302010-08-22T10:18:41.810+05:30MPLAYER !<div style="text-align: justify;"><span style="font-family:trebuchet ms;">I will keep it short and simple ! I had never come across a movie player which is controlled - <span style="font-weight: bold;">NOT by a GUI, but command line in the terminal window </span>! ..... and then I came across </span><a style="font-family: trebuchet ms;" href="http://www.mplayerhq.hu/design7/news.html">MPLAYER</a> <span style="font-family:trebuchet ms;">.</span><br /><br /><span style="font-family:trebuchet ms;">I guess using Unix/Ubuntu is a 'learning' experience ! </span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7xW0pk_-gL2LdBn82ru9k8mt1Zoryvb2dV-xnbum4FrpHisvPOsiKR_z8B8zeJHNcGTCfn9aOb4Q7LOFqtPozJnWLYyJNR8GlhKLsOkpopywdJXplCna99MvBORCJnOgdgJg-CwECwUM/s1600/Screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 392px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7xW0pk_-gL2LdBn82ru9k8mt1Zoryvb2dV-xnbum4FrpHisvPOsiKR_z8B8zeJHNcGTCfn9aOb4Q7LOFqtPozJnWLYyJNR8GlhKLsOkpopywdJXplCna99MvBORCJnOgdgJg-CwECwUM/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5484799205278325618" border="0" /></a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com6tag:blogger.com,1999:blog-4917164306143703214.post-84600359392763679172010-04-28T10:07:00.036+05:302011-02-21T16:57:57.962+05:30HEART TO HEART<span class="Apple-style-span" style="font-family:'trebuchet ms';"><b>HEART TO HEART</b></span>
<br />
<br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">A very interesting mathematical recreation is to conceive coherent drawings using algebraic functions. <a href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve">Bezier curves</a> are the authentic way to generate such computer graphics. Bezier came up with his genius in early 60s while designing automobile parts. Other popular means are Hermite curves and Splines. </span>
<br /></div><div style="text-align: justify;">
<br /><span style="font-family:trebuchet ms;">Though effective, these means are involved and computationally de<span style="font-family:trebuchet ms;">manding</span>. However, sometimes by providence we do have sensible shapes made out from simple functions.</span>
<br />
<br /><span style="font-weight: bold;font-family:trebuchet ms;" >PLOTTING THE HEART IN MATLAB</span>
<br />
<br /><span style="font-family:trebuchet ms;">I discuss plotting a </span><a style="font-family: trebuchet ms;" href="http://mathworld.wolfram.com/HeartCurve.html">heart</a><span style="font-family:trebuchet ms;"> using simple cardioid, polar plots and algebraic equations</span>
<br />
<br /><span style="font-weight: bold;font-family:trebuchet ms;" >(a) The simplest one </span>
<br />
<br /><span style="font-family:trebuchet ms;">The simplest 'heart curve' is the <a href="http://en.wikipedia.org/wiki/Cardioid">cardioid</a>. It is not truly a heart, however it looks somewhat similar to one.</span>
<br />
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO1prXrbR6KweC4RalOgzqSjSxffj7Dbgxm6aZWfuEvM-xCjvwVDHezcVU5YkJzoLlH2I1JFT1mOP5PggkOfHvCVhWWVucVgKmnI8s78ORpIAzuZh07iOjLMQw2gqetMg8M9lInPq3sTY/s1600/c1.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 339px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO1prXrbR6KweC4RalOgzqSjSxffj7Dbgxm6aZWfuEvM-xCjvwVDHezcVU5YkJzoLlH2I1JFT1mOP5PggkOfHvCVhWWVucVgKmnI8s78ORpIAzuZh07iOjLMQw2gqetMg8M9lInPq3sTY/s400/c1.jpg" alt="" id="BLOGGER_PHOTO_ID_5465141418850088962" border="0" /></a>
<br /><span style="font-weight: bold;font-family:trebuchet ms;" >(b) Polar plot</span>
<br />
<br /><span style="font-family:trebuchet ms;">A polar curve given by;</span>
<br />
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM9GxqpyjvycVMlZYK_JgZw7WPU9HX7keSklanwFb3EJmH50NdYo_WgQS17SX5C0J1Fj6EW732mBjomH9NV7e-ZkwtKZ16sNyh1qjXeGtc08hfVy6BWnOIT4yM6AKaAK_fZYRG6esWpWg/s1600/e.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 213px; height: 48px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM9GxqpyjvycVMlZYK_JgZw7WPU9HX7keSklanwFb3EJmH50NdYo_WgQS17SX5C0J1Fj6EW732mBjomH9NV7e-ZkwtKZ16sNyh1qjXeGtc08hfVy6BWnOIT4yM6AKaAK_fZYRG6esWpWg/s400/e.jpg" alt="" id="BLOGGER_PHOTO_ID_5465145640735836674" border="0" /></a><span style="font-family:trebuchet ms;">gives a near perfect heart ! </span>
<br />
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8G6b8CQVUwFFl5up4kh7NYnqaCFKPLmunkpsIvNeXnfvHktf2iHGm9BfUB2FlHpSE_mI7HX69llX9GNHmie0sbj7yM-15NnvPjavOCr1qfkfa9Ea5hbLOZDoujFUlsKcOyJtHUIZmvI/s1600/c2b.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 347px; height: 344px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN8G6b8CQVUwFFl5up4kh7NYnqaCFKPLmunkpsIvNeXnfvHktf2iHGm9BfUB2FlHpSE_mI7HX69llX9GNHmie0sbj7yM-15NnvPjavOCr1qfkfa9Ea5hbLOZDoujFUlsKcOyJtHUIZmvI/s400/c2b.jpg" alt="" id="BLOGGER_PHOTO_ID_5465145854466927938" border="0" /></a> <span style="font-family:trebuchet ms;">The Matlab command line is; </span>
<br />
<br /><span style="font-family:georgia;"></span><blockquote><span style="font-family:georgia;"></span><span style="font-family:georgia;">>> ezpolar('((sin(t)*sqrt(abs(cos(t))))*(sin(t) + (7/5))^(-1)) - 2*sin(t) + 2')</span></blockquote>
<br /><span style="font-weight: bold;font-family:trebuchet ms;" >(c) Algebraic Equation</span>
<br />
<br /><span style="font-family:trebuchet ms;">A heart can be made from the implicit algebraic function,</span>
<br />
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHnWgyVGCNpam-QE59oaU-tUzEHJdcbwQW3Yd-ILlmntHbjtPMohoRSoGihuD84xqIe5ZK9wX-invgF4Tez5CvLx00WoVuZwC7ZpO5PdP9gkY7e6unX2xbelgl3sGqOaF3DzOmhuDagOM/s1600/Screenshot-5.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 160px; height: 31px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHnWgyVGCNpam-QE59oaU-tUzEHJdcbwQW3Yd-ILlmntHbjtPMohoRSoGihuD84xqIe5ZK9wX-invgF4Tez5CvLx00WoVuZwC7ZpO5PdP9gkY7e6unX2xbelgl3sGqOaF3DzOmhuDagOM/s400/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5465147746397251906" border="0" /></a>
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj703MioMP_udNIqYl1KgpNAZbBRerPbPRWUfjtNCTqHlrILXPbdpQilg11H2IGte4gOvHP7GltH5-ciNJsYABI5wYz3-ONilMBsvrCikKg0MrU9XZHsbBSKp3pDS6fJ3MbHvXTQISBvDU/s1600/Screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 329px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj703MioMP_udNIqYl1KgpNAZbBRerPbPRWUfjtNCTqHlrILXPbdpQilg11H2IGte4gOvHP7GltH5-ciNJsYABI5wYz3-ONilMBsvrCikKg0MrU9XZHsbBSKp3pDS6fJ3MbHvXTQISBvDU/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5469589346852208162" border="0" /></a>
<br /><span style="font-family:trebuchet ms;">However tinkering by adding a factor of (0.35) and (1.3) to the terms makes the heart more aesthetic.</span>
<br />
<br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaLx7iBC_rKjno5EQ2PNpDd37zyvJTSkj_BZOcDwUe2ToQsYslxEq4MLKf9RrCk_ISrc6yLVdMj-PDd6QTEdEFH3QBc4cDM_yX9UHqs_XptHvCxiYorgeAu7GhpYt1Cap4oHsU8dreDzM/s1600/sss.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 359px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaLx7iBC_rKjno5EQ2PNpDd37zyvJTSkj_BZOcDwUe2ToQsYslxEq4MLKf9RrCk_ISrc6yLVdMj-PDd6QTEdEFH3QBc4cDM_yX9UHqs_XptHvCxiYorgeAu7GhpYt1Cap4oHsU8dreDzM/s400/sss.png" alt="" id="BLOGGER_PHOTO_ID_5465149128730370482" border="0" /></a>
<br /><span style="font-family:trebuchet ms;">The Matlab command is,</span>
<br />
<br /><span style="font-family:georgia;"></span><blockquote style="font-family: georgia;">>> ezplot('(0.35)*((x^2 + y^2 - 1)^3) - (1.3)*(x^2)*(y^3)');</blockquote>
<br /><span style="font-family:trebuchet ms;"><span style="font-size:100%;">It is worth noting that for using ezplot t, x and y doesn't have to be defined.</span>
<br />
<br /></span></div><div style="text-align: justify;"><span class="Apple-style-span">
<br /></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span"><meta equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-weight: bold;">(d) Another Algebraic Equation</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span"><span class="Apple-style-span" style="font-weight: bold;">
<br /></span></span></div><div style="text-align: justify;"><span class="Apple-style-span" style="font-size:100%;"><span style="font-family:trebuchet ms;">This one is due to </span><a style="font-family: trebuchet ms;" href="http://www.matt-mcdonnell.com/">Matt</a><span style="font-family:trebuchet ms;"> ....</span>
<br />
<br /></span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzp8wSj4GYVrpxNHXoVK-E9QLSFDQ0P69uWHjzxVJNezRr47D_r68DQ3xUuVoKiq_y7OMz-wMzpaTVsWTMtw4sf_F-zZ8Zur2XfShG2Ww8TVP3Aikf2Z73iYVDbIvy6qMH-JK-koCXys/s1600/Screenshot-1.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 178px; height: 55px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOzp8wSj4GYVrpxNHXoVK-E9QLSFDQ0P69uWHjzxVJNezRr47D_r68DQ3xUuVoKiq_y7OMz-wMzpaTVsWTMtw4sf_F-zZ8Zur2XfShG2Ww8TVP3Aikf2Z73iYVDbIvy6qMH-JK-koCXys/s400/Screenshot-1.png" alt="" id="BLOGGER_PHOTO_ID_5574712085385954210" border="0" /></a><span class="Apple-style-span">
<br /></span><a href="http://www.wolframalpha.com/input/?i=x%5E2%2B%28y-%28x%5E2%29%5E%281/3%29%29%5E2+%3D+1"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 326px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh__x2Kn8FFMbFQGpsrfNMWvibbhEtrGcdEdGmSYbWklIvMmQM3T92cBtH9AE6Z3uu2OMtQKYqerfkvPWT8k9Ht3WbKUyomdraU46_CGJyqhDmmGDDzZMuPq_FVyf3RcRrK61xtOd0XTlA/s400/v1.png" alt="" id="BLOGGER_PHOTO_ID_5574710075021767746" border="0" /></a>
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYC5i_Xa5SrkrTteUqHe7p_hBcXYtnmsTsw3XPIJOsAFyUQDuVL3O6y1zg1-HNeC7kl-MqcJMtxCGqPD95AszsFuOeld2g0OiG2759xmB8zfiC0u6yZQgUQaBTuRrhEQiXK3-9vIqIQp4/s1600/v2.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 327px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYC5i_Xa5SrkrTteUqHe7p_hBcXYtnmsTsw3XPIJOsAFyUQDuVL3O6y1zg1-HNeC7kl-MqcJMtxCGqPD95AszsFuOeld2g0OiG2759xmB8zfiC0u6yZQgUQaBTuRrhEQiXK3-9vIqIQp4/s400/v2.png" alt="" id="BLOGGER_PHOTO_ID_5574710079418935858" border="0" /></a></div>
<br /><div style="text-align: justify;">.
<br />.
<br />.
<br /><span style="font-family:trebuchet ms;">...then again forget MATLAB, we do have <span style="font-weight: bold;"><3</span> to our rescue ! </span>
<br />
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF3Dt1HctBK-6KRfl_MpimufdPCh-a4padQbCiX_cQWYRASrq-2ganXXVassdoWrBQgDHBM6nKLDYp2t6NfvZLzDBP3DZDw9Cj8QosHX4Ntfz8dl5lr0VT8wPrdZtzmcSdLN2wjmzZVYI/s1600/Screenshot.png"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 279px; height: 148px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF3Dt1HctBK-6KRfl_MpimufdPCh-a4padQbCiX_cQWYRASrq-2ganXXVassdoWrBQgDHBM6nKLDYp2t6NfvZLzDBP3DZDw9Cj8QosHX4Ntfz8dl5lr0VT8wPrdZtzmcSdLN2wjmzZVYI/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5576102942862999090" border="0" /></a>
<br />
<br /><span style="font-weight: bold;font-family:trebuchet ms;" >REFERENCES</span>
<br /><span style="font-family:trebuchet ms;">(1) </span><a style="font-family: trebuchet ms;" href="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/ezplot.html">ezplot</a>
<br /><span style="font-family:trebuchet ms;">(2) </span><a style="font-family: trebuchet ms;" href="http://stackoverflow.com/questions/2720180/matlab-heart-curve">stackoverflow question 2720180</a>
<br /><span style="font-family:trebuchet ms;">(3) <a href="http://stackoverflow.com/questions/323584/is-there-an-easy-way-to-model-a-heart-shape-in-3d">stackoverflow question 323584</a></span>
<br /><span style="font-family:trebuchet ms;">(4) </span><a style="font-family: trebuchet ms;" href="http://www.mathematische-basteleien.de/heart.htm">Heart Curve page</a>
<br /><span style="font-family:trebuchet ms;">(5) <a href="http://mathworld.wolfram.com/HeartCurve.html">Wolfram page</a></span>
<br /><span style="font-family:trebuchet ms;">(6) </span><a style="font-family: trebuchet ms;" href="http://www.designyourownweb.com/gimp/bezier-gimp.htm">Bezier Heart in Gimp </a>
<br /></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com3tag:blogger.com,1999:blog-4917164306143703214.post-33651375722333164942010-04-19T15:22:00.015+05:302010-08-14T15:02:49.121+05:30A VERY SIMPLE CHATBOX IN PYTHON<span style="font-family:trebuchet ms;"><span style="font-weight: bold;">A VERY SIMPLE CHATBOX IN PYTHON</span><br /><br />A naive chatbot program. No parsing, no cleverness, just a training file and output.</span><br /><div style="text-align: justify;"><br /><span style="font-family:trebuchet ms;">It first trains itself on a text and then later uses the data from that training to generate responses to the interlocutor's input. The training process creates a dictionary where each key is a word and the value is a list of all the words that follow that word sequentially anywhere in the training text. If a word features more than once in this list then that reflects and it is more likely to be chosen by the bot, no need for probabilistic stuff just do it with a list.</span><br /><br /><span style="font-family:trebuchet ms;">The bot chooses a random word from your input and generates a response by choosing another random word that has been seen to be a successor to its held word. It then repeats the process by finding a successor to that word in turn and carrying on iteratively until it thinks it's said enough. It reaches that conclusion by stopping at a word that was prior to a punctuation mark in the training text. It then returns to input mode again to let you respond, and so on.</span><br /><br /><span style="font-family:trebuchet ms;">It isn't very realistic but I hereby challenge anyone to do better in 71 lines of code !! This is a great challenge for any budding Pythonists, and I just wish I could open the challenge to a wider audience than the small number of visitors I get to this blog. To code a bot that is always guaranteed to be grammatical must surely be closer to several hundred lines, I simplified hugely by just trying to think of the simplest rule to give the computer a mere stab at having something to say.</span><br /><br /><span style="font-family:trebuchet ms;">Its responses are rather impressionistic to say the least ! Also you have to put what you say in single quotes.</span><br /><br /><span style="font-family:trebuchet ms;">I used War and Peace for my "corpus" which took a couple of hours for the training run, use a shorter file if you are impatient...</span><br /><br /><span style="font-family:trebuchet ms;">here is the trainer</span><br /></div><br /><code>#lukebot-trainer.py<br />import pickle<br />b=open('war&peace.txt')<br />text=[]<br />for line in b:<br />for word in line.split():<br /> text.append (word)<br />b.close()<br />textset=list(set(text))<br />follow={}<br />for l in range(len(textset)):<br />working=[]<br />check=textset[l]<br />for w in range(len(text)-1):<br /> if check==text[w] and text[w][-1] not in '(),.?!':<br /> working.append(str(text[w+1]))<br />follow[check]=working<br />a=open('lexicon-luke','wb')<br />pickle.dump(follow,a,2)<br />a.close()</code><br /><br /><span style="font-family:trebuchet ms;">here is the bot</span><br /><br /><code>#lukebot.py<br />import pickle,random<br />a=open('lexicon-dict','rb')<br />successorlist=pickle.load(a)<br />a.close()<br />def nextword(a):<br />if a in successorlist:<br /> return random.choice(successorlist[a])<br />else:<br /> return 'the'<br />speech=''<br />while speech!='quit':<br />speech=input('>')<br />s=random.choice(speech.split())<br />response=''<br />while True:<br /> neword=nextword(s)<br /> response+=' '+neword<br /> s=neword<br /> if neword[-1] in ',?!.':<br /> break<br />print response</code><br /><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">You tend to get an uncanny feeling when it says something that seems partially to make sense. I think this is a universal syndrome with chatbots and shows us a lot about our expectations and hopes for machine intelligence. The tendency to attribute some kind of surreal cosmic wisdom or irony to the responses is common.</span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >TALKING TO TOLSTOY ! ...... ;)</span><br /><br /><span style="font-family:trebuchet ms;">Sample output:( is this like talking to Tolstoy? Not really but still...)</span><br /></div><code><br />>>><br />>'hello'<br />the human affairs he thought.<br />>'oh those affairs were great'<br />God,<br />>'what -surprised?'<br />do you value but she is what had the new country,<br />>'i do value but i do not blame the war on her'<br />so alarming them with those around with particular chair by all those who caressed me.<br />>'i never get anyone caressing me!'<br />allowed to talk about in a really so.<br />>'oh do not be prudish I am allowed to mention it'<br />should she suddenly heard of a duty for reason was handed him very hot.<br />>'you like these women a lot to talk about them so much'<br />advantage if your father?<br />>'my father approves of my romantic side'<br />love my son's having obeyed in the causes historic events that circle they didn't you know a force producing two Emperors with a certain prince.<br />>'oh now it is princes is it'<br />God,<br />>'do you believe in Him?'<br />the insistence of incongruities giving you married at his squadron--that is,<br />>' i don't understand you sir'<br />>'i do not understand you sir'<br />the bridge which,<br />>'i crossed'<br />himself,<br />>'ok ok... well 71 lines still is not bad'<br />the work at Smolensk?<br />>'yes'<br />or that of War.<br />>'no, war'<br />was gradually that millions of married in which is Dolokhov?<br /><br /></code><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-oEIcZxBW4957LlrMH44UY6JWv2o91S4IlaG0awMnPyly3vaFXajUIaS7jSQEMcwPhCO9WtnzhMS8t2d_T4KWpQNihIKPEwTN08Nkt4gM4kgq-hx3kr4tmpvwKRtE8uIKULmaz1EraGk/s1600/LeoTolstoy7.jpg"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 254px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-oEIcZxBW4957LlrMH44UY6JWv2o91S4IlaG0awMnPyly3vaFXajUIaS7jSQEMcwPhCO9WtnzhMS8t2d_T4KWpQNihIKPEwTN08Nkt4gM4kgq-hx3kr4tmpvwKRtE8uIKULmaz1EraGk/s400/LeoTolstoy7.jpg" alt="" id="BLOGGER_PHOTO_ID_5504830347387825570" border="0" /></a><br /><span style="font-family: trebuchet ms; font-weight: bold;">REFERENCES</span><br /><br /><span style="font-family: trebuchet ms;">(1) <a href="http://pythonism.wordpress.com/2010/04/18/a-simple-chatbot-in-python/">Pythomism - Luke's website</a></span>Unknownnoreply@blogger.com40tag:blogger.com,1999:blog-4917164306143703214.post-83487577307604801892010-04-11T14:46:00.008+05:302010-08-24T17:53:30.071+05:30RANDOM NUMBER GENERATOR !<span style="font-weight: bold;font-family:trebuchet ms;" >RANDOM @DILBERT </span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/00000/2000/300/2318/2318.strip.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 416px; height: 123px;" src="http://www.dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/00000/2000/300/2318/2318.strip.gif" alt="" border="0" /></a><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >RANDOM @NEUMANN</span><br /><br /><div style="text-align: justify; font-family: trebuchet ms;"><div style="text-align: justify; font-style: italic;">"Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. For, as has been pointed out several times, there is no such thing as a random number — there are only methods to produce random numbers, and a strict arithmetic procedure of course is not such a method."<br /></div><div style="text-align: right;"> -- John von Neumann<br /></div><br /></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-28473154268374742452010-04-10T11:10:00.001+05:302010-04-25T23:38:12.936+05:30SINC LOOKS LIKE DIRAC DELTA<span style="font-weight: bold;font-family:trebuchet ms;" >DABBLING IN MATLAB</span><br /><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">After installing <a href="http://www.mathworks.com/products/matlab/">Matlab R2009b (7.9.0)</a> on Ubuntu Karmic, I was trying out many thing ! ...... just for fun ! </span><span style="font-family:trebuchet ms;">While trying out sinc function .... at a certain point it resembled dirac delta !<br />.<br />.<br />.<br /></span><span style="font-family:trebuchet ms;">One very long spike unto infinity ! </span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9iQHXt5yMdfUa-B2EKHOfg1x2MUKA0NH15BEBvpT-kAAX_DZREf1C0c40x0TpL3BxuLZTYqOWrGrf_LEkVFHSBxqFXfQy7Mh3sI1e89lcU5iFvkm0dvkFIuTTP3OGNaC1JBQXCokR8as/s1600/sinc.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 304px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9iQHXt5yMdfUa-B2EKHOfg1x2MUKA0NH15BEBvpT-kAAX_DZREf1C0c40x0TpL3BxuLZTYqOWrGrf_LEkVFHSBxqFXfQy7Mh3sI1e89lcU5iFvkm0dvkFIuTTP3OGNaC1JBQXCokR8as/s400/sinc.png" alt="" id="BLOGGER_PHOTO_ID_5458378926554749010" border="0" /></a><br /><span style="font-family: trebuchet ms;font-family:trebuchet ms;" >REFERENCES</span><br /><span style="font-family: trebuchet ms;font-family:trebuchet ms;" >(1) </span><a style="font-family: trebuchet ms;" href="http://mathworld.wolfram.com/DeltaFunction.html">Delta Function</a><br /><span style="font-family: trebuchet ms;">(2) </span><a style="font-family: trebuchet ms;" href="http://en.wikipedia.org/wiki/Sinc_function#Relationship_to_the_Dirac_delta_distribution">Sinc - Delta Relationship </a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com3tag:blogger.com,1999:blog-4917164306143703214.post-52755257816028299382010-03-25T22:03:00.008+05:302010-04-11T14:58:39.183+05:30THE ASCII TRAIN !<span style="font-weight: bold;font-family:trebuchet ms;" >FOOLING AROUND @ UBUNTU 9.10</span><br /><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">Every coder sometimes or the other, looks for a lighter moment and Ubuntu has plenty of those. One such instance .....<br /><br /></span><span style="font-family:trebuchet ms;">Install 'sl' using <span style="font-weight: bold; font-style: italic;">sudo apt-get install sl</span>. Then, <span style="font-weight: bold; font-style: italic;">type sl in the terminal</span> ! and watch the ASCII Train !</span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSoyZR31J4263pAQbI__53sVKXnYnfXOjRi9xq7zbqDywv_cvdUTbfwoPis_eDom3klf24Ht3_HQuhSblPDqyw-BeVrcvylSOtApJVASszBowaU3p-Fa_pat-p0aVFl8AmPF97syLofKo/s1600/der2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 176px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSoyZR31J4263pAQbI__53sVKXnYnfXOjRi9xq7zbqDywv_cvdUTbfwoPis_eDom3klf24Ht3_HQuhSblPDqyw-BeVrcvylSOtApJVASszBowaU3p-Fa_pat-p0aVFl8AmPF97syLofKo/s400/der2.png" alt="" id="BLOGGER_PHOTO_ID_5452611827540991954" border="0" /></a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-82000149339473630802010-03-13T08:33:00.011+05:302010-08-24T17:57:00.411+05:30MOO .....<span style="font-weight: bold;font-family:trebuchet ms;" >ON THE LIGHTER SIDE !</span> <span style="font-family:trebuchet ms;"><br /><br /><span style="font-weight: bold;">#1. MOO</span><br /><br /></span><div style="text-align: justify;"><span style="font-family:trebuchet ms;">In Ubuntu 9.10, while trying the command <span style="font-weight: bold;">sudo apt-get moo</span> ! ...... there is sure some surprise in store.</span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilcuLoereabyj6sgBxhjkpegzSWTwGrlFenPtVQ51yY2R49v4LriAxCfXEtjUYyx0xVAEAFJJufNQZYVcI-F-vWjYrJXjfCC_l7D5S_I87_C8zxuyHsMif8d0HSmerV5WLAR8kGTClc3U/s1600-h/moo.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 262px; height: 146px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilcuLoereabyj6sgBxhjkpegzSWTwGrlFenPtVQ51yY2R49v4LriAxCfXEtjUYyx0xVAEAFJJufNQZYVcI-F-vWjYrJXjfCC_l7D5S_I87_C8zxuyHsMif8d0HSmerV5WLAR8kGTClc3U/s400/moo.png" alt="" id="BLOGGER_PHOTO_ID_5447949530053294338" border="0" /></a> <span style="font-weight: bold;font-family:trebuchet ms;" ><br />#.2 COWS ..... FROM OUTER SPACE ! </span> <span style="font-family:trebuchet ms;"><br /><br /></span><div style="text-align: justify;"><span style="font-family:trebuchet ms;">Whoever put these <a href="http://www.eeggs.com/tree/1134.html">easter eggs</a> into Ubuntu (9.10) was sure some cow sympathiser !</span><br /><br /></div><span style="font-family: trebuchet ms;">Try this</span> <span style="font-family:trebuchet ms;">.....</span><span style="font-weight: bold;font-family:trebuchet ms;" > Alt + F2 + 'gegls from outer space' + enter ! </span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYxYG9sazFXtrHpORY0CtvjEKVwjnj5REWBKtPWeUIANig8ChQIcYq0GDDA5kVzKkWwe8o4V5kHXrqvRwG8iAh2-EhPp-uFNVm9MNeyDEFLqF6GPhKRCIA5Uc7BglcZEO0VQIQGYttcN0/s1600-h/Screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 193px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYxYG9sazFXtrHpORY0CtvjEKVwjnj5REWBKtPWeUIANig8ChQIcYq0GDDA5kVzKkWwe8o4V5kHXrqvRwG8iAh2-EhPp-uFNVm9MNeyDEFLqF6GPhKRCIA5Uc7BglcZEO0VQIQGYttcN0/s400/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5451786293207738802" border="0" /></a><span style="font-size:180%;"><br /></span><span style="font-weight: bold;font-family:trebuchet ms;" ><span style="font-size:180%;">Voila !</span> ..... the 'gegls' ! </span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim_17WBp_fSJTYynAN35Q0Dn9rieT_dfO4G6QDIjrCKOcfk0j5gs4XYnFiGxXtfQt0c44muoDS_-pLqTSHWAYeclXHnpGe72xr7IwevOf3jftEJm_Q7cUNMRLdjTr59RvpmDoAdVCD-xo/s1600-h/Screenshot-2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 323px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim_17WBp_fSJTYynAN35Q0Dn9rieT_dfO4G6QDIjrCKOcfk0j5gs4XYnFiGxXtfQt0c44muoDS_-pLqTSHWAYeclXHnpGe72xr7IwevOf3jftEJm_Q7cUNMRLdjTr59RvpmDoAdVCD-xo/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5451786648142702418" border="0" /></a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com1tag:blogger.com,1999:blog-4917164306143703214.post-69781923544046679952010-03-04T14:41:00.010+05:302010-03-05T10:15:48.980+05:30JYTHON : FIRST CONTACT !<span style="font-weight: bold;font-family:trebuchet ms;" >JYTHON, MARRIAGE OF JAVA AND PYTHON</span><br /><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">Trying my first shot at <a href="http://www.jython.org/">Jython</a>, using <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">java</a> <a href="http://en.wikipedia.org/wiki/Swing_%28Java%29">swing</a> in python-like interactive interface ! </span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1zFPkBvKvE8S-6iG0SCDwf-AEZznNWBY7nsSVZkDLgH39TvATtgVGEkkyL0d-FXTzSIGbv-IWyhm2V7w2I9A0NI9OWyDe94pecTIRqpXB1Zgo6tmSJkoa31CEHaGptbPlzWQI13JnrM8/s1600-h/jython.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 269px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1zFPkBvKvE8S-6iG0SCDwf-AEZznNWBY7nsSVZkDLgH39TvATtgVGEkkyL0d-FXTzSIGbv-IWyhm2V7w2I9A0NI9OWyDe94pecTIRqpXB1Zgo6tmSJkoa31CEHaGptbPlzWQI13JnrM8/s400/jython.png" alt="" id="BLOGGER_PHOTO_ID_5444705018881235730" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.jython.org/"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 100px; height: 65px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhv4FZX1l_3X41jUy-IHwBTMCu4ufpaUlo6Ya38s_yHpF4ceYjSoQPNHpFIGRMRH9NDMIq53-HTohLfvXfUkbKDMvwNHNlUHDRlKhraZb4JZpewRCKmLNi2mMzhZinZSr89LnIs3R92j4E/s400/jythonlogo.png" alt="" id="BLOGGER_PHOTO_ID_5444705307727328722" border="0" /></a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-61613148184508822892010-03-04T13:47:00.006+05:302010-03-04T15:44:09.618+05:30CHECKING FOR SQUARES !<span style="font-weight: bold;font-family:trebuchet ms;" >AN ELEGANT CODE IN PYTHON ! </span> <span style="font-family:trebuchet ms;"><br /><br />This program confirms if a number is square or not ! </span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4E_GQ32xudEMCN30Dn7UEkkwy0tRa2lNO4enOtjCfGfsMvz5LgnARBOo3_1xsMKGoD5siwfD-EAi0XChMEw1q1K4UewdOPiA9hf6e07oRSR0jxTrULtSeuR_j0C5E9DcPg5ZW9bPlp7c/s1600-h/q1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 245px; height: 150px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4E_GQ32xudEMCN30Dn7UEkkwy0tRa2lNO4enOtjCfGfsMvz5LgnARBOo3_1xsMKGoD5siwfD-EAi0XChMEw1q1K4UewdOPiA9hf6e07oRSR0jxTrULtSeuR_j0C5E9DcPg5ZW9bPlp7c/s400/q1.png" alt="" id="BLOGGER_PHOTO_ID_5444691084897454658" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilAk8roU7-X-LHIPSZPGYid2Lj0OslCCp7-Ch7xaPidgNO7sZbk2HGgaSQN1s7T1kL82ri8DAFC5t20pOtrOHOZZyeOOqYWqk0yvUEX5C1JgOn31ZsR27dv4-_DLNk_saY0y8j1n7qj08/s1600-h/q2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 258px; height: 213px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilAk8roU7-X-LHIPSZPGYid2Lj0OslCCp7-Ch7xaPidgNO7sZbk2HGgaSQN1s7T1kL82ri8DAFC5t20pOtrOHOZZyeOOqYWqk0yvUEX5C1JgOn31ZsR27dv4-_DLNk_saY0y8j1n7qj08/s400/q2.png" alt="" id="BLOGGER_PHOTO_ID_5444690696063589826" border="0" /></a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-1317383085617343212010-02-27T11:04:00.030+05:302010-03-04T15:47:27.184+05:30SEMAPHORES IN ADA<span style="font-weight: bold;font-family:trebuchet ms;" >THE PROBLEM OF SYNCHRONISATION<br /><br /></span> <div style="text-align: justify;font-family:trebuchet ms;"><span style="font-family:trebuchet ms;">Often there are occasions when events must happen in a certain order ! specifically ....</span><br /><br /><span style="font-family:trebuchet ms;">(1) Serialisation: Event A must happen before Event B.</span><br /><span style="font-family:trebuchet ms;">(2) Mutual exclusion: Events A and B must not happen at the same time.</span><br /><br /><span style="font-family:trebuchet ms;">In concurrent programming every process is fighting for </span><span style="font-weight: bold;font-family:trebuchet ms;" >time and resource</span><span style="font-family:trebuchet ms;"> thus in perspective of the above, order must be restored to this apparent chaos. One rather interesting way is to use semaphores.</span><br /><br /><span style="font-family:trebuchet ms;">Semaphores were invented by the Dutch computer scientist <a href="http://en.wikipedia.org/wiki/Edsger_W._Dijkstra">Edsger Dijkstra</a> (EWD 74).</span><br /><br /><span style="font-family:trebuchet ms;">A definition will be, a non-negative integer-valued variable that can only be acted upon by two procedures: sem_wait and sem_post</span><br /><br /><span style="font-family:trebuchet ms;">These operations are defined (for a semaphore s) as:</span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >sem_wait(P)</span><br /><span style="font-family:trebuchet ms;">if s>0 then set s:=s-1 and allow task to proceed else suspend task</span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >sem_post(V)</span><br /><span style="font-family:trebuchet ms;">set s:=s+1</span><br /><br /><span style="font-family:trebuchet ms;">For a synchronisation where each process waits for the other, </span><span style="font-weight: bold;font-family:trebuchet ms;" >synchronous synchronisation</span><span style="font-family:trebuchet ms;"> will be done using 2 semaphores, as;</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBEB-w9eWzwV-_LNgFyNsa2N68b9qvgCcQJ92wmUMCRCDlEl9hFh-Un_nxGTzIT5OUPkQrpcA0p88Lx6A2z3H3Ak3dFIXjEB6mEF4PUrbINhGrqaI7QSr9A44dopwkDlrYLx_Dt9CqWnw/s1600-h/Screenshot-14.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 273px; height: 400px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBEB-w9eWzwV-_LNgFyNsa2N68b9qvgCcQJ92wmUMCRCDlEl9hFh-Un_nxGTzIT5OUPkQrpcA0p88Lx6A2z3H3Ak3dFIXjEB6mEF4PUrbINhGrqaI7QSr9A44dopwkDlrYLx_Dt9CqWnw/s400/Screenshot-14.png" alt="" id="BLOGGER_PHOTO_ID_5442883528756217874" border="0" /></a><br /><span style="font-weight: bold;font-family:trebuchet ms;" >TRYING IN ADA 2005</span><br /><br /><span style="font-family:trebuchet ms;">Trying the scenario in Ada 2005, where Task A and Task B are defined as</span><br /><br /><span style="font-family:trebuchet ms;">Task A : printing 'A' 5 times</span><br /><span style="font-family:trebuchet ms;">Task B : printing 'B' 5 times</span><br /><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">yields the following results, </span><span style="font-family:trebuchet ms;">the output strictly interleafs on all ocassions,</span><br /></div><br /><a style="font-family: trebuchet ms;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMxH48bhtF0xrNGYVd_vdD5jx3nYI1I-3fGvcmGFwbAJLXrbiW_DkNq7tYBziC74yHQq6EKjuxG_EK29yPVcYBd5octnSpV7xB18DXgdb_aWvlCUIQKEV6bCAS7MiPjTMM4zhsJh44sAg/s1600-h/Screenshot-16.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 85px; height: 14px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMxH48bhtF0xrNGYVd_vdD5jx3nYI1I-3fGvcmGFwbAJLXrbiW_DkNq7tYBziC74yHQq6EKjuxG_EK29yPVcYBd5octnSpV7xB18DXgdb_aWvlCUIQKEV6bCAS7MiPjTMM4zhsJh44sAg/s400/Screenshot-16.png" alt="" id="BLOGGER_PHOTO_ID_5442893784335384402" border="0" /></a><br /><span style="font-family:trebuchet ms;">however the slicing is of 2 rounds of each task at a time.( i.e. 'AA' , 'BB' ....). This slicing can <span style="font-family:trebuchet ms;">be tailored with scheduling policies.</span></span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >REFERENCES</span><br /><span style="font-family:trebuchet ms;">(1) </span><a style="font-family: trebuchet ms;" href="http://www.amazon.com/Concurrent-Real-Time-Programming-Alan-Burns/dp/0521866979/">Concurrent and Real Time Programming in Ada</a><br /><span style="font-family:trebuchet ms;">(2) </span><a style="font-family: trebuchet ms;" href="http://www.iste.uni-stuttgart.de/ps/Lehre/SS2008/V_RTP/">Semaphore construction</a><br /><span style="font-family:trebuchet ms;">(3) </span><a style="font-family: trebuchet ms;" href="http://code.google.com/p/ada-simple/">http://code.google.com/p/ada-simple/</a><br /></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-33065545054950524382010-02-27T08:44:00.001+05:302010-03-04T15:44:56.375+05:30HELLO WORLD IN ADA 2005<span style="font-family:trebuchet ms;"><span style="font-weight: bold;">HELLO ADA ! </span><br /><br /></span><div style="text-align: justify;"><span style="font-family:trebuchet ms;">I should not be writing this article ! ...... however, trying out very simple programs in Ada 2005 made me realise how I have lost touch of the syntax etc !</span><br /><br /><span style="font-family:trebuchet ms;"><a href="http://en.wikipedia.org/wiki/Ada_%28programming_language%29">Ada</a> is a high level language which is a favourite for safety critical and real time systems. Trying out the <span style="font-weight: bold;">'Hello, World'</span> in Ada,</span><br /></div><span style="font-family:trebuchet ms;"><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrh7pfEZ6gu7KkgMC6JlMSl_eQWWvBBAO1W4ZVsMRxwz7P2CzIVjNxuL_kaW9G-jxycM1GHP8nQWZGDCaqesliUDI8sAhnpzpIbACXLOdKtK3UkTsMigize49f8ApkCt1nzdIL9YEyesk/s1600-h/1.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 190px; height: 152px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrh7pfEZ6gu7KkgMC6JlMSl_eQWWvBBAO1W4ZVsMRxwz7P2CzIVjNxuL_kaW9G-jxycM1GHP8nQWZGDCaqesliUDI8sAhnpzpIbACXLOdKtK3UkTsMigize49f8ApkCt1nzdIL9YEyesk/s400/1.png" alt="" id="BLOGGER_PHOTO_ID_5442764622100806546" border="0" /></a><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">The syntax has a 'pascal like' sing to it, Ada program files have extensions adb or ads. The compiler used for Ada is <a href="http://en.wikipedia.org/wiki/GNAT">GNAT</a> (which is a part of gcc)</span>.<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoG5YRcr9UMzpCZsSK0Q7xW16O-y3cdVAXWcaxMk7dq1RHAvzlFtUdObBBXuVQ36MGIhemvqlJYothhgWcUxnag5xdGMgrQvc8dw5JaHOn7Man-WyLDtSkymYqccGdhX066E2sg4Yl9iE/s1600-h/2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 65px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoG5YRcr9UMzpCZsSK0Q7xW16O-y3cdVAXWcaxMk7dq1RHAvzlFtUdObBBXuVQ36MGIhemvqlJYothhgWcUxnag5xdGMgrQvc8dw5JaHOn7Man-WyLDtSkymYqccGdhX066E2sg4Yl9iE/s400/2.png" alt="" id="BLOGGER_PHOTO_ID_5442767670151378258" border="0" /></a><span style="font-family:trebuchet ms;">Compilation creates 3 more files.</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz-8JIKd92_OUz2KQOuE1tvQaMdjOsELXYsKbCDjIJYg4m9cxpYkwlFycTHiMLDKJkyzGjNKkAOVwGX-bcjymE8yCU5zEdOo2bDwizURuwVpNm2Dxv7AKfTPXaFU2MPKPNu1LSIXoWt-c/s1600-h/3.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 93px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz-8JIKd92_OUz2KQOuE1tvQaMdjOsELXYsKbCDjIJYg4m9cxpYkwlFycTHiMLDKJkyzGjNKkAOVwGX-bcjymE8yCU5zEdOo2bDwizURuwVpNm2Dxv7AKfTPXaFU2MPKPNu1LSIXoWt-c/s400/3.png" alt="" id="BLOGGER_PHOTO_ID_5442768241124303586" border="0" /></a><span style="font-family:trebuchet ms;">Running the program,</span><br /><span style="font-family:trebuchet ms;"><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHGUMRA9ZlD8eRVUoJ3GTJ_-QQtwFdgQ3jGQMJMbF1Hb1Z8oZtcySf1ksa-sAsrU_NC9e_aObKz_vJoNC_3UNnR51H-mHu1WbjLJs1S9xvjFSyIFAkws24eqVMtUXq_nPJgWQmxIep3_s/s1600-h/4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 343px; height: 36px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHGUMRA9ZlD8eRVUoJ3GTJ_-QQtwFdgQ3jGQMJMbF1Hb1Z8oZtcySf1ksa-sAsrU_NC9e_aObKz_vJoNC_3UNnR51H-mHu1WbjLJs1S9xvjFSyIFAkws24eqVMtUXq_nPJgWQmxIep3_s/s400/4.png" alt="" id="BLOGGER_PHOTO_ID_5442769007989328402" border="0" /></a><br /><span style="font-family:trebuchet ms;"><br /></span>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-16034504234806137212010-02-22T19:17:00.015+05:302010-03-04T15:45:38.965+05:30A SIMPLE EXAMPLE WITH PYCHECKER<span style="font-weight: bold;font-family:trebuchet ms;" >BEGINNING TESTING ! </span><br /><br /><span style="font-family:trebuchet ms;">Trying out this tool for python testing .... pychecker on program e.py,<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhptpak3SfELlNtear6NCHvh3MleKQTMqJWC5MkRPw7zaA9i-S_bZXrofy6YpmOvVWCGjojnRRW4MJRcgn3cgSppJRoggf3d7IPdwXnRP-gnrIx0i949obmok14u_mP1b9Hxs-ioWB9nL8/s1600-h/Screenshot-11.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 286px; height: 177px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhptpak3SfELlNtear6NCHvh3MleKQTMqJWC5MkRPw7zaA9i-S_bZXrofy6YpmOvVWCGjojnRRW4MJRcgn3cgSppJRoggf3d7IPdwXnRP-gnrIx0i949obmok14u_mP1b9Hxs-ioWB9nL8/s400/Screenshot-11.png" alt="" id="BLOGGER_PHOTO_ID_5442091157592244994" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKR0vKGuqEl2391x_zULN0cwrAJyTeF_m9Hw0YWxci3JVcq3HhyphenhyphenpghuIxl14AFFRiGrsdZXR_pGjZEPSX7V5femP1FDnXj4tc5uNzOdiMWmNnNTBXwpVmca2FkFnzGpSaXKDxr-fw7AWM/s1600-h/Screenshot-2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 372px; height: 117px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKR0vKGuqEl2391x_zULN0cwrAJyTeF_m9Hw0YWxci3JVcq3HhyphenhyphenpghuIxl14AFFRiGrsdZXR_pGjZEPSX7V5femP1FDnXj4tc5uNzOdiMWmNnNTBXwpVmca2FkFnzGpSaXKDxr-fw7AWM/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5442094662791243554" border="0" /></a><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">The testing software identifies that sum <span style="font-weight: bold;">'shadows builtin' </span>, thus changing name of the function from sum to summation.</span><br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDg9CJQx2MKGyMth8ru0FW4relLDcLls_iYBv90VT9yTmETMT_sHNq5v7i-wCEVDOUMWHCNilHas9lwBPQOiv14WPv1Ba-r-q_shLSMPurN7T5FdIYFfLj1SW3ITTUcwvGLcvkDzW5OKI/s1600-h/Screenshot-13.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 319px; height: 179px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDg9CJQx2MKGyMth8ru0FW4relLDcLls_iYBv90VT9yTmETMT_sHNq5v7i-wCEVDOUMWHCNilHas9lwBPQOiv14WPv1Ba-r-q_shLSMPurN7T5FdIYFfLj1SW3ITTUcwvGLcvkDzW5OKI/s400/Screenshot-13.png" alt="" id="BLOGGER_PHOTO_ID_5442095550248951906" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir8OLZEeFqTcGcEBL5vynRw7dy7tn08lWdGLXjzaG6__QBswX2uiZ7iE21DjAdbC2SipTpYWmJSO72QZffA9LP4K0q6KauHQlTkpjboWesUgJ-y8wehNZeyHprd6ZRoW519ygSgrnXU5M/s1600-h/Screenshot-12.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 375px; height: 142px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir8OLZEeFqTcGcEBL5vynRw7dy7tn08lWdGLXjzaG6__QBswX2uiZ7iE21DjAdbC2SipTpYWmJSO72QZffA9LP4K0q6KauHQlTkpjboWesUgJ-y8wehNZeyHprd6ZRoW519ygSgrnXU5M/s400/Screenshot-12.png" alt="" id="BLOGGER_PHOTO_ID_5442095772862619218" border="0" /></a><span style="font-family:trebuchet ms;">.... rectifies the Warnings ! </span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >REFERNCES</span><br /><br /><span style="font-family:trebuchet ms;">(1) </span><a style="font-family: trebuchet ms;" href="http://pychecker.sourceforge.net/">Pychecker </a><br /><span style="font-family:trebuchet ms;">(2) </span><a style="font-family: trebuchet ms;" href="http://apress.com/book/view/9781590595190">Beginning Python : From Novice to Professional</a>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-43693091652456421612010-02-19T10:35:00.042+05:302010-03-04T15:46:03.617+05:30DABBLING WITH BASH -1<span class="Apple-style-span" style="font-family:'trebuchet ms';"><b>DABBLING WITH BASH - 1 </b></span><div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><b><br /></b></span></div><div><div style="text-align: justify;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><a href="http://en.wikipedia.org/wiki/Bash">BASH</a> (<span style="font-weight: bold;">B</span>ourne <span style="font-weight: bold;">A</span>gain <span style="font-weight: bold;">SH</span>ell), the name seemed to echo between '<a href="http://www.thefreedictionary.com/bashing">Bashing</a>' to '<a href="http://en.wikipedia.org/wiki/Bourne_%28film_series%29">Bourne Trilogy</a>'. The command line for nearly all *nix Operating Systems is actually a programming language !</span><br /><br /><span style="font-family:trebuchet ms;">I am working on <a href="http://tiswww.case.edu/php/chet/bash/bashtop.html">version 4.0.33</a></span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWLXz-U_EKYHvheKkE8YrrLHrx4Csl-oIoGuxBBE0fhs5i1tMeOG33mAeJD76ORb42h55ZzcUoikr5NwplVUrWwuPYonXDtUhG16gx2bC1cfVJQno-geYO5LjQ1swkeu3TNcRPy8Jkvq8/s1600-h/Screenshot-2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 88px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWLXz-U_EKYHvheKkE8YrrLHrx4Csl-oIoGuxBBE0fhs5i1tMeOG33mAeJD76ORb42h55ZzcUoikr5NwplVUrWwuPYonXDtUhG16gx2bC1cfVJQno-geYO5LjQ1swkeu3TNcRPy8Jkvq8/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5440938637216417586" border="0" /></a><br /></div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span style="font-weight: bold;">1)The Hello World Program </span><br /><br />1a) from command line<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCmdlluc7LOiEDHTz0Q9m-KOgF4UTu6LRcCcz99sFyXgD8_3No6qiWZzpil8aUoo-QDf-f9HTVwgBKqtw4dqzUlDvLCxYIeU4AQay1Sy_8BJ80Q0sFwIt1d-lmK60lq5HHEgREQY6wl-0/s1600-h/Screenshot-2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 249px; height: 54px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCmdlluc7LOiEDHTz0Q9m-KOgF4UTu6LRcCcz99sFyXgD8_3No6qiWZzpil8aUoo-QDf-f9HTVwgBKqtw4dqzUlDvLCxYIeU4AQay1Sy_8BJ80Q0sFwIt1d-lmK60lq5HHEgREQY6wl-0/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5439826647764875298" border="0" /></a><span style="font-family:trebuchet ms;">1b) from script</span><br /><br /></div><div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4HgKu2n7J1i2L3hLoWa4nUKSu4ZuqhnJDRaOMvpZBAbs_xGfXi0kMtxrM8PGv3lpmfoBWRy9-Z9oF6ZxtVR8rGJ6qkBAVG5zhtMCRujGKjs-7s8qIvf1lcOO2yz26zLqNqV73VO8aM9w/s1600-h/Screenshot-4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 237px; height: 119px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4HgKu2n7J1i2L3hLoWa4nUKSu4ZuqhnJDRaOMvpZBAbs_xGfXi0kMtxrM8PGv3lpmfoBWRy9-Z9oF6ZxtVR8rGJ6qkBAVG5zhtMCRujGKjs-7s8qIvf1lcOO2yz26zLqNqV73VO8aM9w/s400/Screenshot-4.png" alt="" id="BLOGGER_PHOTO_ID_5439828807882718770" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicHZ6NipkW19QTmQwkn81rstofZTpp3dd1IGnrRVVIH_HmktBEwa2xly_Rk_QIChnPeivDSp0U5C725P_UmJUd8oDXs_BLfqdsl3_DZYhnrqml_Zs0GZFlAO9nH5jP3IyDsHkOwK9PIYw/s1600-h/Screenshot-5.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 270px; height: 59px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicHZ6NipkW19QTmQwkn81rstofZTpp3dd1IGnrRVVIH_HmktBEwa2xly_Rk_QIChnPeivDSp0U5C725P_UmJUd8oDXs_BLfqdsl3_DZYhnrqml_Zs0GZFlAO9nH5jP3IyDsHkOwK9PIYw/s400/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5439829248400754162" border="0" /></a><span style="font-family:trebuchet ms;">1c) 'Exotic' Hello, World(s)</span><br /><br /><span style="font-family:trebuchet ms;">This program prints Hello and the first command-line argument</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbCessS-kpND5g8jnbVO4mmj7P78hg8Dp5NV5xWJCEHlCGkUrBzUklBFaFDYPedM07Vb5TAa5Iu3vi34tnrdrrxCtYIkFIP1qE9kq8-HboQkIwWo1JDaz5MZdtrk7kUjY7O4gPrxRaV00/s1600-h/Screenshot-3.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 234px; height: 30px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbCessS-kpND5g8jnbVO4mmj7P78hg8Dp5NV5xWJCEHlCGkUrBzUklBFaFDYPedM07Vb5TAa5Iu3vi34tnrdrrxCtYIkFIP1qE9kq8-HboQkIwWo1JDaz5MZdtrk7kUjY7O4gPrxRaV00/s400/Screenshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5439831854540284706" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMOyOjUWAmoI9d7eTbI-nKmBTABAsV5yJouK3Snc1MZZQEWpAREFWXapx9kREG-YtWcd54CfeU6Kx2v-KEjqFaqhUIQ40XhX0NuyRxqT6tdcRoWCkwnklg2SlkWVBGQ9t9z9RubhNlH4E/s1600-h/Screenshot-2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 342px; height: 154px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMOyOjUWAmoI9d7eTbI-nKmBTABAsV5yJouK3Snc1MZZQEWpAREFWXapx9kREG-YtWcd54CfeU6Kx2v-KEjqFaqhUIQ40XhX0NuyRxqT6tdcRoWCkwnklg2SlkWVBGQ9t9z9RubhNlH4E/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5439832039550929026" border="0" /></a><span style="font-weight: bold;font-family:trebuchet ms;" >2)Counting from 1 to 10</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3ZgOFrRrAXEwhz-nrt1yyv5W7SWAuYqb7yWyjAgfM8SIIzHTgInzKLQ5TDawco5bBrCxQOqUuYQKMVeZVykbI5YCfZpg8fifBTXC2qZlbvBPZoBYXQPS2i-gEY_pilebFzj2JawacpcM/s1600-h/Screenshot-4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 298px; height: 92px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3ZgOFrRrAXEwhz-nrt1yyv5W7SWAuYqb7yWyjAgfM8SIIzHTgInzKLQ5TDawco5bBrCxQOqUuYQKMVeZVykbI5YCfZpg8fifBTXC2qZlbvBPZoBYXQPS2i-gEY_pilebFzj2JawacpcM/s400/Screenshot-4.png" alt="" id="BLOGGER_PHOTO_ID_5439834678320993554" border="0" /></a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjABo-LXYKv45FLe49lo-1e5Wx2c1a6evA8sspe8uHZ2J4frcfNPknGL7VwaWYFphAueRPh8o67VQ2EhSnL7B1jsUWDxQSS6Fagi6qu4NB0j-8Wa3p8IQFzXnwqVACK6kPXL0NDREGMKLU/s1600-h/Screenshot-5.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 297px; height: 213px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjABo-LXYKv45FLe49lo-1e5Wx2c1a6evA8sspe8uHZ2J4frcfNPknGL7VwaWYFphAueRPh8o67VQ2EhSnL7B1jsUWDxQSS6Fagi6qu4NB0j-8Wa3p8IQFzXnwqVACK6kPXL0NDREGMKLU/s400/Screenshot-5.png" alt="" id="BLOGGER_PHOTO_ID_5439834069762808946" border="0" /></a> <span style="font-weight: bold;font-family:trebuchet ms;" >3)Evaluating the squares</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihRcFHs0e_voQDk5yz3lrByyC4s4X4cqmaW57WmPeW4dnFxXKcMpdhoFCTi0J5_Oa1LrOsh5pHV7nbewkUyqmyp_wO19kae4aL4fhIcI4I52BsjvVHgXJ3EzLH7e46m2qvm772gg6GNSQ/s1600-h/Screenshot-6.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 367px; height: 111px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihRcFHs0e_voQDk5yz3lrByyC4s4X4cqmaW57WmPeW4dnFxXKcMpdhoFCTi0J5_Oa1LrOsh5pHV7nbewkUyqmyp_wO19kae4aL4fhIcI4I52BsjvVHgXJ3EzLH7e46m2qvm772gg6GNSQ/s400/Screenshot-6.png" alt="" id="BLOGGER_PHOTO_ID_5439914975504320466" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5FGJx1IPOpX0lheRT8U0XWXoM53Cg-p1mP1WPfpw265lsBU1Jwo-vgTycgrIhUdLiTZhj94Fo6Z7wRoW6OPvxAbTEol7i2t-ZqFz4mjVHs1K_5vZqUYrz-2-SZg7TzPeSM9Fj2kh_dgQ/s1600-h/Screenshot-7.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 278px; height: 126px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5FGJx1IPOpX0lheRT8U0XWXoM53Cg-p1mP1WPfpw265lsBU1Jwo-vgTycgrIhUdLiTZhj94Fo6Z7wRoW6OPvxAbTEol7i2t-ZqFz4mjVHs1K_5vZqUYrz-2-SZg7TzPeSM9Fj2kh_dgQ/s400/Screenshot-7.png" alt="" id="BLOGGER_PHOTO_ID_5439915252400949522" border="0" /></a><span style="font-weight: bold;font-family:trebuchet ms;" >4)Some Arithmetic</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUaLbdZVziL5bWlGBn_ry3hkdqZ1DoWbE40vCeu2w-D-td1qUgpxe0s95Xb11YAoUWdMmEYkoTbb1-ElJCG65b3dq30Ss-aclJOphvr_vXwYnUfrqDAKrnOLFUw52FsMG_GG1_V7ErZ0/s1600-h/63937532.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 229px; height: 306px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibUaLbdZVziL5bWlGBn_ry3hkdqZ1DoWbE40vCeu2w-D-td1qUgpxe0s95Xb11YAoUWdMmEYkoTbb1-ElJCG65b3dq30Ss-aclJOphvr_vXwYnUfrqDAKrnOLFUw52FsMG_GG1_V7ErZ0/s400/63937532.png" alt="" id="BLOGGER_PHOTO_ID_5439915931572857906" border="0" /></a><br /></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-87871973878256438552010-02-14T23:49:00.009+05:302010-03-04T15:46:31.179+05:30CHECKING FOR OPENGL RENDERING IN UBUNTU<span class="Apple-style-span" style="font-family:'trebuchet ms';"><i><span class="Apple-style-span" style="font-style: normal; font-weight: bold;">CHECKING FOR OPENGL RENDERING !<br /><br /></span></i></span><div style="text-align: justify;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRbXTEuBAYS_84Q3R0_yzh95m2AgLX3xE9b0PG9cUBUMrpN8YkIgiskslKsxacpSX6BvAcpdue8dTLPfz1mFtCe0oaL98Z9Xz6-m67HEvHsmRwbSEnC2dYXAXAP1djbW0Avqt1lr2Gil8/s1600-h/Screenshot-8.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 305px; height: 35px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRbXTEuBAYS_84Q3R0_yzh95m2AgLX3xE9b0PG9cUBUMrpN8YkIgiskslKsxacpSX6BvAcpdue8dTLPfz1mFtCe0oaL98Z9Xz6-m67HEvHsmRwbSEnC2dYXAXAP1djbW0Avqt1lr2Gil8/s400/Screenshot-8.png" alt="" id="BLOGGER_PHOTO_ID_5438210705895590962" border="0" /></a></div><span class="Apple-style-span" style="font-family:'trebuchet ms';">Details about rendering and also the graphics-card can also be obtained by the command, <i>glxinfo | grep render</i></span>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-83590836551446928722010-01-08T22:40:00.015+05:302010-03-04T15:47:50.247+05:304 GOOGLE SEARCHES IN A SINGLE PAGE !<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21jkLHWuzJZ9pImaFMf4wUhugrUZVpl55lAcOywqr_n4glMlpSrVtX3gMODGvXh0IMgI_KrzNb68XHso3NZ8P5XJSbpBCnesUPVeDodVw4mDNnX2XYMwPjlIwCh5PedLKFOQlmfEng2o/s1600-h/Screenshot-GoogleGoogleGoogleGoogle+-+Mozilla+Firefox.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 182px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg21jkLHWuzJZ9pImaFMf4wUhugrUZVpl55lAcOywqr_n4glMlpSrVtX3gMODGvXh0IMgI_KrzNb68XHso3NZ8P5XJSbpBCnesUPVeDodVw4mDNnX2XYMwPjlIwCh5PedLKFOQlmfEng2o/s320/Screenshot-GoogleGoogleGoogleGoogle+-+Mozilla+Firefox.png" alt="" id="BLOGGER_PHOTO_ID_5424418470989709906" border="0" /></a>Try "<a href="http://www.googlegooglegooglegoogle.com/">www.googlegooglegooglegoogle.com</a>" and get the 4 google search on a single page.<br /><br />Try playing with funny variations ! a mix and match with wiki and google !<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZkOg44ydxz2EZRvXWto07fwaur8yJNPQZTtYrtcs3NzejXjjGWMGQjJWg24STlGEtVmfGzTZ-Iq4CXNn-xncHK_IUBfWVMAEpe0HIN9mYD_X-RCmbgrPrWkjOugo26a5hikAY2iPRiWc/s1600-h/Screenshot.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 183px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZkOg44ydxz2EZRvXWto07fwaur8yJNPQZTtYrtcs3NzejXjjGWMGQjJWg24STlGEtVmfGzTZ-Iq4CXNn-xncHK_IUBfWVMAEpe0HIN9mYD_X-RCmbgrPrWkjOugo26a5hikAY2iPRiWc/s320/Screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5424589526292679938" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_3G-IObbUjlA/S0gCRpBYWzI/AAAAAAAABEA/J9ZXPTtCqnE/s1600-h/Screenshot.png"><br /></a>LALIThttp://www.blogger.com/profile/14578942897309639690noreply@blogger.com1tag:blogger.com,1999:blog-4917164306143703214.post-29050043582742547362010-01-04T06:30:00.018+05:302010-03-04T15:48:17.984+05:30ZETA IN SCIPY<div style="text-align: justify;font-family:webdings;"><span style="font-size:100%;"><b style="font-family:trebuchet ms;"><span class="Apple-style-span"><span class="Apple-style-span">PROBLEMS WITH ZETA FUNCTION IN SCIPY</span></span></b></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span style="font-size:100%;"><b><span class="Apple-style-span"><span class="Apple-style-span"><br /></span></span></b></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">Dabbling with zeta in scipy gave various unsatisfactory results. Few very obvious results of zeta function are ;</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">(1) For negative even integers the function is zero</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">(2) zeta(0) = -1/2</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">(3) zeta(-1) = -1/12</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">(4) zeta(1/2) = -1.46035450880.....</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">(5) zeta(1) = infinity<br /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">(6) zeta(2) = 1.6449340.....</span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">Trying it on scipy,</span></span></div><div style="font-family:webdings;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span></div><div style="text-align: center;font-family:webdings;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuW5kJv9xOENfpP7Sze7MMtcETR6muvEBi6ay29qimNNprldyUtc_-tNfxPJnwpW31M5pkjXuI-rMaqEZSNo3EMg5l5ul_KZ0pMdTrSiopiY9rY8NwJBVbaSJe59-ndnMPynVMmc_AyOg/s400/Screenshot-1.png" /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br />The probable reason for this inconsistent behaviour and issues for zeta values below 2 and improbable results for negative numbers is; the module is probably structured abinitio from zeta function<br /><br /></span></span></div><div style="text-align: center;font-family:webdings;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW1WjgQ9RMLa36_KfksIdr5T6AtnX7gPwVpAm8HkVEZCUnLo7EM-b1vTZMIfd2L4esJf-uQrVndGga3trd6u67aJ8w3C5q_ciVy7xoahhayW-VS0yifXyv0Dzij64CGWQ1MYckI8ffqvU/s400/zeta_function.jpg" /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span">whilst it may be a better idea to structure the zeta function using the functional equation.</span></span></div><div style="text-align: center;font-family:webdings;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeJxm5kqHQTVaSl6zafLg7ONY2Yx-e8sYTiGEAl0460QXmPBjqmUlfNUcHtEb4GKoifmcWH_cVhn_aqkiSrED-TBJ-yBjvgD656BZvLYXJrgyvLcOhUivAfUdIkd8g5pOK0i84NUv3N50/s400/chp_riemann_eqn.jpg" /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span><span style="font-size:100%;"><span class="Apple-style-span"><span class="Apple-style-span">It may also help to have a special provision for zeta(1/2)</span></span></span><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span></div><div style="text-align: justify;font-family:trebuchet ms;"><span style="font-size:100%;"><span class="Apple-style-span"><span class="Apple-style-span"><br /></span></span></span></div><div style="text-align: justify;"><span style=";font-family:webdings;font-size:100%;" ><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.scipy.org/"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 187px;" src="http://docs.scipy.org/doc/scipy/reference/_static/scipyshiny_small.png" alt="" border="0" /></a></span><span style=";font-family:'trebuchet ms';font-size:100%;" class="Apple-style-span" ><span class="Apple-style-span"><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></span></span><div style="text-align: left;font-family:webdings;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span></div><div style="text-align: left;font-family:webdings;"><span class="Apple-style-span" style="font-size:100%;"><span class="Apple-style-span"><br /></span></span></div><div style="text-align: left;"><span style=";font-family:'trebuchet ms';font-size:100%;" class="Apple-style-span" ><span class="Apple-style-span">REFERENCE<br />(1) <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.special.zeta.html">Zeta Scipy reference </a></span></span><br /></div></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com8tag:blogger.com,1999:blog-4917164306143703214.post-76019119646504071022010-01-04T05:43:00.025+05:302010-03-04T15:49:05.456+05:30AN EXPERIMENT IN ADA<span style="font-weight: bold;"><span class="Apple-style-span" style="font-family:'trebuchet ms';">MULTIPLE CONCURRENT UPDATES IN ADA-2005</span></span><div><b style="font-family:trebuchet ms;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style="font-size:medium;"></span></span></b><div style="font-family:trebuchet ms;"><b><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></b></div><div style="text-align: justify;font-family:trebuchet ms;"><span class="Apple-style-span" style="font-family:'trebuchet ms';">Probably the best book in Ada concurrent and real time programming is,</span></div><div style="text-align: justify;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><a href="http://www.amazon.co.uk/gp/product/0521866979/ref=pd_lpo_k2_dp_sr_3?pf_rd_p=471057153&pf_rd_s=lpo-top-stripe&pf_rd_t=201&pf_rd_i=052162911X&pf_rd_m=A3P5ROKL5A1OLE&pf_rd_r=127KH83YHQ3BHK8EAPAJ"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbd-0yeU5_ZcE_5mHLEweK5quiBfB680Dtoc8ecvKPj3aFRar5G5YVO0CmOJ1FfjJlS_WPWZiWhQnS9khbnkZisDS2bAtLttyaHnRXLEcCqyj7tkCKpiRaQH47fOsG21U_jRH4iKVoh0M/s320/4152912lbcL.jpg" /></a><br /><br /></span><div style="text-align: left;"><div style="text-align: center;"><span class="Apple-style-span" style=";font-family:georgia;font-size:85%;" ><span class="Apple-style-span">Pic 1. Concurrent and Real time programming in Ada-2005</span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:georgia;"><br /></span></div><div style="text-align: justify;"><span class="Apple-style-span" style="font-family:'trebuchet ms';">In this book, in page 37 the authors discuss a program which lacks protection to multiple concurrent updates</span>,<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib1FNtAJhPd8pE_j6xpIrxlCxBdf4ikj0AvpjJegK676cDeR8pHr46HPASJe-hUQB6rYFgFtFTHbYCaQhKc46kxEGsP9ZWtt7RIdHuyUn62MQszBSug18Gb_rsuqhnFTpd34QxV3KTnPk/s1600-h/Screenshot-4.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 372px; height: 375px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib1FNtAJhPd8pE_j6xpIrxlCxBdf4ikj0AvpjJegK676cDeR8pHr46HPASJe-hUQB6rYFgFtFTHbYCaQhKc46kxEGsP9ZWtt7RIdHuyUn62MQszBSug18Gb_rsuqhnFTpd34QxV3KTnPk/s400/Screenshot-4.png" alt="" id="BLOGGER_PHOTO_ID_5422677494856460194" border="0" /></a><div style="text-align: center;"><span class="Apple-style-span" style="font-size:85%;">Pic 2. The Program</span></div><div style="text-align: center;"><br /></div>On tinkering with the program, increasing the looping; strange results are seen to happen. The program is tried with increasing looping in XP and also Ubuntu 9.10. The results are as follows;</div><div style="text-align: justify;"><br /></div><div style="text-align: justify;">Observations in XP ( first table ) and in Ubuntu 9:10( second table ) :<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3eJv0TyNN8MffNSHLcpMD2pdtWxY-wkRJd5TOvYEAxa3PUD7JC7-Cnv_G4x-rGcQ3O7nQDRvVscgAx80hvExkG3kY5NC2qx5K7SxsxbWix2lMwt86JF2khrsR_tsFziPNccds_X5tIzc/s1600-h/Screenshot-2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 174px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3eJv0TyNN8MffNSHLcpMD2pdtWxY-wkRJd5TOvYEAxa3PUD7JC7-Cnv_G4x-rGcQ3O7nQDRvVscgAx80hvExkG3kY5NC2qx5K7SxsxbWix2lMwt86JF2khrsR_tsFziPNccds_X5tIzc/s400/Screenshot-2.png" alt="" id="BLOGGER_PHOTO_ID_5422678055363206546" border="0" /></a></div><div style="text-align: justify;"><div style="text-align: left;"><span class="Apple-style-span" style="color: rgb(0, 0, 238);"><u><span class="Apple-style-span" style="color: rgb(0, 0, 0);"><br /></span></u></span></div><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszCd9DxN4HaTfr5a0cjHMqaRQa9NiyQBqyj0JrzDbVjU_0A42bEVN_GExyYArBTDgRrecGo8dxUjNkbFSSF1wSqUDMbX6Aqy5ntJKCycvs2zgCRfBtnNksnIzWCQZXYDGciX_HIHMKso/s1600-h/Screenshot-3.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 197px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszCd9DxN4HaTfr5a0cjHMqaRQa9NiyQBqyj0JrzDbVjU_0A42bEVN_GExyYArBTDgRrecGo8dxUjNkbFSSF1wSqUDMbX6Aqy5ntJKCycvs2zgCRfBtnNksnIzWCQZXYDGciX_HIHMKso/s400/Screenshot-3.png" alt="" id="BLOGGER_PHOTO_ID_5422678169005826610" border="0" /></a></div><span style="font-family:trebuchet ms;">The program runs on the same body and has 2 tasks, on higher loops discrepancy is observed and issues of multiple concurrent updates are visible.</span></div><div style="text-align: left;"><span></span><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span> <div style="text-align: justify;"><span style="font-family:trebuchet ms;">On closer observations it can be seen that XP and Ubuntu 9.10 behave little differently and the issue of multiple concurrent updates come to be at different loopings.</span><br /></div><div style="text-align: justify;"><span style="font-family:trebuchet ms;"><br /></span></div><div style="text-align: justify;"><span style="font-family:trebuchet ms;">The reasons for such behaviour is still not very well understood by me, however modifying the program using semaphores does rectify this problem.</span></div></div></div></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com1tag:blogger.com,1999:blog-4917164306143703214.post-90488989869635454962009-12-27T07:24:00.006+05:302010-04-30T13:45:17.035+05:30STARTING OFF IN RUBY<div style="text-align: left;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><b>MY FIRST RUBY PROGRAM !</b></span></div><div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></div><div><span class="Apple-style-span" style="font-family:'trebuchet ms';">Dabbling in python and its variants I came to try ruby ! The syntax is very similar to python.</span></div><div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRxJ61ui3SBwwr0w_Gt0b_2JBFpWWe8fLbLQ5sS6FSCQqQ71A9goULpUdDKL1xLsKo4yeyU7KgRxpD_UlG1JxwyffoNRYrud310W_Y5QXFwBm0ieTlSfa-ZBrSHgm5CT2Wafe7wR-wvdQ/s400/Screenshot-2.png" /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:small;">Fig1. Ruby version 1.8.7</span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:georgia;"><span class="Apple-style-span" style="font-size:small;"><br /></span></span></div><div><span class="Apple-style-span" style="font-family:'trebuchet ms';">My first program was straight from the <a href="http://www.ruby-lang.org/en/">ruby website</a>, </span></div><div><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim6bzpCzfsQkiy7_hGJodtXogbyeltwNG7_-dSMFdE_cnxTtmLxXzYXOlapjKGpoLyiOH8_PSSow_TWb1dwEza_EEXuFEHSbCg4OsNg8toghIL22rIeuJzWgBbjj9xFddXPUv-ggDwfuo/s400/Screenshot-1.png" /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style=";font-family:georgia;font-size:small;" >Fig2. Seen on Ruby website</span></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></div><div style="text-align: left;"><span class="Apple-style-span" style="font-family:'trebuchet ms';">The output was as desired ! </span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><br /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigkQ5w7rlPSR7UfhGcOMg3-peijf-KorXpGW-6sTiE_OEu8YsfnysrADEsL5HvgRpK6NcZwDhP7UDRFmWYlcZI6iD-fJ_7dgR2FRs8N8XKaOERDmXxCduuByRrULVJnnj1ILxDcgRIxYY/s400/Screenshot.png" /></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style=";font-family:georgia;font-size:small;" >Fig3. I love Ruby ! </span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style=";font-family:georgia;font-size:small;" ><br /></span></span></div><div style="text-align: center;"><span class="Apple-style-span" style="font-family:'trebuchet ms';"><span class="Apple-style-span" style=";font-family:georgia;font-size:small;" ><br /></span></span></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com3tag:blogger.com,1999:blog-4917164306143703214.post-85052106714799150332009-11-27T01:59:00.003+05:302010-03-04T15:50:44.019+05:30SINE INTEGRAL IN SCIPY<span style="font-weight: bold;font-family:trebuchet ms;" >THE SINE INTEGRAL<br /><br /></span><div style="text-align: justify;"><div style="text-align: justify;"><span style="font-family:trebuchet ms;">The</span><span style="font-weight: bold;font-family:trebuchet ms;" > </span><span style="font-family:trebuchet ms;"> </span><span style="font-family:trebuchet ms;">Sine <a href="http://en.wikipedia.org/wiki/Sine_integral#Sine_integral">Integral</a> is a very important function in Physics, Astronomy, Electrodynamics, Mathematical Physics,Optics and Signal Processing.</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR4ts661IydiDwhlrul9MqR573IKjQkJHGp-6Ri27Ho5glatlJSiB9GqUxk3zZfEm9galiGtLYvY-btiI7z_tBlDr60KDv32MAxFxewqcLBsrEAI3EpC4EORgtGdT3X0_FjZYeYtYiU6g/s1600/2.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 234px; height: 93px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR4ts661IydiDwhlrul9MqR573IKjQkJHGp-6Ri27Ho5glatlJSiB9GqUxk3zZfEm9galiGtLYvY-btiI7z_tBlDr60KDv32MAxFxewqcLBsrEAI3EpC4EORgtGdT3X0_FjZYeYtYiU6g/s400/2.bmp" alt="" id="BLOGGER_PHOTO_ID_5408505685560024082" border="0" /></a><span style="font-family:trebuchet ms;">A fundamental result in the sine integral is;</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28ZIu6YFuAMFMjphQNIj-f69_hH-5srSdGwX75bC6X3RngHp0uxQLrmBLFx54K2ZGdIzxmmW35VqsbnPE1g96bzPUxzT0dUR39h6LPU1jCFqvrGyZyndnHZkOTxhuuJA9v-unmH78C6M/s1600/1.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 208px; height: 96px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi28ZIu6YFuAMFMjphQNIj-f69_hH-5srSdGwX75bC6X3RngHp0uxQLrmBLFx54K2ZGdIzxmmW35VqsbnPE1g96bzPUxzT0dUR39h6LPU1jCFqvrGyZyndnHZkOTxhuuJA9v-unmH78C6M/s400/1.bmp" alt="" id="BLOGGER_PHOTO_ID_5408501519414287202" border="0" /></a><span style="font-family:trebuchet ms;">This result is analytically proven using contour integrals</span> concept from complex theory.<br /><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >TRYING IT IN MATLAB<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUM5Fuea3mfm6Qa2as_P4yFrBGHHLxbc3quEeAAq1RLqvHBGPRKNnTVkEIJ7konX6sJSq7kmIEl-kbWuLemHBCJMNPv6wLo9riBLeR5EIQYDXO9XmC0nsFfg0oV3I8WfFhNhEDUMOOlI/s1600/untitled56778.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 226px; height: 111px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUM5Fuea3mfm6Qa2as_P4yFrBGHHLxbc3quEeAAq1RLqvHBGPRKNnTVkEIJ7konX6sJSq7kmIEl-kbWuLemHBCJMNPv6wLo9riBLeR5EIQYDXO9XmC0nsFfg0oV3I8WfFhNhEDUMOOlI/s400/untitled56778.bmp" alt="" id="BLOGGER_PHOTO_ID_5408507599738366978" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFUegaEsflYqsFiXMga0XDHeeOtbgykN6cGcuzy-IVmJutLboWgkB5CSF0ZYViTJAn5zVbT4ZuVcg2XB3m22exZ9pvUEO2uCRCJLU6Ls4i_jisk7oS3FXHNpK7_-X-IzCqUNJRrhXKv4Y/s1600/untitledgy7.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 210px; height: 223px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFUegaEsflYqsFiXMga0XDHeeOtbgykN6cGcuzy-IVmJutLboWgkB5CSF0ZYViTJAn5zVbT4ZuVcg2XB3m22exZ9pvUEO2uCRCJLU6Ls4i_jisk7oS3FXHNpK7_-X-IzCqUNJRrhXKv4Y/s400/untitledgy7.bmp" alt="" id="BLOGGER_PHOTO_ID_5408507916757854802" border="0" /></a><br /><span style="font-family:trebuchet ms;">MATLAB gives excellent results</span><span style="font-family:trebuchet ms;">, particularly for the special case of (0-inf )it gives correct value.</span><span style="font-weight: bold;font-family:trebuchet ms;" ><br /><br />TRYING IT IN SCIPY<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6yjhzxnIfLhyu_IhvbmwVuosZCRsPsC7EGszZkIKW3d__uFjekiptejhatw8lIAfcqP1a-qVpjd2OmKQsYvdDqRxbuUGZxo79z4UNMP0ALXP_k10aJoAgt8_hk0rn7ZJ7M0csm_ZX0EY/s1600/45566.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 282px; height: 194px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6yjhzxnIfLhyu_IhvbmwVuosZCRsPsC7EGszZkIKW3d__uFjekiptejhatw8lIAfcqP1a-qVpjd2OmKQsYvdDqRxbuUGZxo79z4UNMP0ALXP_k10aJoAgt8_hk0rn7ZJ7M0csm_ZX0EY/s400/45566.bmp" alt="" id="BLOGGER_PHOTO_ID_5408509014859301458" border="0" /></a><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">In Scipy the sine integral (and the cosine integral) is via <span style="font-weight: bold;">(si,ci) = sici </span>function. It yields excellent values for numbers, however for infinity it yields <span style="font-weight: bold;">nan (not a number)</span>. This should probably <span style="font-weight: bold;">be corrected with an exception</span> in the sici module.</span><br /><br /><span style="font-family:trebuchet ms;">It is worth noting that for sufficiently high values (which tend to infinity) the desired result of 1.57.... ( = pi/2) is obtained, which confirms the numerical evaluation is correct</span><br /></div><span style="font-weight: bold;font-family:trebuchet ms;" ><br /><br />REFERENCES</span> <span style="font-family:trebuchet ms;"><br />(1) </span><a style="font-family: trebuchet ms;" href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.special.sici.html">sici</a><br /><span style="font-family:trebuchet ms;">(2) </span><a style="font-family: trebuchet ms;" href="http://mathworld.wolfram.com/SineIntegral.html">sine integral</a><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.scipy.org/"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px; height: 187px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3sHu4xh6QO4Q_pIiE_14xTNe7eVzrZC4OSSI413rVaf4LOmW8DCeHiS6nepc-Cs5-X8hGKKCEGu8WIBkCSDWIaOwN1qZrMvgGezz5TZ5_FtUKsKKD5N2D4rYXksrjujbK0HUo8qSskQc/s400/scipyshiny_small.png" alt="" id="BLOGGER_PHOTO_ID_5408511205360919906" border="0" /></a><br /><br /><br /></div><span style="font-weight: bold;font-family:trebuchet ms;" ></span></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com1tag:blogger.com,1999:blog-4917164306143703214.post-22236251134633453742009-11-25T06:23:00.016+05:302010-08-22T19:56:12.464+05:30RAISING IT TO THE POWER OF ......<span style="font-weight: bold;font-family:trebuchet ms;" >LAWS OF EXPONENT<br /><br /></span><div style="text-align: justify;"><span style="font-family:trebuchet ms;">In the laws of exponents,<span style="font-weight: bold;"> </span></span><span style="font-family:trebuchet ms;">a number can never be raised to an exponent to yield negative values. Only using complex exponents can negative values be obtained.<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9vCw5VLYOLs6kBB1MEwezUMVuvaFnQtMQe-YHN0D1QHrI6Rgu8gmHuPItlO7L_ExRIhOKiQqkmdHaqKweHkYt9N1lZ8Squ4875DsRvnZOL5w7n27xVasbi8Bu0kalJcr6-i-vrrEhlME/s1600/untitled.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 335px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9vCw5VLYOLs6kBB1MEwezUMVuvaFnQtMQe-YHN0D1QHrI6Rgu8gmHuPItlO7L_ExRIhOKiQqkmdHaqKweHkYt9N1lZ8Squ4875DsRvnZOL5w7n27xVasbi8Bu0kalJcr6-i-vrrEhlME/s400/untitled.bmp" alt="" id="BLOGGER_PHOTO_ID_5407846483472307378" border="0" /></a><br /><span style="font-family:trebuchet ms;">Trying the same formulation in python, it is worth noting that the formulation fails for a = 1 hence a special case output for a = 1.<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge8mF3ZZVF-10VjhvSD6MQDZCPADdl8V4tlghuAGo-g_EOEDi8u2RO0LI1BLX2MGEDo3UD2NeaytSr-hfJp4YTxAOIF9MfJvzQej57a9JWL0ISga55u4h6Cl-eTJMDXxcjDQtViXFmghw/s1600/untitled2.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 308px; height: 146px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEge8mF3ZZVF-10VjhvSD6MQDZCPADdl8V4tlghuAGo-g_EOEDi8u2RO0LI1BLX2MGEDo3UD2NeaytSr-hfJp4YTxAOIF9MfJvzQej57a9JWL0ISga55u4h6Cl-eTJMDXxcjDQtViXFmghw/s400/untitled2.bmp" alt="" id="BLOGGER_PHOTO_ID_5407847186573063266" border="0" /></a><br />Some sample output is ;<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfZ68VRVGlKUpAiTnhsFaQbNfQBE5tc5DX3GDT3Ur7exYGkkSeJMzwdS3Jsd52rVyc-I2gOmZ51fnAYtz38IVl1d5-pYMaS27V3zRXC_HqHYJ6ksFvhq3UHv-GfNuk6gnwMe1SzL495Ic/s1600/untitled3.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 262px; height: 164px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfZ68VRVGlKUpAiTnhsFaQbNfQBE5tc5DX3GDT3Ur7exYGkkSeJMzwdS3Jsd52rVyc-I2gOmZ51fnAYtz38IVl1d5-pYMaS27V3zRXC_HqHYJ6ksFvhq3UHv-GfNuk6gnwMe1SzL495Ic/s400/untitled3.bmp" alt="" id="BLOGGER_PHOTO_ID_5407848840888097170" border="0" /></a><br />Similar treatments in MATLAB is also fruitful<br /><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJGXUcqihgJgzM5tmem09xqPH1agDpQu0shI6JQfcHY2UfetqGbt3to0jNDrEapKKGBsyiRt0AJ1wFxJ3LV0V8R4HGzTqAY9C6rNGdLEeuOFeC5pG1ZH3mTE_3jbCjRRJv8jm5Bymh4QU/s1600/untitled.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 229px; height: 108px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJGXUcqihgJgzM5tmem09xqPH1agDpQu0shI6JQfcHY2UfetqGbt3to0jNDrEapKKGBsyiRt0AJ1wFxJ3LV0V8R4HGzTqAY9C6rNGdLEeuOFeC5pG1ZH3mTE_3jbCjRRJv8jm5Bymh4QU/s400/untitled.JPG" alt="" id="BLOGGER_PHOTO_ID_5407849407837894706" border="0" /></a><br /><span style="font-family:trebuchet ms;">The visible change is that iota in MATLAB it is i, while in Python it is j.<br /><br /><br /></span><span style="font-weight: bold;font-family:trebuchet ms;" ></span></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-91722209892089187572009-11-07T16:29:00.004+05:302010-03-04T15:52:02.553+05:30BIZARRE BIZARRE PYTHON<span style="font-weight: bold;font-family:trebuchet ms;" >IS THAT SOME WITCH CRAFT ? </span><br /><br /><span style="font-family:trebuchet ms;">Python .... maybe the one of the best programming languages has just gone crazy !<br /><br />In the interpreter mode I got these crazy results trying to get numbers starting with zero...<br /><br /></span><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs3Yuj2heI7vsSiEAVfm8XUErsRIESTheHvjXNuyInTHnfAmNRnqIIZFhRgsWrQukB0jkIbsmx0qjTrp2fzAqh4_4r4rgHum1ZHsW8UjTTidelxtIvUCmNLk3oFFjR9Efxu2_LhByf7Yo/s1600-h/untitled.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 264px; height: 213px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs3Yuj2heI7vsSiEAVfm8XUErsRIESTheHvjXNuyInTHnfAmNRnqIIZFhRgsWrQukB0jkIbsmx0qjTrp2fzAqh4_4r4rgHum1ZHsW8UjTTidelxtIvUCmNLk3oFFjR9Efxu2_LhByf7Yo/s400/untitled.bmp" alt="" id="BLOGGER_PHOTO_ID_5401315661455447810" border="0" /></a><br /><span style="font-family:trebuchet ms;">Only on referring to Hetland that I got to know that the interpreter does an OCTAL ! </span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >REFERENCES</span><br /><span style="font-family:trebuchet ms;">(1) <a href="http://www.apress.com/book/view/159059519x">Hetland</a></span>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0tag:blogger.com,1999:blog-4917164306143703214.post-33516887914890710402009-10-19T05:49:00.024+05:302010-03-04T15:51:46.920+05:30SQUARE ROOT OF IOTA<span style=";font-family:trebuchet ms;font-size:small;" ><span style=""><b>SQUARE ROOT OF COMPLEX NUMBERS</b></span></span><br /><br /><span style=";font-family:trebuchet ms;font-size:small;" ><span style="">i, the square root of -1 the fundamental complex number. Working out the square-root of i;</span></span><br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2M2GKVRqilW8eKI-rmq0Go5pzU-xP4tK8XE8KrqCQVVUNjOfOavaa-JCCWoEo9uL9CrUSTP0QLUb28JT2j-WXgLfildTvsUvAtuVIWlLMQv90GzKsYXlr74Mb9CaVGWPjAVmYMp43hpI/s1600-h/untitled78990.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2M2GKVRqilW8eKI-rmq0Go5pzU-xP4tK8XE8KrqCQVVUNjOfOavaa-JCCWoEo9uL9CrUSTP0QLUb28JT2j-WXgLfildTvsUvAtuVIWlLMQv90GzKsYXlr74Mb9CaVGWPjAVmYMp43hpI/s400/untitled78990.bmp" border="0" /></a><br /></div><span style="font-weight: bold;font-family:trebuchet ms;" >ON MATLAB</span><br /><br />Trying it on Matlab<br /><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLztOxU76X7_HivV4HtbBckIrzcQNt6W_hhoI7fP72ze80y-AsMUbMDElGvdSjFVzTFYcvZ0MNVr1iSn2Thv5C-7h_coZM6eZrp-HAxwoz3OaQi2x0H8DnY_ba6A0DHIVGlXiOqQkYh1c/s1600-h/dfr.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLztOxU76X7_HivV4HtbBckIrzcQNt6W_hhoI7fP72ze80y-AsMUbMDElGvdSjFVzTFYcvZ0MNVr1iSn2Thv5C-7h_coZM6eZrp-HAxwoz3OaQi2x0H8DnY_ba6A0DHIVGlXiOqQkYh1c/s320/dfr.bmp" border="0" /></a><br /></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 1. Matlab 1</span></span><br /></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" > </span></span><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4895jvVe6_8aHHhMjC6Cimq8utyZqyVQwTOwnK2A74msfg8tsuDO-U4f04TKPg-oWJToNfij9ORu_jaIwx4o83ag_ABEuav35BvNQ2EH_GFyv1w0reQSMW2O3hnDgF98RQDFPe9EGZbc/s1600-h/fgt.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4895jvVe6_8aHHhMjC6Cimq8utyZqyVQwTOwnK2A74msfg8tsuDO-U4f04TKPg-oWJToNfij9ORu_jaIwx4o83ag_ABEuav35BvNQ2EH_GFyv1w0reQSMW2O3hnDgF98RQDFPe9EGZbc/s320/fgt.bmp" border="0" /></a><br /></div><br /><div style="text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 2. Matlab 2</span></span><br /></div><div style="text-align: center;"><br /></div><div style="text-align: left;"><span style=";font-family:trebuchet ms;font-size:x-small;" ><span style=""><span style="font-size:small;">Matlab gives very precise result both by 'power of 0.5' and 'sqrt function'. </span></span></span><br /></div><div style="text-align: left;"><br /></div><div style="text-align: left;"><span style=";font-family:trebuchet ms;font-size:x-small;" ><span style=""><b><span style="font-size:small;">USING CMATH</span></b></span></span><br /><span style="font-size:x-small;"><span style=";font-family:Times,";" ><b><span style=";font-family:";font-size:small;" > </span></b></span></span><br /></div><div style="text-align: left;"><span style=";font-family:trebuchet ms;font-size:x-small;" ><span style=""><span style="font-size:small;">Using <a href="http://docs.python.org/library/cmath.html">cmath</a> module in Python;</span></span></span><br /></div><div style="text-align: left;"><br /></div><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTYxLKx35X7VjT4PE6Kwnc4-7EJ_ZAXIVzjaRSRBTG-SnxXXWJuNYxg_Trg6oc6vvquzeME6GTYAR4ICQgnt2QgCLDnZfZl-fIzcv2bE2eezEuA28PssxdCLHY-r6Qb-JdfrmEoDunpRc/s1600-h/666664444.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTYxLKx35X7VjT4PE6Kwnc4-7EJ_ZAXIVzjaRSRBTG-SnxXXWJuNYxg_Trg6oc6vvquzeME6GTYAR4ICQgnt2QgCLDnZfZl-fIzcv2bE2eezEuA28PssxdCLHY-r6Qb-JdfrmEoDunpRc/s320/666664444.bmp" border="0" /></a><span style="font-size:x-small;"><span style=";font-family:Times,";" ><span style=";font-family:";font-size:small;" > </span> </span></span><br /><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 3. cmath 1<br /></span></span></div><div style="text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXVfP5BuwzlL-uGdEnbjwMk199BiipFKj51fOLdPjcG-mokVzF1U1ulkECFDmLFAh3LoZ3771Sf8Cdy3MZS2DwtwgVNN2Ed7ifRGqV3oVFpJb3gM9hbJWM0g0OUhTTDIZGbqVRI88IG0E/s1600-h/rget666.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXVfP5BuwzlL-uGdEnbjwMk199BiipFKj51fOLdPjcG-mokVzF1U1ulkECFDmLFAh3LoZ3771Sf8Cdy3MZS2DwtwgVNN2Ed7ifRGqV3oVFpJb3gM9hbJWM0g0OUhTTDIZGbqVRI88IG0E/s320/rget666.bmp" border="0" /></a><br /></div><div style="text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 4. cmath 2</span></span><br /></div><div style="text-align: center; font-family: trebuchet ms;"><br /></div><div style="text-align: justify;font-family:courier new;"><span style=";font-family:trebuchet ms;font-size:x-small;" ><span style=""><span style="font-size:small;"><span style="">cmath also gives wonderful results, however it is worth noting that the real and complex parts are different in the last 2 digits ( 0.707106781186547<b>57</b> in the real part while 0.707106781186547<b>46</b> in the <span style="font-size:100%;">complex </span>part); which <b>should not be so</b> as they both represent the same number ! </span></span></span></span><br /><br /><span style="font-weight: bold;font-family:trebuchet ms;" >USING SCIPY</span><br /><span style=";font-family:trebuchet ms;font-size:100%;" ><br /><span style="font-family:trebuchet ms;">Using </span><a style="font-family: trebuchet ms;" href="http://www.scipy.org/">Scipy</a><span style="font-family:trebuchet ms;">, scientific and numerical module in python</span></span><br /></div><div style="text-align: justify;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLN5jkthWe4YQytm3wS4Tfhw0Q3OZgzlV_HfEBm2jMMV4zEsl8YqPjqDZ5Z7KP9gxFfBRCTfIVxflEEDNrjY5KwQtD6LPYUjDm_AVmNRy3JhiL-w7dMZL8qczgajotoLqbrguA8Hz0NJA/s1600-h/agagagattty.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLN5jkthWe4YQytm3wS4Tfhw0Q3OZgzlV_HfEBm2jMMV4zEsl8YqPjqDZ5Z7KP9gxFfBRCTfIVxflEEDNrjY5KwQtD6LPYUjDm_AVmNRy3JhiL-w7dMZL8qczgajotoLqbrguA8Hz0NJA/s320/agagagattty.bmp" border="0" /></a><br /></div><div style="text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 5. Using Scipy</span></span><br /></div><div style="text-align: center;"><br /></div><div style=";font-family:";"><span style=";font-family:trebuchet ms;font-size:small;" >Similar results to that of cmath.</span><br /></div><div face=""" style="font-family: trebuchet ms;"><br /></div><div style=";font-family:";"><span style=";font-family:trebuchet ms;font-size:small;" ><b>SQUARING THE ROOT !</b></span><br /></div><div style=";font-family:";"><br /></div><div face=""" style=""><span style=";font-family:trebuchet ms;font-size:small;" >Squaring the square root often confirms to the accuracy and resolution of the software.</span><br /></div><div style="font-family: "Trebuchet MS",sans-serif; text-align: left;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT7zVllJ3JhQxS5y3FI_xAEVbvVBPRWguFoI1hz86ljWyfWBYxap1oTHUDfL7ZjvGqHn97YfDgsibCivs8jsQILghdppek47X-anfTnr1O08v2ZU8-amSYMyBocj_k5ga_1wtqEoUO0B8/s1600-h/untitledbababababa.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT7zVllJ3JhQxS5y3FI_xAEVbvVBPRWguFoI1hz86ljWyfWBYxap1oTHUDfL7ZjvGqHn97YfDgsibCivs8jsQILghdppek47X-anfTnr1O08v2ZU8-amSYMyBocj_k5ga_1wtqEoUO0B8/s320/untitledbababababa.bmp" border="0" /></a><br /></div><div style="text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 6. Squaring the root in Matlab</span></span><br /></div><div style="text-align: center;"><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir3ua8BWMqc2zWlD39xaYpb6BCXjJL50brWR_jJcm0MjeVmYHmKtfCgXNh1pQDPqs1B0b1xWBiLonzno1-umN91WJe1H6Hd2O2aV5S6bV3RaiFhxsZWtKHuFBGt24uGEXp2Fftwgq-yTM/s1600-h/w.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir3ua8BWMqc2zWlD39xaYpb6BCXjJL50brWR_jJcm0MjeVmYHmKtfCgXNh1pQDPqs1B0b1xWBiLonzno1-umN91WJe1H6Hd2O2aV5S6bV3RaiFhxsZWtKHuFBGt24uGEXp2Fftwgq-yTM/s320/w.bmp" border="0" /></a><br /></div><div style="text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 7. Squaring the root in cmath</span></span><br /></div><div style="text-align: center;"><br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDdXKD00JcLQw_PtsWD_goCNa_zQ2xgo3yLFi1jSo1W5jsEjwmuEejWHmTGZeEiD36FTDYbiWLzZ-uA4PbBP5J6RvR5oZdcmQcT09qoDy995BvQBa0yrnhCIslpmB6r8l3oDcFCWRcjHI/s1600-h/w2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDdXKD00JcLQw_PtsWD_goCNa_zQ2xgo3yLFi1jSo1W5jsEjwmuEejWHmTGZeEiD36FTDYbiWLzZ-uA4PbBP5J6RvR5oZdcmQcT09qoDy995BvQBa0yrnhCIslpmB6r8l3oDcFCWRcjHI/s320/w2.bmp" border="0" /></a><br /></div></div><div style="text-align: center;"><span style="font-size:x-small;"><span style=";font-family:Times,";" > </span></span><span style="font-size:x-small;"><span style=";font-family:Times,";" >Fig 8. Squaring the root in scipy</span></span><br /></div><div style="text-align: center; font-family: trebuchet ms;"><br /></div><div style="text-align: left;font-family:trebuchet ms;"><span style="font-size:x-small;"><span style=""><span style="font-size:small;"><b>SOME OBSERVATIONS </b></span></span></span><br /></div><div style="text-align: left; font-family: trebuchet ms;"><br /></div><div style="text-align: justify;font-family:trebuchet ms;"><span style="font-size:x-small;"><span style=""><span style="font-size:small;">Matlab on squaring the root, gives precise results </span></span></span><br /><br /><span style="font-size:x-small;"><span style=""><span style="font-size:small;">cmath and scipy on squaring the root gives precise results for the complex part but odd results for the real part (2.2204460492503131e-16 for scipy and -2.2204460492503131e-16 for cmath).</span></span></span><br /></div><div style="text-align: justify;font-family:trebuchet ms;"><br /><span style="font-size:x-small;"><span style=""><span style="font-size:small;">Using (1j)**0.5 and sqrt(1j) in scipy yields different results in real parts </span></span></span><span style="font-size:x-small;"><span style=""><span style="font-size:small;">(2.2204460492503131e-16 for </span></span></span><span style="font-size:x-small;"><span style=""><span style="font-size:small;">(1j)**0.5</span></span></span><span style="font-size:x-small;"><span style=""><span style="font-size:small;"> and -2.2204460492503131e-16 for </span></span></span><span style="font-size:x-small;"><span style=""><span style="font-size:small;">sqrt(1j)</span></span></span><span style="font-size:x-small;"><span style=""><span style="font-size:small;">).<br /></span></span></span><br /></div><div style="text-align: left; font-family: trebuchet ms;"><br /></div><div style="text-align: justify;font-family:trebuchet ms;"><span style="font-size:x-small;"><span style=""><span style=";font-family:trebuchet ms;font-size:small;" >For developing scipy there should be a sense of consistency with cmath and the resolution (digits in the answer) should be controlled at the discretion of the user( It really looks sleek in Matlab). Further it looks odd and conveys a sense of inconsistency if the complex part tallies completely with the expected result while the real part has an inconsistency.</span></span></span></div><div style="text-align: center;"><br /></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com4tag:blogger.com,1999:blog-4917164306143703214.post-64010930746064592612009-10-11T04:16:00.023+05:302010-03-04T15:52:30.212+05:30EULER'S GAMMA !<span style="font-weight: bold;font-family:trebuchet ms;" >EULER'S GAMMA</span><br /><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">Once again ! .... we meet <a href="http://en.wikipedia.org/wiki/Euler">Leonhard Euler</a> ... a constant named after him. <a href="http://mathworld.wolfram.com/Euler-MascheroniConstant.html">Euler-Mascheroni constant</a> which runs as .... 0.57721 … called 'gamma' ,denoted by the Greek alphabet 'gamma' and is one of the important constants of mathematics.</span><br /></div><span style="font-family:trebuchet ms;"><br />From an abinitio, 'gamma' is defined as;<br /><br /></span><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhveU7sluHSQ0rIvzbb2KoOxuB5rRj0l4sTFxRSmpiyTiPquIOX5W68HZivmrB-2CpMH9FCmRk814fvZzME5PtQL8SjwiX_Zk8ZO2mrVo7zUmgG9Z1ZW433sLkc5aqDe6PxvekunMTSDaE/s1600-h/untitled2.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" id="BLOGGER_PHOTO_ID_5391108400712498946" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhveU7sluHSQ0rIvzbb2KoOxuB5rRj0l4sTFxRSmpiyTiPquIOX5W68HZivmrB-2CpMH9FCmRk814fvZzME5PtQL8SjwiX_Zk8ZO2mrVo7zUmgG9Z1ZW433sLkc5aqDe6PxvekunMTSDaE/s200/untitled2.bmp" style="margin: 0px auto 10px; cursor: pointer; display: block; height: 55px; text-align: center; width: 200px;" border="0" /></a><span style="font-family:trebuchet ms;"><span style="font-weight: bold;">IN SCIPY</span><br /><br />Trying it out in scipy</span><span style=";font-family:";" > yields a very accurate gamma.....</span><br /><br /><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinvO8v6CL_Kbckz5AALterisGAK-1xkP14rAAr1SQepS2y03YgFszkLg_jEbfhLzYcRYK7t6umcBccjJvRHvWdSrwvtrpg7djrq5pePwasf-Xg8aDV6dEcrGGVD598JQszD6Tck6JsVRc/s1600-h/untitled34.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" id="BLOGGER_PHOTO_ID_5391110279751589026" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinvO8v6CL_Kbckz5AALterisGAK-1xkP14rAAr1SQepS2y03YgFszkLg_jEbfhLzYcRYK7t6umcBccjJvRHvWdSrwvtrpg7djrq5pePwasf-Xg8aDV6dEcrGGVD598JQszD6Tck6JsVRc/s400/untitled34.bmp" style="margin: 0px auto 10px; cursor: pointer; display: block; height: 133px; text-align: center; width: 400px;" border="0" /></a><span style="font-size:85%;"><span style="font-family:times new roman;">Fig 1. gamma in scipy</span></span><br /></div><div style="text-align: left;"><br /><span style="font-family:trebuchet ms;">Should gamma be build into scipy as pi and e ?</span><br /></div><br /><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjWRrYu0AfRM8CuCbW4iRGuIysLLJsPCyKvBR1wp3BsF6bEDw2l4CVu9vlXfhCUNWqrsCsOEIec_gT5Hl-R-qwvtCvabE4R2OjVPKisVcs8ViRQdIe3D0YlNlLVTTzCnxncOf7QhfHd1M/s1600-h/untitled44.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" id="BLOGGER_PHOTO_ID_5391111976069051906" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjWRrYu0AfRM8CuCbW4iRGuIysLLJsPCyKvBR1wp3BsF6bEDw2l4CVu9vlXfhCUNWqrsCsOEIec_gT5Hl-R-qwvtCvabE4R2OjVPKisVcs8ViRQdIe3D0YlNlLVTTzCnxncOf7QhfHd1M/s400/untitled44.bmp" style="margin: 0px auto 10px; cursor: pointer; display: block; height: 113px; text-align: center; width: 230px;" border="0" /></a><span style="font-size:85%;"><span style="font-family:times new roman;">Fig 2. pi and e in scipy</span></span><br /><br /><div style="text-align: left;"><span style="font-weight: bold;font-family:trebuchet ms;" >IN MATLAB</span><br /><br /><span style="font-family:trebuchet ms;">Trying it in MATLAB</span><br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUDC3vYV-ezNm6-f6UgZyR7GiB0ycM13XBer5LQ-L7t4LgUaVllen1AV2-g3zT7LhPmow93kCFV2m1MzqkKIMg5MiGZyyKxzfmKbMmUc8qguvmg2l2LB50NbBu3b3n8RUhrl4nk7Pr_pM/s1600/untitled.bmp"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 289px; height: 224px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUDC3vYV-ezNm6-f6UgZyR7GiB0ycM13XBer5LQ-L7t4LgUaVllen1AV2-g3zT7LhPmow93kCFV2m1MzqkKIMg5MiGZyyKxzfmKbMmUc8qguvmg2l2LB50NbBu3b3n8RUhrl4nk7Pr_pM/s400/untitled.bmp" alt="" id="BLOGGER_PHOTO_ID_5409097725147419314" border="0" /></a><br /><div style="text-align: justify;"><span style="font-family:trebuchet ms;">MATLAB recognises the integral as a special integral ! ...... with a <a href="http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/vpa.html">vpa</a>, the value is obtained.</span><br /><br /><span style="font-family:trebuchet ms;">Gamma and other mathematical constants should be build into Scipy and Scipy should be intelligent enough to identify these expressions and integrals.</span><br /></div><div style="text-align: left;"><br /></div></div><br /><a href="http://www.scipy.org/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" id="BLOGGER_PHOTO_ID_5391115967544091026" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2woq632C_2u1blOjF0h1xIFXxiEXmYfYMVelAsAKEq2z8NpGASVmWHz9R6UKiiNVKS5rc-tOJt0igEsrKZjSq0rWsmNpzSKI1xr8bsjr9JsRRXeri3cupYQDrGy4tLblufHBub2axYOc/s400/Scipylogo.png" style="margin: 0pt 10px 10px 0pt; cursor: pointer; float: left; height: 62px; width: 366px;" border="0" /></a><br /><div style="text-align: left;"><span style="font-weight: bold;font-family:trebuchet ms;" ><br /><br /><br /></span><br /><span style="font-weight: bold;font-family:trebuchet ms;" >REFERENCES</span><br /><span style="font-family:trebuchet ms;">(1) <a href="http://www.amazon.com/Schaums-Outline-Complex-Variables-2ed/dp/0071615695/ref=sr_1_1?ie=UTF8&s=books&qid=1255216184&sr=8-1">Murray Spiegel</a></span><br /><br /></div></div>Arkapravo Bhaumikhttp://www.blogger.com/profile/12257489973579585325noreply@blogger.com0