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
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?
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 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
To determine the version of log4j running, use the code below… This Outputs: package org.apache.log4j Implementation title: log4j Implementation vendor: “Apache Software Foundation” Implementation version: 1.2.8
Log4J Levels Loggers may be assigned levels. The set of possible levels, that is DEBUG, INFO, WARN, ERROR and FATAL are defined in the org.apache.log4j.Level class. If a given logger is not assigned a level, then it inherits one from its closest ancestor with an assigned level. The root logger resides at the top of the … Continue reading What are the Log4j Levels?
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