Popular recipes tagged "reverse"http://code.activestate.com/recipes/tags/reverse/2014-03-29T12:43:26-07:00ActiveState Code RecipesReversing string (JavaScript)
2013-02-18T09:27:33-08:00greg zakharovhttp://code.activestate.com/recipes/users/4184115/http://code.activestate.com/recipes/578464-reversing-string/
<p style="color: grey">
JavaScript
recipe 578464
by <a href="/recipes/users/4184115/">greg zakharov</a>
(<a href="/recipes/tags/reverse/">reverse</a>, <a href="/recipes/tags/string/">string</a>).
</p>
<p>Two ways reverse string.</p>
Simple reverse converter of unicode code points string (Python)
2009-09-22T20:02:32-07:00Ryanhttp://code.activestate.com/recipes/users/4171767/http://code.activestate.com/recipes/576909-simple-reverse-converter-of-unicode-code-points-st/
<p style="color: grey">
Python
recipe 576909
by <a href="/recipes/users/4171767/">Ryan</a>
(<a href="/recipes/tags/code/">code</a>, <a href="/recipes/tags/points/">points</a>, <a href="/recipes/tags/prefix/">prefix</a>, <a href="/recipes/tags/reverse/">reverse</a>, <a href="/recipes/tags/str/">str</a>, <a href="/recipes/tags/string/">string</a>, <a href="/recipes/tags/u/">u</a>, <a href="/recipes/tags/unicode/">unicode</a>).
Revision 4.
</p>
<p>It's a simple recipe to convert a str type string with pure unicode code point (e.g string = <strong>"\u5982\u679c\u7231"</strong> ) to an unicode type string.
Actually, this method has the same effect with <strong>'u'</strong> prefix. But differently, it allows you to pass a variable of code points string as well as a constant one.</p>
Reversed Ranges (Python)
2014-03-29T12:43:26-07:00Tal Einathttp://code.activestate.com/recipes/users/2892534/http://code.activestate.com/recipes/576801-reversed-ranges/
<p style="color: grey">
Python
recipe 576801
by <a href="/recipes/users/2892534/">Tal Einat</a>
(<a href="/recipes/tags/iteration/">iteration</a>, <a href="/recipes/tags/range/">range</a>, <a href="/recipes/tags/reverse/">reverse</a>).
Revision 16.
</p>
<p>A simple function for efficiently iterating over ranges in reverse.</p>
<p>This is equivalent to reversed(range(...)) but somewhat more efficient.</p>
Reverse the byte order of an unsigned 'int' or 'long' number in Python (Python)
2008-08-15T14:03:30-07:00Vishal Saprehttp://code.activestate.com/recipes/users/4166412/http://code.activestate.com/recipes/576421-reverse-the-byte-order-of-an-unsigned-int-or-long-/
<p style="color: grey">
Python
recipe 576421
by <a href="/recipes/users/4166412/">Vishal Sapre</a>
(<a href="/recipes/tags/byte_order/">byte_order</a>, <a href="/recipes/tags/byte_order_reversal/">byte_order_reversal</a>, <a href="/recipes/tags/reverse/">reverse</a>, <a href="/recipes/tags/swap_byte_order/">swap_byte_order</a>).
Revision 5.
</p>
<p>Given an unsigned number, of type 'int' or 'long', this function returns a corresponding number of the same type, with its byte order reversed.
So if input = 0xABCDEF, then output = 0xEFCDAB</p>