Sunday, December 21, 2014

Getting started with Python API for Facebook

Install the repository with

sudo pip install facebook-sdk

Here is a sample program to print the name of your friends 


To get the oauth_access_token follow this link Graph API Explorer


See the following the snippet for printing posts with some specific substring in them. This way we can complete the hack of posting multiple comments on similar posts



I found another python libray, which seems more easier to use than this one. visit that Facepy

Tuesday, December 16, 2014

SPOJ PRATA


The problem : www.spoj.com/problems/PRATA/

Solution: There are many solutions one can use binary search which is straight forward if you understand the concept of binary search . Use the link to find a binary search based implementation

http://spoj-solutions.blogspot.in/2014/10/prata-roti-prata.html

I used a min-heap based solution. The algorithm is to find the the cook who will next become free and assign him a prata, as simple as that.

My solution is O(p*L) which got accepted. You can find the code through following link
https://github.com/kanirudh/spoj/blob/master/prata.cpp

Comment below in case of queries.