Hacks and Tweaks

Posts Tagged ‘Programming’


Python Factory Design Patterns using Switch Case

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...
by arunenigma


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

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 ha...
by arunenigma


Python AVL Tree Implementation with ASCII visualization

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 tim...
by arunenigma



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


Java Program To Multiply Two Matrices

This is a simple java program that teaches you for multiplying two matrix to each other. We are going to make a simple program that will multiply two matrix. Two dimensional array represents the matrix.  Now, make this progra...
by arunenigma