Page 1
Standard

Mithai khane ka asar

(After coming back from a movie.)mixmithai
Anuran: Abe Anik, aaj mein aur Nihar Royapettah gaye the. Ek dukan mein mithai khaye. Tab ek ajeeb-o-gareeb ghatna huyi.
Anik: Kya hua bata?
Anuran: Abe do tho mithai khaye. Kitna price hoga guess kar? 60 rupaye liye usne….. aur dukan bhi Bihari dhaba se chhota tha.
Anik: (With a diplomatic gaze) hmm…. yahan pe aisa hi hota hai.
Anuran: Pata hai uske baad kya hua? Hum donon ko achanak se dikhna bandh ho gaya. Phir raat ko room laute tab jaake thikse dikha.
Anik: shit!!! Kya milaya tha usmein???
Anuran: Abey nahin…. usne hum donon ko ullu bana diya na. :D :D :D

Standard

A beginners tutorial on Social Network Analysis – (Part 2)

In this part, we will talk about visualizing our network.

  • Tools used for this tutorial: networkX, matplotlib

In Part 1 of this tutorial, we talked of a graph having 5 nodes (a,b,c,d,e) and the edges [(a,b), (b,c), (c,d)]. Let’s add one more edge (b,d)

Matplotlib is a set of plotting tools for python. You can download and install it from a package manager of your choice, or install it from source. This can take care of advanced 2D plotting for python. We will use this to plot our network.

#!/usr/bin/python
import networkx as nx
import matplotlib.pyplot as plt

graph=nx.Graph()
edgeList=[('a','b'), ('b','c'),('c','d'),
('b','d')]
graph.add_edges_from(edgeList)

pos=nx.spring_layout(graph) #specify the layout
nx.draw(graph,pos,node_color='#A0CBE2',
        edge_color='#B0C23E',width=2,
        edge_cmap=plt.cm.Blues,with_labels=True)
plt.show()   #display the graph
plt.savefig("idiot_network:P.png")
#save it on the disk

the rendered graph

All the parameters in nx.draw() are self explanatory.
NetworkX has the following layouts:

  • Graphviz and pydot layout
  • circular layout (places nodes in a circle)
  • random layout (positions nodes based on an uniform distribution in a unit square.
  • shell layout (places nodes in concentric circles)
  • spring layout (places nodes using Fruchterman-Reingold force-directed algorithm )
  • spectral layout (positions nodes using eigen vectors of the graph laplacian)

You can tinker with different layouts and select the one that best suits your needs.

To show you the types of visualizations rendered, I am posting some renders below :

Portion of a large graph in random layout

co-authorship graph of faculties in CSE dept. IIT Madras

In the next parts, we will work on some real network, like twitter followers network or IMDB co-star network or DBLP co-authorship network and check models for link prediction, homophily, information cascades and epidemics, community detection etc. Thanks for following this tut.  :)

Standard

A beginners tutorial on Social Network Analysis – (Part 1)

Social Network Analysis refers to the methods used for analyzing social networks or interconnections among individuals. The individuals are taken as “nodes” and are connected to each other based on their interconnections, which may be of various types (friendship, co-authorship, kinship, sexual relations, financial exchange, common interest etc.) SNA uses various techniques from Graph Theory, Game Theory and several other to study, explain and predict the network.

Getting the tools:

NetworkX is a Python-based package for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks. If you are on a linux distribution like Ubuntu chances are it will be in your package manager. Otherwise, you can download and install the binary or even compile it from source from here.

Head-first to NetworkX:

import networkx as nx #importing networkx for use

Next we need to create a graph,

graph=nx.Graph()

Let’s say we have 4 nodes named ‘a’,’b’,’c’ and ‘d’ and edges between (a,b) , (b,c) and (a,d).

to add a node we can just use:

graph.add_node('a')

We can also add all nodes from an iterable to the graph.

nodeList=['a','b','c','d']
graph.add_nodes_from(nodeList)

Nodes can also have attributes: attribute can be from a dictionary

nodeListAtrb=[('a',{'name':'alpha','color':'red'}),
('b',{'name':'beta','color':'blue'})]
graph.add_nodes_from(nodeListAtrb)
print graph.node['a']['color']
#to access an attribute of a node

You can have any number of attributes according to your choice.
Next we will add some edges. Adding an edge is exactly similar to adding a node.

edgeList=[('a','b',{'color':'blue'}),
('b','c',{'weight':8}),('c','d',{'connected':8})]
graph.add_edge('a', 'b')
graph.add_edges_from(edgeList)
print graph.edge['a']['b']['color']
#To access an edge's attribute

Next we will analyze this graph.

nx.degree(graph)
#To find the degree of graph
nx.connected_components(graph)
#Find all connected components
nx.connected_component_subgraphs(graph)
#get connected components as subgraphs
graph.degree('a') #Get degree of a node
nx.degree(graph) #Get degree of all nodes
nx.closeness_centrality(graph)
#get closeness centrality for all nodes in a dict
nx.betweenness_centrality(graph)
#get betweenness centrality
nx.clustering(graph) #Find clustering coefficients
nx.shortest_path(graph,'a','d')
#find shortest path between 2 nodes
nx.shortest_path_length(G,'a', 'd')
#find length of shortest path between 2 nodes
nx.neighbors(graph,'a') #find neighbors of a node

