arungeek
Hacks and Tweaks


In The Spotlight


Factory_1
Programming

Python Factory Design Patterns using Switch Case

Posted  January 12, 2014  by  arunenigma

I googled for Factory Method Design Pattern in Python but couldn’t find a good resource. So, I  am sharing an example program to demonstrate this design pattern in Python which I frequently use. The factory method pattern is an object-oriented creational design pattern that deals with the problem of creating objects without specifying the exact […]

Full Story »

Gospers_glider_gun
Programming

Conway’s Game of Life Implemetation in Python with cool patterns

Posted  January 8, 2014  by  arunenigma

he Game of Life (or simply Life) is not a game in the conventional sense. There are no players, and no winning or losing. Once the “pieces” are placed in the starting position, the rules determine everything that happens later. Nevertheless, Life is full of surprises! In most cases, it is impossible to look at […]

Full Story »

bin-tree
Programming

Python AVL Tree Implementation with ASCII visualization

Posted  January 6, 2014  by  arunenigma

n computer science, an AVL tree is a self-balancing binary search tree. It was the first such data structure to be invented. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is done to […]

Full Story »

bst
Programming

Binary Search Tree in Python with ASCII art visualization

Posted  January 6, 2014  by  arunenigma

Binary search tree implementation in Python with: in, post and pre-order traversals. Also includes methods for insertion, deletion and search of nodes. Deletion is fairly complex and is made possible by keeping track of parents. A binary search tree (BST) or ordered binary tree is a node-based binary tree data structure which has the following […]

Full Story »

fibonacci
Programming

Python, Memoization, Dynamic Programming, Fibonacci Series and some Fun!

Posted  December 31, 2013  by  arunenigma

ython can implement the recursive formulation directly, caching return values. Memoization is a method where if a call is made more than once with the same arguments, and the result is returned directly from the cache. For example, we can dynamically solve the exponential Fibonacci series by using a Memoize class or a memoize function […]

Full Story »

 
 
 

 
elephant_rgb-380x285

Installing Hadoop on Mac OSX Mountain Lion (Step by Step Instructions)

Setting up a single node Apache Hadoop instance on OS X is pretty simple and much the same as on any other Linux/Unix machines, with a small bit of customer configuration. See here for official instructions. This tutorial provi...
by arunenigma
 

 
 
decompile

How to convert(decompile) .pyc to py files

How to convert *.pyc to *.py files ? A few days before, I  accidentally deleted all my Python code while renaming some files. Luckily I had the .pyc files in the working directory. After googling for ways to convert .pyc back ...
by arunenigma
 

 
 
vCard

Adding vCard to your blog, website or portfolio

What is a vCard? In a nutshell, its the industry standard for electronic business cards. You can attach them to emails or posts, just about anything. The great thing about a vCard is that it holds all the information that you...
by arunenigma
 

 

 
stevejobs_afterlife

Where is Steve Jobs ? Afterlife Revelation

A Buddhist temple in Thailand says it has pinpointed Steve Jobs’ whereabouts in the afterlife, and the late Apple co-founder is a mid-level angel living in a parallel universe (but still in California). Wat Phra Dhammakaya ma...
by arunenigma
 

 
 
MountainLionAppStore

python mountain lion multiarray

                Fix to install python numpy module in Mountain Lion OS Many users are receiving multiarray error after upgrading from Lion OS to Mountain Lion while trying to Python numpy...
by arunenigma