How to remove duplicate edges from graph in Python list

Published on

Remove duplicate edges from graph in Python list If a tuple (n1, (n2, distance)) represents a bidirectional connection, I would introduce a normalization property which constraints the ordering of the two nodes in the tuple. This way, each possible edge has exactly one unique representation. Consequently, a normalization function would map a given, potentially unnormalized, … Continue reading How to remove duplicate edges from graph in Python list

How to assign member variables temporarily in python?

Published on

Context managers may be used for it easily. Quoting official docs: Typical uses of context managers include saving and restoring various kinds of global state, locking and unlocking resources, closing opened files, etc. It seems like saving and restoring state is exactly what we want to do here. Example: from contextlib import contextmanager @contextmanager def … Continue reading How to assign member variables temporarily in python?

How to Speed Up WebSites with htaccess Caching

Published on

Awesome ways to implement caching on your website using Apache .htaccess (httpd.conf) files on the Apache Web Server. Both methods are extremely simple to set up and will dramatically speed up your site! Apache .htaccess Caching Code: # BEGIN EXPIRES <IfModule mod_expires.c> ExpiresActive On ExpiresDefault “access plus 10 days” ExpiresByType text/css “access plus 1 week” … Continue reading How to Speed Up WebSites with htaccess Caching

Get free virtual machine

Published on

Get free virtual machine from amazon(aws) The Amazon Web Services (AWS) Free Tier is designed to enable you to get hands-on experience with AWS Cloud Services. The AWS Free Tier includes services with a free tier available for 12 months following your AWS sign-up date, as well as additional service offers that do not automatically expire … Continue reading Get free virtual machine

Vodafone GPRS packs and short codes (*121*xx#) for Vodafone IN

Published on

partially Updated Jan 05, 2014 Below are some GPRS pack short codes to activate them without the need to recharge with specific denomination with the retailer. The only thing to maintain is the balance for your mobile. There are other methods for activating these short term GPRS packs, but this method is lot more easier and trouble free. *121*05#    – … Continue reading Vodafone GPRS packs and short codes (*121*xx#) for Vodafone IN