Popular recipes by gian paolo ciceri http://code.activestate.com/recipes/users/631476/2007-04-01T14:05:47-07:00ActiveState Code Recipesstock prices historical data bulk download from internet (Python) 2007-04-01T14:05:47-07:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/511444-stock-prices-historical-data-bulk-download-from-in/ <p style="color: grey"> Python recipe 511444 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/network/">network</a>). </p> <p>Courtesy of Yahoo finance, it is possible to bulk download historical prices data. This script, borrowed from pycurl retriever-multi.py example, fetch series for several tickers at a time. It uses urllib to fetch web data, so it should work with a plain vanilla python distro.</p> serving dynamically-generated PDF files via XML/RPC (Python) 2005-05-05T23:41:15-07:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/413404-serving-dynamically-generated-pdf-files-via-xmlrpc/ <p style="color: grey"> Python recipe 413404 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/distributed/">distributed</a>). </p> <p>It's only a matter to put together Reportlab to generate a pdf file on the fly and Cherrypy xmlrpc filter to serve it as an XML/RPC binary object (base64-encoded).</p> A function to check if a number is prime (Python) 2005-04-21T05:44:25-07:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/410662-a-function-to-check-if-a-number-is-prime/ <p style="color: grey"> Python recipe 410662 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Since the excellent &lt;a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/366178"&gt;fast prime number list generator&lt;/a&gt; recipe, it's simple to implement a function to check if its input it's a prime number.</p> A function to check if a number is a power of a prime (Python) 2005-04-21T06:26:35-07:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/410663-a-function-to-check-if-a-number-is-a-power-of-a-pr/ <p style="color: grey"> Python recipe 410663 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>primepow(aNumber) finds the prime number P and power N of aNumber such that aNumber = P^N.</p> <p>The implementation is heavily borrowed from Art Owen &lt;a href="http://www.csit.fsu.edu/~burkardt/cpp_src/oa/oa.html"&gt;Orthogonal Arrays Library&lt;/a&gt;. It requires the &lt;a href="http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410662"&gt;isprime()&lt;/a&gt; function.</p> Exposing a COM component as a web service via XMLRPC with CherryPy (windows-specific) (Python) 2004-11-23T10:36:18-08:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/347209-exposing-a-com-component-as-a-web-service-via-xmlr/ <p style="color: grey"> Python recipe 347209 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/distributed/">distributed</a>). Revision 5. </p> <p>This recipe shows how to build an xmlrpc multithread server that exposes a COM component as a web service.</p> Exposing a Pyro remote object as a web service via XMLRPC with CherryPy (Python) 2004-11-23T02:50:16-08:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/347210-exposing-a-pyro-remote-object-as-a-web-service-via/ <p style="color: grey"> Python recipe 347210 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/distributed/">distributed</a>). </p> <p>This recipe shows how to build an xmlrpc multithread server that exposes a Pyro remote object as a web service. Be careful to the remote object state: two different ways (a global and a thread local) are shown.</p> CRC64 - Calculate the cyclic redundancy check. (Python) 2004-01-10T03:26:38-08:00gian paolo cicerihttp://code.activestate.com/recipes/users/631476/http://code.activestate.com/recipes/259177-crc64-calculate-the-cyclic-redundancy-check/ <p style="color: grey"> Python recipe 259177 by <a href="/recipes/users/631476/">gian paolo ciceri</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>The algorithm to compute the CRC is described in the ISO 3309 standard. The generator polynomial is x64 + x4 + x3 + x + 1. Reference: W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery, "Numerical recipes in C", 2nd ed., Cambridge University Press. Pages 896ff.</p>