Popular recipes by AJ. Mayorga http://code.activestate.com/recipes/users/4173476/2010-06-03T19:16:43-07:00ActiveState Code RecipesPrime, Perfect and Fibonacci Number Widget Class (Python)
2010-05-19T17:02:28-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577229-prime-perfect-and-fibonacci-number-widget-class/
<p style="color: grey">
Python
recipe 577229
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/cryptography/">cryptography</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/prime/">prime</a>, <a href="/recipes/tags/primes/">primes</a>).
Revision 2.
</p>
<p>A class Ive had in my snippets for awhile that can generate prime, perfect and fibonacci sequences as well as check whether or not a supplied value is any of them.</p>
SimpleCryptSocketExt - SimpleCrypt Wrapper for Easy Socket, Client / Server Encryption (Python)
2010-05-07T15:33:06-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577212-simplecryptsocketext-simplecrypt-wrapper-for-easy-/
<p style="color: grey">
Python
recipe 577212
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/client_server/">client_server</a>, <a href="/recipes/tags/cryptography/">cryptography</a>, <a href="/recipes/tags/encryption/">encryption</a>, <a href="/recipes/tags/server/">server</a>, <a href="/recipes/tags/socket/">socket</a>).
Revision 5.
</p>
<p>Lightweight drop-in encryption wrapper for various Client/Server solutions supporting
protocols such as UDP, TCP, HTTP, HTTPS, FTP, RAW Sockets etc.</p>
PluginManager - Extending Project Functionality By Using Custom Modules/Plugins On The Fly. (Python)
2010-05-07T15:32:10-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577216-pluginmanager-extending-project-functionality-by-u/
<p style="color: grey">
Python
recipe 577216
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/extending/">extending</a>, <a href="/recipes/tags/extensible/">extensible</a>, <a href="/recipes/tags/modules/">modules</a>, <a href="/recipes/tags/plugin/">plugin</a>).
Revision 4.
</p>
<p>This demo shows how you can create and manage your own custom plugins for extending functionality in your Python projects. There are no safety wrappers in this demo for restricting plugins aside from that fact that plugins are run as an extention of a management class which is run in its own instance only receiving data passed to it by the RumModules method, that said security should ideally be applied to the ModuleAPI class, by restricting __builtins__ on eval calls and/or validating plugin content and parameters which can be done by extending the Prepaser Class. For a great recipe/demo of restricting eval call see <a href="http://code.activestate.com/recipes/496746" rel="nofollow">http://code.activestate.com/recipes/496746</a>. </p>
<p>That aside it was alot of fun to write and use. Enjoy</p>
<p>PS: you will need <a href="http://code.activestate.com/recipes/577144/" rel="nofollow">http://code.activestate.com/recipes/577144/</a> to import Xceptions</p>
Command Line Options and Args Hate'em? Me Too! (Python)
2010-06-03T19:16:43-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577238-command-line-options-and-args-hateem-me-too/
<p style="color: grey">
Python
recipe 577238
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/option/">option</a>, <a href="/recipes/tags/optionparser/">optionparser</a>, <a href="/recipes/tags/option_parsing/">option_parsing</a>).
Revision 5.
</p>
<p>I am all about trying to make development easier and reduce mundane tasks, especially
dealing with commandline args and getopt, OptParse, argparse sorry just not a fan. Argparse-cli
is really cool if you want low level control. I just got tired of writing tons of conditionals, labels, limited type handling, and having to do all of it over and over for every commandline project so help end the madness I wrote PyOpts. </p>
Simple Small Tweakable Encryption Solution -- SimpleCrypt (Python)
2010-04-30T21:00:26-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577174-simple-small-tweakable-encryption-solution-simplec/
<p style="color: grey">
Python
recipe 577174
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/crypt/">crypt</a>, <a href="/recipes/tags/cryptography/">cryptography</a>, <a href="/recipes/tags/encryption/">encryption</a>).
Revision 6.
</p>
<p>Encryption can sometimes be a nightmare, at least is my experience while Python has
some excellent resources for encryption I found myself a lot of times needing an
encryption solution that could port easily between VS C++, .NET, PHP, and Python
projects that would be simple to implement and not rely on large bloated
crypto libs.</p>
Marshalling Complex Data Types (Python)
2010-05-10T05:02:34-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577224-marshalling-complex-data-types/
<p style="color: grey">
Python
recipe 577224
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
.
</p>
<p>An Easy way to Marshal Data In Python By Sending Dictionaries of Python Data To And From Client/Server Solutions. Can Be Used In A Lot Of Ways in XmlRpc, HTTP/HTTPS Posts, RAW Sockets etc.</p>
Easy Exception, Error Handling and Debugging with Auto Logging (Python)
2010-04-06T20:40:05-07:00AJ. Mayorgahttp://code.activestate.com/recipes/users/4173476/http://code.activestate.com/recipes/577144-easy-exception-error-handling-and-debugging-with-a/
<p style="color: grey">
Python
recipe 577144
by <a href="/recipes/users/4173476/">AJ. Mayorga</a>
(<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/error_propagation/">error_propagation</a>, <a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/logging/">logging</a>).
Revision 5.
</p>
<p>Being new to Python and trying to chase where in my project exceptions were taking place always seems to take up a large amount of time. So I created this class that I now pretty use in all my projects to help me save time tracking exceptions and errors. its also has the ability to generate error logs or to output SQL query and data tuples for Database logging. Ive added sample code to give you an idea of how I normally use it. Hope this helps its saved me hours in tracking error/exception. Feed back would be great, mind you havent been Python all that long</p>