Google App Engine function views in python
To add a handler in GAE for python, what one needs to do is add a class derived from BaseHandler and implement the “get” or “post” function. After that, you need to add the URL this handler handles to the routing table. I just thought this is too much work for adding simple handlers. What I needed was a flask like simple implementation of handlers. So with a little bit of decorator magic (which some may frown upon), I wrote a small code to achieve this. It does not handle more than 1 method on a single url, however this can be easily added. So if you do add this feature, drop me a line.
Run Lola Run
Another Saturday night, and yet another coding marathon. Despite an increasing amount of pressure on the office front (I am working on an interesting project there too :)), I successfully squeezed 8 hours of coding for “Online SMS” (Really need to change that name).
A user of “Online SMS” told me about certain chrome extensions blocking Google API access from 3rd party websites. Plus, a few reddit users had previously complained about the authentication popup which comes up everytime a user visits Online SMS. So as a first order of business, I decided to ditch Google Contacts and instead fetch contacts from user’s phone directly. Status: Tick
Group SMS is another thing that has been bugging me. I have come up with a strategy for it though. Will code it up soon. Status: Still in wings
Name. Still looking for a good name for the product. Status: Actively Seeking
Design. This is the biggest pain point. Fortunately, I have finally found someone who has agreed to design the website as well as the app. :D. Status: Almost there
Interface Improvement. Since I am not using Google contact anymore, I do not have images of contacts for display purposes. So I turned the contact display into a list instead of a grid. This meant a lot of empty space in the middle which I filled up by allowing multiple chat windows. Its looking cool to me. Lets see how you find it. Status: Tick
Apart from above, there is much I wish to get to soon. MMS, SMS backup, Free chat between “Online SMS” users. And of course, any new feature that you guys wish “Online SMS” had. Do contact me via this blog.
I am looking forward to next Saturday. Hopefully I will knock off a few more of the unticked stuff. Then, I will go and get a life. :)
Anyway, thats it from me this time. Happy New Year and all that shit.
And as always, here are the links:
Android app: Online SMS
Website: Online SMS
Breaking Fad
Breaking away from my cycle of working on Saturdays, this time I hacked for about 4 hours on Thursday night too. So including 2 hours that I spent today, total hours invested on Online SMS is close to 22 now. Majority of the work on Thursday was in designing the Landing page (and I love how it looks now).
Below is the list of changes made to Online SMS this week.
Landing page redesign. Lots of colors and shadows and icons. Not my domain really, but it was fun nonetheless.
I changed the interface for sending SMS. The interface looks more like a chat interface now with a view of recent messages exchanged between you and the contact.
For every SMS sent from website, chat box will be updated to reflect message delivery instantly.
Similarly, if you receive an SMS while you are on the website, you will get a notification of the same. In case you are on the chat box of the same contact, the history will be updated with the new message.
On the app front, any SMS sent from the website will now appear in your Phone’s inbox.
Nothing else to add right now except a small request to everyone to start using the service more. It will motivate me to add more and more features and make it even more usable.
Android app: Online SMS
Website: Online SMS
Brand New Landing page of Online SMS. Visit the site here
Life of FY
I am stuck.
For the second straight Saturday, I worked on the same project (Online SMS). I could have gone out and watched “Life of Pi” or “Hobbit”. Or completed watching “Breaking Bad” season 5. And many such useful activities. But I remained glued to my computer from the moment I woke up (4 PM) till 12AM.
Why? you might ask, well my last blog post on the Online SMS project received encouraging comments on HN. I got sucked in and decided to enhance the project, and in the process remained stuck to my computer the entire day.
So the things I set out to do were:
1. Integrate with Google Contacts
2. A better interface
3. Handling long messages
4. Conversation
5. History
6. Group SMS
Here is the status for each
Integrate with Google Contacts
Status: Done
I did this client side and so there is a popup which appears and gets blocked by browser. I have tried to prevent it but I am not sure. To get it to work, just allow popups from my site on your browser.
The Google Contact API sucks.
Better Interface
Status: Work in Progress
I am really bad at UI and design and everything that could make things look pretty. But I have stretched myself here and have come up with, in my opinion at least, a decent User Interface. Of course, you will be a better judge so take a look and send me your feedback.
Handling long messages
Status: Done (I think)
I used sendMultipartTextMessage without reading up much. Long SMS is taking sometime to get delivered. I will look into it when I have some more time to spare.
Conversation
Status: Done
What I have implemented here is that the moment you send an SMS to a contact using sms.fauzism.com, that contact gets added to a list. From now on, every SMS received from this contact will be relayed to server by your phone. Thus, you can click on the contact photo on sms.fauzism.com and view history of all the messages exchanged since you first initiated the conversation.
I am capping the history at 10 messages right now. Will increase this later.
History
Status: Done
History is available on a per contact basis in the dialog box that pops up when you click a contact’s photo
Group SMS
Status: Pending
This would be a good feature to have. I need to think of a good interface for this. If you guys have any idea of how the UI/UX should be, do chime in.
If you have an advice for me or feature request, please please please, leave a comment below.
Android app: Online SMS
Website: Online SMS
Once Upon A Saturday
This Saturday, I concocted a new application. Quite a useless app but fun to build anyway (and it took me around 8 hours to build). Its called Online SMS.
Its made of 2 parts, an Android app and a Python GAE Server. Here is how it works
1. Install the android application. (Online SMS)
2. Once you launch it, you will see a login screen with a list of Google accounts active on your phone. Choose anyone and you get registered on my server.
Behind the scene, the app registers itself with GCM using Urban Airship and sends the registration Id along with the email you selected to my server.
With this part done, now you don’t ever need to launch the app again.
3. Now you can visit http://sms.fauzism.com. To login, you will need the same Google account as the one you used in the Android app. For most users, this would mean that you login into your Gmail account and then come to my site and click on the “Gmail” link.
4. Once logged in, you will see a form asking for a phone number and message. Type these things in and hit Send. The message will be relayed to your phone which would then send it as an sms to the phone number you entered. Now if this isn’t useless and inefficient, I don’t know what is.
The code is available on github.
https://github.com/spicavigo/onlinesms_android
https://github.com/spicavigo/onlinesms_server
Few things I would like to add sometime soon would be
1. Fetching contacts from Google
2. Group SMS
3. History
4. Long Messages
Lets see when I come to it.
Riak - Map Reduce with Secondary Index
I could not find any examples of how to use Inputs from a Secondary Index query in Map Reduce. So I looked at the source code of the Erlang client of Riak and found this
- {modfun, Module::atom(), Function::atom(), [term()]} |
- bucket() |
So this can be used as following for a range query:
- riakc_pb_socket:mapred_stream(pb_link(), {index, «“my_bucket”», «“field1_bin”», «“start_range”», «“end_range”»}, [
- {map, {jsanon, Source}, «“filter_notfound”», true}
- ], self(), Timeout),
Bravura - First Look
My latest project on GitHub.
Bravura - A Visualization tool for Time-series data.
It requires mongodb, numpy, and web2py. I plan on removing web2py dependency and ship it with some sort of self contained web server.
Apart from that, it uses Flotr, isotope, jquery and protoype on the front end.
I have committed the first draft. Its a shitty piece of code right now, but I mean to improve it soon.
You can of course start using it even now. Check out the screen-shots.




I spent a lot of time choosing the color palette. Time well spent!
To Shalu
Shivling : Avoiding boilerplate in views in Django
I have been unable to find time to continue my Shiv series, however, a chat with a friend(@arihersh) who has just started learning django reminded me of a small piece of code I had written sometime back. The chat went something like this
