Showing posts from May, 2016

Byte code manipulation using Java instrumentation and jboss Javassist

In previous post we discussed how to use Java instrumentation to find size of object. In this post we will discuss how to modify Java byte codes using Transformer class (An agent implementing ClassFileTransformer interface) and jboss Javassist byte …

What is significance of __name__ in python

In python modules can be loaded by importing in some other module or executed directly as standalone program. So, how does python detect at run time that a particular module was imported  or it was executed directly as standalone application. Simple …

Level order traversal of Binary tree in Python

Level order traversal in python Input:- 5 3 7 2 4 6 8 Level order traversal of BST:  5 3 7 2 4 6 8 import sys class Node : def __init__ ( self ,data): self . right = self . left = None self . data = …

Python 2.0 list comprehensions - Sample examples

Comprehensions are constructs that allow sequences to be built from other sequences. L ist comprehensions was introduced in  Python 2.0. The concise and clean code of list comprehension inspired to introduce dictionary and set comprehensions. Compon…

Height of Binary Search Tree in python

Find Height if Binary search tree in Python  Input:  5 3 7 2 4 6 8 Height of tree is : 3 class Node : def __init__ ( self ,data): self . right = self . left = None self . data = data class Solution : …

Database CRUD Operation in Python- SQLite and Python

In this post we will use Python to work with data in SQLite database files. We will create table, insert records into it, update table and finally perform SELECT based on some condition. Problem statement : - Process this  text file and count the num…

Load More
That is All