Popular recipes tagged "encode" but not "encryption"http://code.activestate.com/recipes/tags/encode-encryption/2013-10-24T11:31:44-07:00ActiveState Code Recipesdynamically changing encoder (for json) with metaclass (class factory) (Python) 2013-10-24T11:31:44-07:00-http://code.activestate.com/recipes/users/4188267/http://code.activestate.com/recipes/578696-dynamically-changing-encoder-for-json-with-metacla/ <p style="color: grey"> Python recipe 578696 by <a href="/recipes/users/4188267/">-</a> (<a href="/recipes/tags/class_factory/">class_factory</a>, <a href="/recipes/tags/encode/">encode</a>, <a href="/recipes/tags/json/">json</a>, <a href="/recipes/tags/metaclass/">metaclass</a>, <a href="/recipes/tags/metaclasses/">metaclasses</a>). </p> <p>The <em>json.dumps</em> need to be feed with some class (cls =someClass) but what if we want to change the class dynamically? This example can be done by declaring the <em>listOfClasses</em> in class level of course, but the idea is to be changeable. This can be done by the class factory function <em>encoderFacory</em></p> Perl URL encode and decode (Perl) 2010-11-02T17:52:46-07:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/577450-perl-url-encode-and-decode/ <p style="color: grey"> Perl recipe 577450 by <a href="/recipes/users/4173505/">Trent Mick</a> (<a href="/recipes/tags/decode/">decode</a>, <a href="/recipes/tags/encode/">encode</a>, <a href="/recipes/tags/url/">url</a>). </p> <p>URL encode and decode functions for Perl.</p> Rot13 Quine (Python) 2009-04-22T10:05:34-07:00Daniel Lepagehttp://code.activestate.com/recipes/users/4160089/http://code.activestate.com/recipes/576724-rot13-quine/ <p style="color: grey"> Python recipe 576724 by <a href="/recipes/users/4160089/">Daniel Lepage</a> (<a href="/recipes/tags/encode/">encode</a>, <a href="/recipes/tags/quine/">quine</a>). </p> <p>A Quine is a program that, when run, prints its own source code (without resorting to easy solutions like reading its code from the filesystem). The rot13 encoding maps every letter 13 places forwards in the alphabet (wrapping around the end and preserving case). Just for fun, I wrote a quine in the rot13 encoding.</p> safe print (Python) 2009-01-02T15:40:30-08:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/576602-safe-print/ <p style="color: grey"> Python recipe 576602 by <a href="/recipes/users/4173505/">Trent Mick</a> (<a href="/recipes/tags/encode/">encode</a>, <a href="/recipes/tags/safe/">safe</a>, <a href="/recipes/tags/unicode/">unicode</a>). </p> <p>A replacement for "print" that will safely handle unicode conversion.</p>