Popular recipes by Anand B Pillai http://code.activestate.com/recipes/users/4169530/2012-05-14T13:34:31-07:00ActiveState Code RecipesA simple Matrix class (Python) 2012-05-14T13:34:31-07:00Anand B Pillaihttp://code.activestate.com/recipes/users/4169530/http://code.activestate.com/recipes/578131-a-simple-matrix-class/ <p style="color: grey"> Python recipe 578131 by <a href="/recipes/users/4169530/">Anand B Pillai</a> (<a href="/recipes/tags/algebra/">algebra</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>, <a href="/recipes/tags/matrix/">matrix</a>). Revision 3. </p> <p>A simple class in Python representing a Matrix with basic operations, operator overloading and class factory methods to make Matrices from different sources.</p> Solve simultaneous linear equations in two variables (Python) 2012-01-24T14:20:01-08:00Anand B Pillaihttp://code.activestate.com/recipes/users/4169530/http://code.activestate.com/recipes/578024-solve-simultaneous-linear-equations-in-two-variabl/ <p style="color: grey"> Python recipe 578024 by <a href="/recipes/users/4169530/">Anand B Pillai</a> (<a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/shortcuts/">shortcuts</a>, <a href="/recipes/tags/solver/">solver</a>). </p> <p>A function to solve simultaneous equations in two variables. </p> <pre class="prettyprint"><code>&gt;&gt;&gt; solve('3*x + 5*y = 29; 12*x - 3*y = 24') (3.0, 4.0) </code></pre> Bless Classes into Singletons (Python) 2011-09-21T05:34:52-07:00Anand B Pillaihttp://code.activestate.com/recipes/users/4169530/http://code.activestate.com/recipes/577875-bless-classes-into-singletons/ <p style="color: grey"> Python recipe 577875 by <a href="/recipes/users/4169530/">Anand B Pillai</a> (<a href="/recipes/tags/metaclasses/">metaclasses</a>, <a href="/recipes/tags/patterns/">patterns</a>, <a href="/recipes/tags/singleton/">singleton</a>). </p> <p>A pattern using metaclasses for "blessing" classes into Singletons.</p> Ask a question with Yahoo! Answers and YQL (Python) 2010-11-02T12:55:01-07:00Anand B Pillaihttp://code.activestate.com/recipes/users/4169530/http://code.activestate.com/recipes/577449-ask-a-question-with-yahoo-answers-and-yql/ <p style="color: grey"> Python recipe 577449 by <a href="/recipes/users/4169530/">Anand B Pillai</a> (<a href="/recipes/tags/answers/">answers</a>, <a href="/recipes/tags/query/">query</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/yahoo/">yahoo</a>, <a href="/recipes/tags/yql/">yql</a>). </p> <p>The web has a lot of resources where on can get answers to questions such as wiki Answers and Yahoo! answers. Of this Y! answers provide a quick and easy way to query it by using Yahoo's own query language, YQL. This recipe demonstrates using Yahoo! answers, YQL and Python to get an answer to your query on the command line.</p>