Facebook Group's Daily Digest Emails


Hey folks. So, wondering about the hell of emails facebook send you for every activity that is done in a group you are member of? Well, there is one official way to get rid of it – revoke permissions about facebook sending you emails. But then, you also don;t want to be left out, right? What if you could have a daily digest sort of thing for facebook groups? Won’t that be great?

Time to welcome Group Email Digest app (facebook link, website). This is a real simple, sweet app that keeps you updated about the activities performed in your facvorite group on a daily basis. The app’s motto is “To keep your inbox updated and uncluttered“.

Let me tell you more about this app. When you visit the app’s home page (http://digest.myblive.com), it will ask you to login with your facebook account, and ask the required permissions. The need for various permissions has been very clearly mentioned there itself. After you login, you will find all the groups you are currently a member of. Just check those groups for which you want a daily digest update email and click on “Subscribe Digest Email” at the bottom. If you want to opt out from a particular group, just uncheck the group and again click on “Subscribe Digest Email”. That will opt you out.

The app is in beta phase. This means that there will be frequent changes in the application’s behavior. The changes will be for the good only. Also, there are server limitations on the number of emails per day, that can be send out (since the application is running in free quota now), so we can support only a limited number of users right now. The limit should be somewhere around 1,000 however exact count shall be available only after observation for couple of days.

Let me know your views, critism and praises, so I will keep improving upon it.

generating tag cloud in Python

Tag Clouds are an amazing way to emphasize on what is needed. Here, is a simple code snippet in Python that will generate tag cloud, on the basis of tags and their count provided.

The algorithm for generating tag cloud is used from http://en.wikipedia.org/wiki/Tag_cloud#Creation_of_a_tag_cloud

def generate_tag_cloud(tags, baseurl=’http://www.example.com/tag/’, fmax = 20):
“””Generates HTML of tag cloud.
Input params:
tags : A dictionary containing the key as the tag name, and
value as the count of times, it appears
ex: {‘tag1’: 2, ‘tag2’: 1, ‘tag3’: 45}
fmax : The maximum font size to display. pixel

http://en.wikipedia.org/wiki/Tag_cloud#Creation_of_a_tag_cloud
“””
size = lambda f_max, t_max, t_min, t_i : t_i > t_min and int(math.ceil((f_max*(t_i – t_min))/(t_max – t_min))) or 10

f_max = fmax
t_min = min(tags.values())
t_max = max(tags.values())
cloud = []

for tag in tags:
cloud.append({‘tag’: tag,
‘count’: tags.get(tag),
‘size’: size(f_max,t_max,t_min,tags.get(tag))})
s = []
for onetag in cloud:
s.append(‘%s
%(onetag.get(‘size’), baseurl+onetag.get(‘tag’), onetag.get(‘count’), tag ))
return ‘

‘ + ”.join(s) + ‘

# Assumes the data structure for tag as
# class Tag(object):
# def __init__(self, name, count, permalink):
# self.name = name
# self.count = count
# self.permalink = permalink
# And why would one have such a structure? Well, watch out for http://beamto.us
# source when it is released
#
def gen_tagcloud(tags):
“””Generates the dict for tag cloud based on the input provided
tags = [tag1, tag2, tag3]
“””
conf = ‘log’ # for logarithmic cloud, try ‘linear’ for linear
min_weight = min([x.count for x in tags])
max_weight = max([x.count for x in tags])
tag_cloud = []
if conf.get(‘ALGO’).lower().startswith(‘linear’):
for tag in tags:
w = (tag.count – min_weight)/(max_weight – min_weight)
f = conf.get(‘MIN-FONT’) + (conf.get(‘MAX-FONT’) – conf.get(‘MIN-FONT’) )*w
tag_cloud.append({‘tag’:tag, ‘count’:tag.count+1, ‘font’: f,
‘permalink’: tag.permalink})
if conf.get(‘ALGO’).lower().startswith(‘log’):
for tag in tags:
w = (math.log(tag.count or 1) – math.log(min_weight or 1))/\
(math.log(max_weight or 1) – math.log(min_weight or 1))
f = conf.get(‘MIN-FONT’) + (conf.get(‘MAX-FONT’) – conf.get(‘MIN-FONT’) )*w
tag_cloud.append({‘tag’:tag, ‘count’:tag.count + 1, ‘font’:f,
‘permalink’: tag.permalink})
return tag_cloud

You can tweak and create better versions. Also this is on the Python side, there could be a similar one for JavaScript as well, which generates tag clouds on the fly.

BeamtoUs – Discover Vote Share

Welcome Beamto.us (twitter @beamtous), a completely new and beautiful music sharing portal. We love to call each single element that you share as a beam. This is also my current project, where I am involved in close coordination with caffeine powered code monkeys – Ritesh Nadhani (idea bubble generator), Taras, Freechin and others. Beamto.us.

Beamto.us is a music sharing portal targeting specific to genres like psy trance, chillout trance, dark trance, progressive trance and other sub genres in them. You can easily upload your music, or if you have already done that on youtube, soundcloud or other portals, can link from Beamto.us. I’d like to talk more on what are the interesting things that you can do with Beamto.us. The official About Us page says

“Beamto.us Aggregates. The only website in the World that aggregates all electronic music. We use the best back-end technology to bring an excellent interface to all the users. The main page of the site aggregates and lists only the most popular songs voted by the users. Our algorithm has been simulated and tested to be absolutely fair to rankings.”






Features

  1. Beamto.us allows you to login through your existing Google Account, so you don’t need to go through all the registration hassle and pain.
  2. You can upload your music onto our servers or can hotlink your existing website/link for your music at Beamto.us.
  3. Vote Up/ Down a particular beam. And yeah, the votes and rankings do decay so if your beam is hot and new, you are going to be at the top.
  4. Easily share your beams on Facebook, MySpace, Twitter and many other favorite sites, where your friends can see them
  5. Concerned about copyright issues or something else, just let us know. We deal with abuse reports very seriously.
  6. We have lots of space and our servers are on the cloud, so don’t worry about a downtime 🙂 Whenever someone wants to go through your beam, we make sure that it is always up and serving hot.
  7. Its FREE to use. Yes, you don’t need to pay in order to use or share your beams. Just come over and we will be doing the things for you.

The portal is still in its early phases and we have some very exiting plans to make it fun. Yes, that’s our concern. Make beaming fun, simple and share !!

And yes, we are always listening to our users who tell us about our faults and where we need to improve. And we do work on them. So, whenever you feel something is missing, just let us know.

PyCon India 2010 Experience

PyCon India this year was held at M.S. Ramaiah Institute of Technology, Bangalore this year on 25th and 26th of Sept. PyCon India 2010 is the primary Python conference in India. A purely volunteer effort, it is being hosted for the second time in India, and has attracted some of the best Python developers in India and abroad.

This year, I had a chance to speak on “Building Scalable Apps Using Google App Engine”. It was an intermediate level talk for 45 minutes. The presentation slides are available at http://in.pycon.org/2010/talks/5-building-scalable-apps-using-google-app-engine

All the presentation slides and other details are available on PyCon India site at http://in.pycon.org/2010/talks. Videos for all the talks shall be made available on YouTube soon, possibly by this week. But could take more time as well. Below are a couple of talks which were quite impressive and should be useful to the developer community are : –

  1. Introduction to Image processing in Python, Anil C R – http://in.pycon.org/2010/talks/33
  2. Python + Wii = Intutive Control, Asim Mittal – http://in.pycon.org/2010/talks/22
  3. Text Parsing in Python, Gayatri Nittala, Madhubala Vasireddy – http://in.pycon.org/2010/talks/57
  4. Rapid 3D game development in Blender, Arun Ravindran – http://in.pycon.org/2010/talks/37
  5. Into 3D with VPython, Deepak Mishra – http://in.pycon.org/2010/talks/81
  6. Agent Based User Simulation and Load Testing, Om Narayan – http://in.pycon.org/2010/talks/41
  7. Internet Protocols in the Python Standard Library, Senthil Kumaran – http://in.pycon.org/2010/talks/14
  8. Building Scalable Apps using Google App Engine, Pranav Prakash – http://in.pycon.org/2010/talks/5
  9. Python Object Model and Introduction to meta programming, Sambasiva S – http://in.pycon.org/2010/talks/13
  10. Test Driven Development, Gayatri Nittala, Madhubala Vasireddy – http://in.pycon.org/2010/talks/58
  11. Python on Mobile Phones, N.Seshadri – http://in.pycon.org/2010/talks/34

I personally could not attend all the talks mentioned above, as some were conflicting with others, but I am looking forward to watching their YouTube developer videos. I will be updating you all when the videos are available.

Also, I had a chance to meet a lot of exiting and energrtic particles – Noufal Ibrahim, Anand Pillai, Abhishek Mishra (@ideamonk) and many more.

I am already looking forward for PyCon India 2011.

And yeah, the food was simply awesome. I really liked it 🙂

Preparing for the talk in PyCon India 2010

So, my talk on ‘Building Scalable Apps using AppEngine‘ in PyCon India 2010 has been approved. Although I have mentioned in the talk details as to how will my talk proceed, I would like to elaborate more on this.

Building Scalable Apps using Google App Engine (Python) (45 minutes )

Now there are a couple of keywords that must be understood clearly. We will proceed one by one on it.

Building Scalable Apps

So, we will be talking about building scalable applications. Building, as in starting from scratch. I will be presuming that the audience has some knowledge of web application development using a framework in any programming language. However acquaintance with Django, TurboGears is highly preferred. I am not expecting a lot of people to be used with Google App Engine, so I will be talking about Google App Engine in some details. What is Google App Engine, What is the purpose of it’s existence, what are its chief features, how is it different from other web application development framework. Then we will be diving into the greatest advantage of Google App Engine over others – Scalability. In some of the talks that I have taken on App Engine, I have seen developers with a blurred view on Scalability. Most of the times, people are mistaken for what in true sense is scaling of application/infrastructure. Scaling is so important to understand because we have been living a world where most of the things we see around are non scalable. Look around yourself, we have the same roads that existed years ago but traffic has been growing exponentially. The cities are the same, railways are the same and so is everything else. It is getting day by day difficult to sustain the burden we put on our limited resources. But nature and we do scale to certain limits. You heart beats normally at 72 beats per minute. While you are running or playing, your body needs more oxygen and so your heart stats to pump at a faster rate in order to cope up with the increased demand. This is called as scaling up. On the other hand consider your brain. Whatever we see, sense, smell are stored in neurons as patterns. The things we need to recall more frequently are stored at much larger neural networks as compared to things that we need infrequently. This is called as scaling out. I hope this explains the difference between a non-scalable architecture, a scale-up architecture and a scale-out architecture. Having understood that, we must know that Google App Engine is designed to scale out. This means that Google App Engine is very efficient at performing tasks at parallel. And this is what we must keep in mind while developing applications on App Engine.

Using Google App Engine

What differentiates App Engine is that it provides us the same infrastructure that is used by Google. Apart from many other things, it implies that we will be using Google BigTable for storing data. AppEngine provides a DataStore environment that is build on top of BigTable. DataStore is not SQL, it is not FlatFile, it is not RDBMS. It is BigTable. And it has its own rules, own ways to read/write from datastore, own ways to maintain concurrency and all other things that should be there in a modern database system. And there are certain restrictions, certain flexibility onto it. In order to be able to develop a scalable application using App Engine, it is very necessary that we know what is datastore capable of and what is outside the limits of datastore. In any application, there are more reads as compared to writes, so we need to make sure that our read latency is very low. And here comes the concept of write once, read many. We take care of all the possible ways in which our data might be needed to read, and we store them at the write time only. We also need to take care in how we write data as there are again a lot of overheads involved in Index building, searching, and quering. Apart from all these things we can do with datastore, we have a high speed, in memory cache called as ‘Memcache’. Used with a perfect blend of Datastore and memcache, the application can be quite fast and scalable.

I am also working on gathering the measurable statistics for a scalable code and a non-scalable code. I hope to complete it by this weekend, and i will upload it here soon.

Apart from this, I will be talking about a little technical background of Oxylabs Networks, India’s leading social apps and game developing company. How we began with MySQL, where MySQL lagged and why we chose AppEngine. How we cater to the needs of our more than 20 million player base with high scalability using App Engine.

And if all of this excites you, creates a chill down your spine, we are looking forward to give you an opportunity to be a part of our team. Attend the talk for more details on this.

PyCon India 2010,
25th and 26th Sept, 2010
M S Ramaiah Institute of Technology, Bangalore, India (map)

Update

Presentation Slide for PyCon India is shared here

My journey to Python

It starts even before one can think. So, i was in my first semester of my Bachelor’s in Engineering and it was December of 2004. I was back at my home place, Jaipur for vacations. There i met my school friend Himanshu Bhojwani, who made some real cool robotics and other electronics gadgets and he showed me them. I was quite curious and asked him how did he do all that stuf. Technology and gadgets had always interested me. So, he told me about Parallel Port programming and about Visual Basic 6.0. He said that he did all this by connecting his electronics stuff to parallel port of his computer and use Visual Basic to get his stuff done. That evening while returning back home, i purchased Parallel Port Programming. My initial plan was to use C++ to do the programming part, but looking at the ease VB6.0 could make same programs in much less time, i decided to learn VB6.0. I also got a neighbor of mine, who was a Software Engineer at that time, to guide me out with VB. Well, as time went on, i forgot the Parallel port programming, and was making small applications in VB6.0. This language opened a complete new world for me. From C++ to VB 6.0.

It dates back to the Jan of 2006. I was a fourth semester student student at Bharati Vidyapeeth University, Pune and those were the days of college tech-fest, Bharatiyam. I was in the college technical team, softwares division, supervised by Hemant Sahni, who was technical head at that time. He is real good when it comes to application software development. I was initially working with the networking team, but when he found out that i had good VB skills, he asked me to help him, as he was using VB and SQL Server 2000 for this application he was designing. We were making a software to manage event scheduling, registrations, accounts and other details for the techfest. At the same time, another technical head of our University, Siddharth Upmanyu was working on a online c/c++ compiler. (Yea, the same which was hosted earlier on this blog). Somehow i was quite interested in this “online compiler” business. So, i went to him, and asked ‘Sir, how have you made this cool stuff?’. And he gave me a detailed information about the underlying architecture and flow, most of which bounced off my brains. So i went ahead with another question, ‘Which language you used to code all this stuff?’. ‘Perl’, came the reply. I had no clue there was a programming language “Perl”. What kind of a name is this, i was thinking. And then i said, “Perl?”. Judging my expressions, he said “its a language similar to python in some aspects”. And i was even more confused. How can anyone name a language as “Python”. Obviously i had no clue what Python was. But I decided not to make another fool of myself, so i said “Oh Python! Its a cool language” and hurried back home. LoL

After i came back, i did a quick Google for Perl and Python, and decided to learn one of the language. Perl looked a little complex to me, so i went on for Python, and haven’t looked back since then. I used Python for almost everything i had to do programatically!! I had always been in love with Python.

After graduation, I joined Harbinger-Systems, Pune and was working on ColdFusion MX7 and SQl Server 2000. I used Python for some small programs and bot, which helped me in my day to day job. After that i am currently working with Oxylabs Networks, where I am working in a language i love, Python 🙂

This is in short, my love story with Python, a tale of inspiration, aspiration and willingness.