Search
New Code
Free Spire.PDF for Java 2.2.2
CSFreeDB 1.0
Udemy Clone Script | Online Course Learning Script 2.00
Crowdfunding donate 1.019
GoferEats - UberEats Clone 1.0
CADViewX: ActiveX for DWG, DXF, PLT, CGM 14
CADEditorX: ActiveX DWG/DXF, STP, PLT 14
Database Workbench Pro 5.7.2
ASP. NET C# PDF Software 2020.3.2
C# HTML to PDF 2020.3.2
dbForge Schema Compare for MySQL 5.0.191
dotConnect for Dynamics CRM 1.9
dotConnect for MailChimp 1.9
dbForge Query Builder for MySQL 4.5.254
The C# Excel Library 2020.5
Top Code
phpEnter 5.1.
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
Code Listing by Ori Peleg

Code 1-10 of 11   Pages: Go to  1  2  Next >>  page  






Overriding __setattr__ in classes requires care when setting attributes yourself. Here's an idea for safely setting attributes in __init__.

Update: this idea doesn't work. See Mike Foord's recipe for one that does:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/389916



When comparing text generated on different platforms, the newlines are different. This recipe normalizes any string to use unix-style newlines.

This code is used in the TestOOB unit testing framework (http://testoob.sourceforge.net).



Adding new format specifiers to the logging module.
In this example, it's for the user name and the name of the function that logged the message.



A 'fields' class is a class that acts like a struct full of fields, e.g.:

<pre>
class Titles:
def __init__(self, name): self.name = name
def dr(self): return "Dr. " + self.name
def mr(self):...



expand_tabs.py - Similar to Unix's expand(1) command, but can edit the files in-place.



Convert strings to floats in the range [0, 1), using a hash function



Create an proxy that forwards methods to a group of observers



Extremely simple/straightforward implementation.

Posted mainly to receive comments on alternative implementations.



Great for deciding automatically whether to use colors.

Based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/475116



Note: This recipe is superceded by TestOOB, a Python unit testing framework that extends unittest and provides many new features - including running tests in threads! http://testoob.sourceforge.net

Trying to extend unittest to provide...