Tuesday, 13 November 2012

Visualize your Facebook network

Hey

This tutorial will walk you through the simple procedure to visualize (and possibly analyse) your facebook network, from scratch.

Note: I run Ubuntu 12.04. The process shouldn't be much difficult for other versions. But, I personally found difficulties when using gephi with 11.04, with no valid reason. In such a case, please try upgrading.

1. Download Gephi here
2. cd into Gephi directory. Then,

$ cd bin
$ ./gephi

2. This should start gephi.
3. If you want a quick walk around this software, please go through this tutorial
4. Now log in your facebook account and search for netvizz app. Do the appropriate selections and download the gdf files. Open the gdf file into gephi.
5. For layout use the force atlas 2. This will run a program that'll put the mass of nodes into different groups. Stop after 2-4 seconds. 
6. Then run the modularity button on the right side statistics panel. 
7. Refresh the partition options and choose the criteria on which basis you would like to partition the network. In the shown figure, I used modularity class. 
9. Apply
Done !!

My fb network with possible communities colored differently


Analyzing one's own facebook network is a much more interesting task than killing time on it :)

Friday, 10 August 2012

AI termpaper : GO

The topic of my term paper was to make an intelligent go playing bot. My team of three started off with reading up on GO and learning the game ourselves.Finally we submitted our bot which runs the MonteCarlo GO Algorithm.It ran on terminal (No GUI).

Here's a rough summary for the online material for those looking to explore this awesome game..

You'll read GO is a difficult game for AI agents  on every paper or website you'll refer to...
They all are not lying...! Still, "fun" is worth the effort.

Square 1:
Wikipedia -
Get those terms in your mind .. "joseki, fuseki "(board-opening techniques), "komi"(scoring dues) etc...they are the ones who irritate at the last hour...plus, discussing the game in these terms will make the journey more intuition and fun..

Square 2:
Algorithm to be followed

  1. Expert System
    1. Pattern Recognition 
      1. Make a hash table storing the different table positions and do a look-up before next step.
      2. This hash table can also guide us on the value to each state - to give a sense of victory or loss - based on expert advice.This is very difficult not just for memory reasons, but getting the expert data is also difficult.BTW, you'll find good video presentations on this approach.
  2. Intelligent System
    1. Monte Carlo GO, RAVE, UCT are some of the advanced tree searching algorithms.Papers available on the web.
    2. Some papers also describe the Genetic Algorithms, NN or fuzzy logic methods.But keeping in mind the time and resources, we need to choose the best.But understanding these methods wont do us a harm...so spend a week to get an overview on above mentioned "fancy" stuff.


Square 3:
Decide the final presentation of the result of the work.The GUI you'll be using.Any server you are going to upload your bot on.This will decide the structure of your code.

  • To upload your bot for competition on a server, there are some protocols to be followed.
  • To impress a class/instructor try some GUIs or terminal running bots (My bot ran on terminal by the way) 

Square 4:
Refer to some online bots available.Lithos, feugo, pachi, GNU Go etc.Now that you have an idea what is Monte Carlo Search in context of Go, these works will be more simple.But still, their codes are daunting and it's difficult to integrate our simple code pieces into the system. If anything goes wrong, we go clueless. So, a good place to start with is the wiki book on GO.It gives step-by-step guidelines on how to build basic bot that runs in terminal.Then, you are free to refer to papers and code the algorithms you wanted to.This method is not advisable for those who want to use PR.

So this is a "short" outline to get the bot GOing..!

Wednesday, 4 July 2012

Primary key error and Database locked error

This is a rather random post...
I'm working with sqlite3 in django...I kept getting this: Integrity error - "Primary key is not unique" on form submission.
for those who want a quick fix - try to .save() the created objects wherever possible.
I guess this fixes the error because a primary key is allotted to an object only after .save() is done.


The error was not fixed in my case though...
There was a problem when I used a dictionary allotment of variables.
eg. get POST inputs and make a dictionary our-self and pass it as variables to templates.
Say, 
dict = {'title': topic,'content' : agenda, 'status' : 2}


This dint work.


Instead, when I assigned the different form fields through the functions using the '.' operator, that worked.
Say,
sys = System()
sys.title = topic
sys.content = agenda
sys.status = 2
sys.save() 


this worked !

There's another popular sqlite error: database locked error.
fix: try to restart system.This closes all background programs that access the database.
This error generally happens because 2 or more processes access the database simultaneously.This is possible only with sqlite because in others the database is "closed" type.

If the database is huge, or expect a huge traffic, may be we should try to shift our database management system...
This problem was "solved " when our supervisor told us they'd transfer the database to PostgreSQL when hosting the website on the server... :)

Tuesday, 12 June 2012

Time to fork!

After training for 3 weeks - for project pre-reqs and for 'local' bustle of Mumbai - I find myself armed with a new web framework - django and an 'almost' operating system - emacs.I like django because
a.It makes web designing a neater task
b.It's name so much resembles mango! (just kidding here :P)

Gnowsys studio is the context of work.It's novelty is about using nodes to represent data instead of the conventional RDBMS.And as an intern from BITS Pilani, I'm working in group to make parts of social networking website for educational purposes.

And another thing...Monsoons of Mumbai are the best when viewed from a running train on Harbor line - directly thrashing the sea...!

Tuesday, 29 May 2012

Summer Internship!

This summer, I'm investing my time in HBCSE (TIFR).Here, I'll be trained for two weeks and then I'm expected to contribute to the ongoing projects in the gnowledge lab...!

Friday, 4 May 2012

I'm now the project-forum in-charge for Computer Science Association Apogee 2013!Awesomeness!