NetworkX provides many other methods to access different properties of the network and analyze them.

(In the next parts, we will discuss on how to get a visual representation of the network, collecting data for our network, and work with a real life network) In case of any issues or suggestions please add a comment to this post.

Standard

A walk in the clouds

Coorg is a well known hill station in Karnataka known for the mesmerizing mountain ranges all over with luscious greenery and the tranquil waters of the Cauvery River flowing through the hilly area, not to mention some attractions like dubare, Kaberi Nisarg dham, a buddhist temple and a white water rafting site surrounding the spot.

We started off from Mysore in a group of 8 (me, guru, T. sushant, Piyush, Mohan, Pratyush, Sudhir and Prateek) and our first stop was the Buddhist temple at Bailakuppe. The place was pretty well managed in terms of cleanliness and the monks were seen all over doing their chores. Well the poor souls were having hard time as each group of tourists dragged them for a pic and we were no exception. :)

The next stop was Dubare forest. A short expedition in the jungle, tree house and after that had the most thrilling time of the trip– the rafting in Cauveri. 4 of us joined on a raft and after a short tutorial got on with our paddles, and then came the rapids. When the guy guiding us asked to jump into the water, I was shocked with disbelief and then at the next moment we were floating in Cauveri. That was simply awesome….

Went on to find a place for home stay on top of a hillock after reaching Madikeri, and after a mini-train ride the plan was to cook. Spent the evening cooking and getting high (and this time the excuse was chilly climate :P )

The next morning went for a water fall, few places of historical importance and the next stop was Talakaveri . The real fun was from the top of the mountains in Western Ghats, 4000ft above the sea level and kissing the clouds. After having a “Khatti” over there finally got down and got back on our way to Mysore.

 

In one word it was just exhilarating, a package filled with fun, thrills, adventure and in all a perfect weekend with friends.

Standard

Demo of prototype for Official website VSSUT

After spending close to 10 days redesigning the look and feel and functionality of the proposed official website of VSSUT, finally we came up with something entirely new. This demonstration shows a screen cast of the presentation I gave in AVC for the VC, faculties and administration.

Team:

  • Niharjyoti Sarangi
  • Himanshu Patel
  • Piyush Mishra
  • Soumyaranjan Mohanty

Thank you all for the effort and dedication.
Standard

Apocalypse: Evasion of the Wipeout

So, here is a game that team X-crafters created long back during my undergrad days.

X-Crafters

X-Crafters

Team X-Crafters:

  • Chinu Subuddhi
  • Niharjyoti Sarangi
  • Anit Mohanty

 

The story is of a post-apocalypse period, where every race starts to doubt and hate the other. The protagonist in his thrilling journey comes across several clues, one leading to the other in an intricately woven mystery and tries to uncover the truth behind the destruction.

The levels were all modeled in 3D using Blender. Also we have used the blender game engine, which we complimented with Python for specific modifications.

You can play a Windows version of this game here  Apocalypse_WindowsVersion .  (We have a Linux/Solaris version too. Please contact me if you want one.)

Caution: The game is a bit edgy.

 

 

Standard

Mojito

After quite a long time thought of going for a mojito. It started with the thrill of blending , and after the plan got final with Sunny it turned out to be just another excuse to gulp down some white rum and blend a cocktail to beat down the scorching summer. :P

Ingredients used:

  1.  Sparkling water.
  2. Mint leaves
  3. Lemon
  4. Sugar syrup
  5. Ice cubes (crushed)
  6. Bacardi white rum

Preparation:

Added crushed ice upto 30% in the glass. 5ml. sugar syrup to trickle down, followed by 10ml of mint leaf extracts, 10ml. lemon juice, 20ml. sparkling water and 20ml rum. The whole thing was topped with few mint leaves and 5ml of mint extract.

Standard

Blender Art

After being fascinated with the artworks and movies from blenderart, decided to try my hands at blender. These are the first ones I made. Hopefully, I will be able to make something nicer the next time.

Snowman

 

Standard

Methods of Proof

Top 10 Proof Techniques

  1. Proof by throwing in the kitchen sink: The author writes down every theorem or result known to mankind and then adds a few more just for good measure. When questioned later, the author correctly observes that the proof contains all the key facts needed to actually prove the result. Very popular strategy on exams. Known to result in extra credit with sufficient whining.
  2. Proof by example: The author gives only the case n = 2 and suggests that it contains most of the ideas of the general proof.
  3. Proof by vigorous hand waving: A faculty favorite. Works well in any classroom or seminar setting.
  4. Proof by cumbersome notation: Best done with access to at least four alphabets and special symbols. Helps to speak several foreign languages.
  5. Proof by exhaustion: An issue or two of a journal devoted to your proof is useful. Works well in combination with proof by throwing in the kitchen sink and proof by cumbersome notation. Continue Reading →