Search
New Code
Excel Add-in for DB2 1.7
wolfSSL 4.0.0
EntityDAC Express 2.2
SecureBridge 9.1
C# HTML to PDF 2019.6.5
PHP Ecommerce Script 3.6
Devart SSIS Data Flow Components 1.11
dbForge Data Compare for PostgreSQL 3.2.15
OrgChart JS 4.9.7
iScripts CyberMatch 1.3.3
AnyGantt JS Gantt Charts 8.7.0
Database Workbench Pro 5.6.8
SentiMask SDK Trial 2.0.193121
dbForge Studio for SQL Server 5.8
ODBC Driver for ASE 2.1.2
Top Code
VisualNEO Web 2018.12.15
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
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
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 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...