Popular recipes tagged "meta:loc=258"http://code.activestate.com/recipes/tags/meta:loc=258/2012-02-07T16:55:01-08:00ActiveState Code RecipesOrdered Dictionary for Py2.4 (Python) 2011-04-24T03:20:45-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/576693-ordered-dictionary-for-py24/ <p style="color: grey"> Python recipe 576693 by <a href="/recipes/users/178123/">Raymond Hettinger</a> (<a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/linked_list/">linked_list</a>, <a href="/recipes/tags/ordered/">ordered</a>). Revision 9. </p> <p>Drop-in substitute for Py2.7's new collections.OrderedDict. The recipe has big-oh performance that matches regular dictionaries (amortized O(1) insertion/deletion/lookup and O(n) iteration/repr/copy/equality_testing).</p> Wordze.com API bindings (Python) 2010-01-21T21:24:39-08:00Sergei Lebedevhttp://code.activestate.com/recipes/users/4172845/http://code.activestate.com/recipes/577018-wordzecom-api-bindings/ <p style="color: grey"> Python recipe 577018 by <a href="/recipes/users/4172845/">Sergei Lebedev</a> (<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/bindings/">bindings</a>, <a href="/recipes/tags/wordze/">wordze</a>, <a href="/recipes/tags/wordze_com/">wordze_com</a>). Revision 3. </p> <p>Just in case anyone would need the bindings, here's a very basic implementation. For some reasons, <a href="http://wordze.com" rel="nofollow">wordze.com</a> has very strict API usage limitations, so to use this efficiently, you'll probably need to cache every request-response. </p> <p>Any comments and/or corrections are welcome. :) </p> RSA (Python) 2012-02-07T16:55:01-08:00Collin Stockshttp://code.activestate.com/recipes/users/4149235/http://code.activestate.com/recipes/572196-rsa/ <p style="color: grey"> Python recipe 572196 by <a href="/recipes/users/4149235/">Collin Stocks</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). Revision 2. </p> <p>This is my Python implementation of the RSA algorithm, including functions to generate prime numbers from a password string. It also includes a file-like object for automating encryption.</p> <p>I wrote this code a long time ago. My coding style has improved since then. I would never write a program like this nowadays. This was written as a demo, and should be treated as such.</p> War Game (Version 1) (Python) 2005-10-02T17:33:38-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/440621-war-game-version-1/ <p style="color: grey"> Python recipe 440621 by <a href="/recipes/users/2608421/">Stephen Chappell</a> (<a href="/recipes/tags/programs/">programs</a>). </p> <p>This is the first version of a game that I wrote. If you have ever played a card game called "WAR," then you already should be familiar with one version of this game. Well, this is my first interpretation of the game. One little note about winning the game -- control the "nines." That is how you will win. :)</p>