Search
New Code
Rentonn - Airbnb clone 1.0
VisualNEO for Windows 18.08.31.0
SentiVeillance SDK Trial 7.0.191272
dbForge SQL Complete 6.1
Uber for E-Scooters 1.0
ODBC Driver for MySQL 2.4
dbForge Schema Compare for MySQL 4.4
dbForge Studio for MySQL 8.1
dbForge Query Builder for MySQL 4.4
dbForge Data Compare for MySQL 5.5
Aqua Data Studio 19.5
ConyEdit for Windows 1.1.1
GetOrgChart 2.5.3.0
Database Workbench Pro 5.6.0
.Net VCL for Delphi 1.0.0.0
Top Code
Paste phpSoftPro 1.4.1
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
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
PHP GZ Blog Script 1.1
ATN Jobs Software 4.0
ATN Mall 2.0
WeBuilder 2015 13.3
Code Listing by Jan Kaliszewski

Code 1-7 of 7   






A simple implementation of a dictionary which always (when applicable) returns keys, values, items (key-value pairs) sorted by keys (inserting/removing order doesn't matter and only keys are important; so please note that it is something different than OrderedDict in Python 3.1/2.7 or Django's SortedDict).



This module provides an easy way to define and use your own around/before/after auxiliary methods, similar to those used in CLOS (Common Lisp Object System).



My approach to that common issue focuses on efficiency and elegant, declarative style of definition. That's why:


The way switches work is based on unwrapped defaultdict/list lookup.
The way you define switches is based on...



A Python 2.x/3.x-compatibile multiprocess-safe logging file-handler (logging.FileHandler replacement, designed for logging to a single file from multiple independent processes) together with a simple interprocess recursive lock -- universal...



A quick fcntl.flock(fcntl.LOCK_EX | fcntl.LOCK_NB) call sampling script: with one file object (and descriptor) or separate file objects (and different descriptors) pointing to the same filesystem path -- with/without threading or forking.



Just import, call and log your selected call/return/exception/etc. events.
You can use a standard Python logger from the logging module.
Quite flexible tool and about 50 efective SLOC only (excluding the example script).
For...



If you need


to define named tuple subclasses (including reusable abstract ones), adding/overriding some methods, in a convenient way;
to have the named tuple ABC (abstract base class) for isinstance/issubclass tests;
or...