Popular recipes by Deepak http://code.activestate.com/recipes/users/4183429/2013-03-07T08:37:32-08:00ActiveState Code RecipesLinear equations solver in 3 lines (Python) 2013-03-07T07:33:09-08:00Deepakhttp://code.activestate.com/recipes/users/4183429/http://code.activestate.com/recipes/578481-linear-equations-solver-in-3-lines/ <p style="color: grey"> Python recipe 578481 by <a href="/recipes/users/4183429/">Deepak</a> (<a href="/recipes/tags/programs/">programs</a>). </p> <p>Just a little bit of hack: a linear equations solver using eval and built-in complex numbers:</p> <pre class="prettyprint"><code>&gt;&gt;&gt; solve("x - 2*x + 5*x - 46*(235-24) = x + 2") 3236.0 </code></pre> First Class Enums in Python (Python) 2013-03-07T08:23:46-08:00Deepakhttp://code.activestate.com/recipes/users/4183429/http://code.activestate.com/recipes/578482-first-class-enums-in-python/ <p style="color: grey"> Python recipe 578482 by <a href="/recipes/users/4183429/">Deepak</a> (<a href="/recipes/tags/programs/">programs</a>). </p> <p>True immutable symbolic enumeration with qualified value access.</p> Caller and Callee (Python) 2013-03-07T08:37:32-08:00Deepakhttp://code.activestate.com/recipes/users/4183429/http://code.activestate.com/recipes/578483-caller-and-callee/ <p style="color: grey"> Python recipe 578483 by <a href="/recipes/users/4183429/">Deepak</a> (<a href="/recipes/tags/callee/">callee</a>, <a href="/recipes/tags/caller/">caller</a>, <a href="/recipes/tags/debugging/">debugging</a>). </p> <p>A recipe to find out which function is the caller of the current function. </p> <p>The <code>caller</code> function can be helpful for debugging &mdash; if there is no real debugger available. In terms of software engineering (loose coupling etc.) this should not be used in production code though.</p> Python single instance (cross-platform) (Python) 2013-02-28T04:14:08-08:00Deepakhttp://code.activestate.com/recipes/users/4183429/http://code.activestate.com/recipes/578476-python-single-instance-cross-platform/ <p style="color: grey"> Python recipe 578476 by <a href="/recipes/users/4183429/">Deepak</a> (<a href="/recipes/tags/application/">application</a>, <a href="/recipes/tags/instance/">instance</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/single/">single</a>, <a href="/recipes/tags/singleton/">singleton</a>). </p> <p>Yet another way to get a single instance application. This recipe uses file locking only.</p> One-liner to show the caller of the current function. (Python) 2013-02-28T04:11:18-08:00Deepakhttp://code.activestate.com/recipes/users/4183429/http://code.activestate.com/recipes/578475-one-liner-to-show-the-caller-of-the-current-functi/ <p style="color: grey"> Python recipe 578475 by <a href="/recipes/users/4183429/">Deepak</a> (<a href="/recipes/tags/_getframe/">_getframe</a>). </p> <p>This is a quick one-liner to produce the filename and line number of the caller of the current function.</p>