Popular recipes by Sachin Joglekar http://code.activestate.com/recipes/users/4181845/2012-05-15T19:49:34-07:00ActiveState Code RecipesDeterminant of matrix of any order (Python)
2012-04-24T10:49:00-07:00Sachin Joglekarhttp://code.activestate.com/recipes/users/4181845/http://code.activestate.com/recipes/578108-determinant-of-matrix-of-any-order/
<p style="color: grey">
Python
recipe 578108
by <a href="/recipes/users/4181845/">Sachin Joglekar</a>
(<a href="/recipes/tags/algebra/">algebra</a>, <a href="/recipes/tags/determinant/">determinant</a>, <a href="/recipes/tags/matrix/">matrix</a>, <a href="/recipes/tags/order/">order</a>).
</p>
<p>A small snipet of code to find the determinant of a mtrix of any order.Input must be a list like [[1,2,3],[4,5,6],[7,8,9]] (for a matrix of order 3). Works fine.</p>
Small random number generator (C)
2012-05-15T19:49:34-07:00Sachin Joglekarhttp://code.activestate.com/recipes/users/4181845/http://code.activestate.com/recipes/578134-small-random-number-generator/
<p style="color: grey">
C
recipe 578134
by <a href="/recipes/users/4181845/">Sachin Joglekar</a>
(<a href="/recipes/tags/generate/">generate</a>, <a href="/recipes/tags/malloc/">malloc</a>, <a href="/recipes/tags/random/">random</a>, <a href="/recipes/tags/stdlib/">stdlib</a>).
</p>
<p>Generates random numbers in a given range using malloc function in stdlib.h. Based on the observation that the memory address allocated during malloc is usually 'random' (for humans). takes in two arguments- start of range, end of range.</p>
Silmultaneous linear equation solver(any order) (Python)
2012-04-24T12:29:30-07:00Sachin Joglekarhttp://code.activestate.com/recipes/users/4181845/http://code.activestate.com/recipes/578109-silmultaneous-linear-equation-solverany-order/
<p style="color: grey">
Python
recipe 578109
by <a href="/recipes/users/4181845/">Sachin Joglekar</a>
(<a href="/recipes/tags/algebra/">algebra</a>, <a href="/recipes/tags/crammer/">crammer</a>, <a href="/recipes/tags/determinants/">determinants</a>, <a href="/recipes/tags/equation/">equation</a>, <a href="/recipes/tags/linear/">linear</a>, <a href="/recipes/tags/simultaneous/">simultaneous</a>).
</p>
<p>Solves simultaneous linear equations of any order using Crammer's rule. Required input is two lists..one for coefficients, and other for constants
eg. 2x+3y=8
x+4y=6 will be written as
simul([[2,3],[1,4]],[8,6])</p>
Finding complete loops in a map of connected nodes (Python)
2012-04-24T18:47:21-07:00Sachin Joglekarhttp://code.activestate.com/recipes/users/4181845/http://code.activestate.com/recipes/578110-finding-complete-loops-in-a-map-of-connected-nodes/
<p style="color: grey">
Python
recipe 578110
by <a href="/recipes/users/4181845/">Sachin Joglekar</a>
(<a href="/recipes/tags/circuit/">circuit</a>, <a href="/recipes/tags/connection/">connection</a>, <a href="/recipes/tags/loops/">loops</a>).
</p>
<p>This module finds loops in a given map.Input is a dictionary like</p>
<p>d={1:[2,4,5,6],2:[1,3],3:[2,4,5,6],4:[1,3,5],5:[1,3,4],6:[1,3]}</p>
<p>this means node 1 is connected to nodes 2,4,5 and 6 and so on..</p>
<p>Output is a list of complete loops.
for above examples,output is</p>
<p>[[1, 4, 5, 1], [3, 4, 5, 3], [1, 2, 3, 4, 1], [1, 2, 3, 5, 1], [1, 2, 3, 6, 1], [1, 4, 3, 5, 1], [1, 4, 3, 6, 1], [1, 5, 3, 6, 1], [1, 2, 3, 4, 5, 1], [1, 4, 5, 3, 6, 1]]</p>