Archive for the ‘Web 2.0’ Category
Getting back to the drawing board…
August 3rd, 2008

Drawing boards are so much more fun than paper’n pencil ![]()
Posted in ApnaBill, OpenSocial, Rails, Ruby, Startups, Web 2.0 | Comments (0)
Head on with OpenSocial - Orkut Apps!
August 1st, 2008
Pushing ApnaBill.com into a Zarro Boogs state suddenly gave me the much needed time to start tinkering with other things in the roadmap. Hence the next obvious destination for me was OpenSocial - about which I’ve been hearing for quite some time now, almost everyone I know is writing some sort of social apps (FaceBook or Orkut)… moreover, these apps can bring a whole new sense of visibility to ApnaBill.com.
Thanks to Rohan, I started off with an inclination towards Orkut apps.
I must say, Google has done nice job of documenting the OpenSocial API’s. The starting point was ofcourse Orkut developer docs
- OpenSocial tutorial for Orkut
- Anatomy of an Orkut app
- Orkut Developer Guide
- API’s : OpenSocial, JavaScript and Gadgets
Ofcourse, to use any of these - you need the Developer Sandbox access to Orkut
The docs and the presented examples seem all good - but if you are a first time OpenSocial developer, the disconnect would be very obvious to you - specially how the OpenSocial API’s and Gadget API’s and JS API’s are all connected.
What I understood from all the reading was that OpenSocial is a set of API’s which all conforming web services expose. Each of these web service (Orkut/Hi5/etc) is a Container and each container exposes some proprietary API’s as well. So if you are developing an app which is to be deployed across multiple websites, make sure you do not use any proprietary code.
And what was the best way of understanding the codebase? Read the Examples! All of them! The more you read them, the more you would be able to the connect between all ingredients of OpenSocial API’s.
OpenSocial apps are primarily HTML and JavaScript - styled using CSS. The HTML forms the display of your app while the JS (bulk of your app) helps you fetch and render the data to & fro from your web service (Orkut/Hi5/etc).
There’s something interesting to note here…
Orkut’s sandbox environment requires your app to be stored on a publicly accessible location. That mean, if you have a website where you can host your JS/XML/CSS - you are good to go instantly. If not, try the Google Gadget Editor and save your files on google’s server.
I was lucky when it came to app hosting. Tata Indicom in Pune, gives static public IP’s for postpaid broadband connections. That means if I run apache on my server and dump my app files on /var/www/orkut folder (Ubuntu) then I can edit the files on my local machine while Orkut sandbox environment can fetch them straight from my machine - awesome! Now I get to use my favorite editor… yay!
As you can see, my app does nothing intelligent - just lists my friends and their details. But what’s interesting is, I can detect at runtime that which view is being rendered - is it app’s main view or is the app being shown in my profile.
Think of this in more productive sense. If I am building an app for ApnaBill.com (lets say), I can display summary or something on the profile view and a more detailed analysis of the same thing in the app view - isn’t that interesting
What’s next? - Giving purpose to my app!
My example codebase - app.xml, canvas_view.js, profile_view.js
Please replace REPLACE_ME_1 with path to canvas_view.js and REPLACE_ME_2 with path to profile_view.js
Note - I am learning JS as I am proceeding with OpenSocial apps. Please use the above code at your own risk.
[update]
I am a big fan on “Emote” application on Orkut - so decided to examine how it works… loaded up Emote and inspected the “net” tab in Firebug and found this - http://www.rockyou.com/google_apps/emote_example/view/Emote_XML.php -if you can see, Emote is using completely different set of HTML for canvas and profile views. It also has included “dynamic-height” feature to hide the nasty scrollbars - interesting! You might also be interested in checking out the localization technique and the app headers - lots interesting information is there on how they should be used.
Posted in ApnaBill, OpenSocial, Web 2.0 | Comments (6)
Zarro boogs found!
July 31st, 2008
This is the sweetest possible message Bugzilla can ever show a developer ![]()
Tonight, I’ll be syncing live ApnaBill.com with the most stable version we ever had - the operations are still getting formalized but the code-base looks awesome!
If you come across any bug @ ApnaBill.com, feel free to ping us at our support channel - who knows, you might just save the day for thousands of users ![]()
Posted in ApnaBill, Ruby, Startups, Web 2.0 | Comments (0)
Proto.in July 08 Edition
July 21st, 2008
The atmosphere was electrifying at Proto4 - and the talks were doing everything to make the conference even more interesting!
The presenting startups didn’t got much time to attend the conference talks - we were quickly rushed for the rehersals which were to prepare us for the upcoming showcase on 2nd day of the event. Helping us all along was the great team of Proto - which made sure that we had everything we needed to be ready for those 6 minutes of showcase - a big thanks to the Proto Team.
A quick presentation from ApnaBill kicked off the rehearsals - we fumbled alot, were mixed up alot - and the feedback was all worth it. Just a quick work of advice - never go to a presentation unprepared. ANY preparation is better than NO preparation
After the day of reharsals, we mutually decided that Sameer would head our pack onstage. He did a nice job with the presentation and I guess our point got communicated across to the audience pretty well.

Sameer presenting ApnaBill.com to a hall packed of audience

ApnaBill.com team (Sameer in front (second from start), Me and Sandy)
Before the day ended, each startup demo’d their products on the stalls. Checking out the stalls were potential users and investors alike.

Me posing with ApnaBill.com (ghosh! that right click…)
Here are some goodblog articles which described the event pretty well.
Rishabh from Mutiny.in - Proto.in goes North
Amit Ranjan from Webyantra - Proto IV at New Delhi: Impressive show for startups, entrepreneurship & technology
Slideshare - A list of startups showcasing at Proto4, Proto4 pictures
AlooTechie - Proto 4- A Winner’s Showcase
* More pictures and videos to follow…
**Pictures courtesy Amit from Slideshare.
Posted in ApnaBill, It calls for a blog..., Proto.in, Startups, Web 2.0 | Comments (5)
A teaser from ApnaBill.com
May 30th, 2008
The current week is just halfway through, but it has already been one of the most eventful week for ApnaBill.com - with some definite advances towards the release. We’ll be launching the live pilot mode release in just days time.
More good news - we’ve expanded our network coverage from a handful of operators/cities to a pan India coverage.

We’ll be supporting 16 different prepaid vendors across 14 different geographical locations - I must say, that is a mighty list!
And to give you a small hint with what’s in the store, I present to you, bits and pieces from ApnaBill.com UI - all this and much more is just waiting to go live!

All the hard work that has gone into cross browser support…

A self-explanatory teaser on the front page

Another teaser

The prepaid coupon types we’ll be selling…
![]()
Secure transactions - with subtle hints on the UI

And of course, the ubiquitous help!
Please do signup for our Beta Release if you have not done so. The Beta Signup is still open.
Posted in ApnaBill, Ruby, Startups, Web 2.0 | Comments (2)
Making web a prettier place!
May 10th, 2008

As we speak, CSS goodieness is oozing out of ApnaBill.com developer codebase. I just wish if I could paste some screenshots of our work here…
Anyways - that time would come! ![]()
Posted in ApnaBill, Web 2.0 | Comments (0)
LITBox helper for Rails
April 24th, 2008
Introducing - LITBox Helper for Rails!
Disclaimer: This is a work in progress and is available on “as is” basis.
For long, I was trying to integrate Criag Ambros’s RedBox plugin into ApnaBill.com project for implementing modal dialogs but somehow, the CSS always used to get upset, rendering the lightbox in such a way that the content which is to be shown inside it, shows below it.
Then I came across Ryan J Lowe’s LITBox(The site seems to down, try Google cache)- and boy, it rocks! Just 10 seconds setup, very light weight and looks brilliant! The code is nicely written too. But the only drawback was that it was plain JS stuff - so that means no Rails helpers available.
So, once the test implementation was done with, I decided to write a small helper myself. I’ve seen how Jorge’s Prototype Window Class’s rails helper works - so decided to base my code on the same lines. And since he’s already written the Ruby->JS part for converting between optional arguments, this didn’t seemed a daunting task even for a Wednesday night
-
-
# Based on Prototype Window Class Helper (http://pwc-helper.xurdeonrails.com)
-
-
module LitboxHelper
-
-
def params_for_javascript(params) #options_for_javascript doesn’t works fine
-
‘{’ + params.map {|k, v| "#{k}: #{
-
case v
-
when Hash then params_for_javascript( v )
-
when String then "‘#{v}’"
-
else v #Isn’t neither Hash or String
-
end }"}.sort.join(‘, ‘) + ‘}’
-
end
-
-
-
# Returns a default LITBox window.
-
def litbox_window(link_text, href, html_options={}, params={})
-
prefix = "<a "
-
# Add all html options as key="value" pairs
-
html_options.each do |k, v|
-
prefix += "#{k}=\"#{v}\" "
-
end
-
prefix += "href=\"javascript:void(null);\" onclick=\""
-
-
# JS Payload
-
payload = "new LITBox(’#{href}’, #{params_for_javascript(params)});"
-
-
# Rest of the stuff including link text
-
suffix = "\">#{link_text}</a>"
-
-
return prefix + payload + suffix
-
end
-
-
end
I’m trying to make it feature complete so that I can make it available for download.
Till then… happy hacking!
Posted in ApnaBill, Rails, Ruby, Web 2.0 | Comments (5)
Meeting Entrip.com guys…
April 19th, 2008
The day was very hectic… was up @ 10 AM, saw “Horton hears a who” @ 11 AM, had a quick breakfast @ 1PM, started for LCG meeting @ 3PM and then finally met the Entrip.com guys at 6PM - all as I planned yesternight
…and by now I am dead tired - just enough of me left to write this post
The meeting with Entrip.com founders was special because we were kind’of resonating at the same frequency, the same enthusiasm and that energy. Of course, the thread which tied us all together was Rails


EnTrip is an integrated travel utility which enables you to:
- Plan or map out your entire trip, using our intuitive map-based interface
- Capture the experiences and vivid memories that make up your trip, within their geographical context
- Easily share your adventures with friends and family around the world, in a meaningful way
If you are interested in how it works, try out the founding team’s trip to India.
I wish them a ton of good luck for their project.
Posted in ApnaBill, GNU/Linux, Startups, Web 2.0 | Comments (1)
Back to the basics - validating HTML anyone?
April 19th, 2008
Its almost 4 AM now & past 3 hours saw a lot of commits going into ApnaBill.com code. After realizing that we were not generating (X)HTML code, the effort was targeted at containment, if not eradication
Many thanks to Zundra for pointing this out to me.
Due to an open div tag, the new (& slick looking) navbar wasn’t showing up on IE. HTML cleanup frenzy atleast solved that problem…
Here is what’ve changed in the code so far (straight out of our changelog)
- Fixed a typo in recharge layout, a div tag was left open…
- Added type=text/css attribute to many style tags.
- Corrected CSS markups, removed dups.
- Added type=text/javascript attribute
- Cleaned up recharge layout, removed closing slash in self ending tags.
- Moved critical developer comments into ruby comments
- Moved hover box font=+2 to CSS
- Added invite section to navbar, removed the top-left badge.
Phew! Thats enough work for the night… onto some hollywood flick now!
Oh yes, btw, tomorrow’s a pretty hectic day. I’m watching “Horton Hears a Who” at 11AM, then going for LCG Meet at 3PM and meeting folks from www.entrip.com at 6PM. Wow! Now thats some schedule!
Posted in ApnaBill, Rails, Startups, Web 2.0 | Comments (2)
Migrating ApnaBill.com to SqlSessionStore
April 5th, 2008
Rails2’s client side sessions were starting to give us troubles as we were ‘kinda’ overshooting the 4kb limit almost every now and then. Idealists would say that thats a bad practice - and I agree - but the changes now run too deep to fix them, withought having to change/throw a lot of code.
It seemed much better to fall back to server side sessions than client side. A quick search and ActiveRecordStore is one of the chosen techniques after PStore. Another quick search and you’ll come across SqlSessionStore which is much faster than ActiveRecordStore. [Comparison of various session management techniques]
Installation and configuration was super quick (thanks to the plugin) - follow the README.
However, one issue that you’ll need to address is to get mysql-ruby installed.
The next issue that’ll stare at you in the face is to constantly keep the sessions table cleaned up. And I faced a peculiar problem solving this. The timestamps of “updated_at” were running 4 hours behind the Time.now value. So stock solutions available for this problem were not working perfectly. I had to subtract an offset of “4.hours” from XX.minutes.ago value to get the correct timeouts.
desc "Cleans up stale sessions." task :clean_stale_sessions => :environment do # Determined by manual inspection. offset = 4.hours CGI::Session::ActiveRecordStore::Session.destroy_all( ['updated_at <?', YOUR_TIMEOUT.minutes.ago - offset] ) end
Hence Solved Bug #69, which solved Bug #67 and Bug #15 - wheehaa!
Posted in ApnaBill, Rails, Startups, Web 2.0 | Comments (0)
Startup Lunch - This Friday!
April 1st, 2008
Ever experienced Speed Dating?
As finding friends/partners is to Speed Dating, finding investors/future-employees is to Startup Lunch.

Startup Lunch is an initiative on the lines of (and by) Proto.in and in concept, is very similar to speed dating.
The startup founders are seated on one side and the candidates get to say hello and have a quick conversation to talk about what the background of the founder is, why he started the company and what sort of person he is looking for, while asking questions to the candidate about the reason to join a startup and what his/her passions are and ten minutes later the same process continues with the next founder. Within an hour, you would have met/spoken to most of the startups, and by the end of the day would know whom to get in touch with for your first/next job.
The event, at present is organized across India - in Bangalore, Chennai, Mumbai, Delhi, Pune and Hyderabad.
Luckily, Pune’t meet has been clubbed with Open Coffee Club Meet. More details about the startup lunch are here
Its an unique opportunity for me - I’ve never met another budding entrepreneur in person - specially when he/she has a business plan in his/her hands. It would be awesome to see what all my peer fellas are upto. And specially important to see how ApnaBill.com is received amongst them.
Oh yes, I’ll be giving a short intro about ApnaBill.com at the Startup Lunch. More about it later…

Can’t really wait till Friday! Can you?
Posted in ApnaBill, Life in Pune, Startups, Technology, Web 2.0 | Comments (5)
Designing a logo for ApnaBill.com - weekend stuff!
March 1st, 2008
I “might” be good at many things - but when it comes to designing with a mouse, I’m absolutely pathetic! One major reason for this being I lack the patience to sit in front of the PC and keep iterating over - and over again - on the same image - design and modifying it each time till that wow thing happens! Top that up with my (almost) color blindness to any other color than RGB - and you can understand how my designing skills might be
Anyways, this week, I was seriously trying to break that jinx. Reading a ton of Photoshop tutorials (Smashing Magazine has a pretty nice collection!) and trying whatever I could.
This was not a sudden liking - but rather a revelation.
Of all the parts that form the web development process, designing is a major part of them. If your stuff is not visually appealing, all the logic behind it would never go mainstream because your users would never come in the numbers you expected. WYSIWYG works most of the time! - specially when you are forming those first impressions…
Also, over the time, I had started to realize that I’m being dependent on others for each and every graphic design related task. Even a small change & I had to bug my friends to help me out.
So thought - lets change all that. Lets learn some Photoshop over the weekend!
These are a few designs I made for ApnaBill.com - our Beta Launch!

This was the very first design I created this evening for ApnaBill - the blue dot was pretty odd though…

This was next in line! This turned out to be more wider than I had imagined it to be…

Another quick one…

The original logo - just modded with that Beta badge…
And while I was upto this, I did managed to freak out on some glyphs! Check this out…

Posted in ApnaBill, Web 2.0 | Comments (7)
Brilliant theme + Few hours = All sexed up FourFractions.com
February 25th, 2008
Dont trust me? Check this out!

Old Four Fractions - cooked up in 1 hour flat!

Muaahh! The new Four Fractions is so damn hot!
I still cannot believe that I have created such a beauty. The new logo, the new modded theme - both look awesome!
The theme used here is Hemingway by Warpspire. The logo was created using simple shapes. Mods were done using the ubiquitous Firebug.

The new Four Fractions logo
Stuff in queue…
- The Four Fractions logo can still be better
- Write a small explanation about how this logo signifies Four Fractions
- The search box needs to be modified to include a background image
Seriously - this is one of the best design modification attempt I ever made!
Posted in ApnaBill, Startups, Web 2.0 | Comments (0)
Issues, issues and bugs - squashed!
February 10th, 2008
This weekend, I was bogged down with concurrency related problems with ApnaBill.com - all of which were solved with the 62nd svn commit.
Different scenarios which we thought could have been possible
- User A and User B both attack the same coupon at same time
- User B tries to lock a coupon which was previously locked by User A
- User A tries to lock multiple coupons at time - knowingly!
- User A accidentally locks multiple coupons at a time
More problems arise specially when you have no control over the payment gateway pages (ie. when you are using a redirect to a payment gateway).
- When does the timeout occurs
- What happens if a timeout occurs
- What if the transaction was _killed_ midway
- How to deal with timeouts and locking/unlocking mechanism, etc

The newest addition to ApnaBill.com code in the payment gateway interaction arsenal
Luckily, almost all problems were solved for ApnaBill - All we expect from the user is to follow what’s shown on screen. Even otherwise, he should be good! For everything else - as they say - is the dear support staff
Like that alert box? Try http://www.bioneural.net/2006/04/01/create-a-valid-css-alert-message/
Hmm, I think, we should profile all the user displayable messages before we launch. I want to make sure that all have the same tone.
PS: Me and Sandy have never brainstormed more on any other issue than concurrency handling.
Posted in ApnaBill, Rails, Startups, Technology, Web 2.0 | Comments (0)
How to effectively deal with a redirecting Payment Gateway and prevent a possible DoS
December 16th, 2007
I am at a position where I have to think in advance that how should I be coding the interactions with our (redirecting, not API based) payment gateway. What can be the best design practice - for us (as a coder), for our website (as a product) and for the end user (usability).
Keeping everything in mind together and working towards a solution is interesting. It made me think pretty nicely to come up with a solution which satisfies all scenarios (except the ones, over which I have no control).
Scenario
Your website X uses a Payment Gateway (PG). When a user Z initiates a transaction (Tx) - a Tx ID and amount value (minimalistic variables) are sent to the payment gateway. On the shopping cart side, the product which Z is buying, is locked inside the database so that some other user should not buy the same product. If the user makes a successful Tx with PG, your shopping cart is notified of the status & everyone is happy!
Problem Statement
Issues arise when the shopping cart is dependent on timeout values from the PG. There can be two worst cases in this scenario…
- The user Z closes the browser (before completing the Tx) after he successfully opens the PG. By doing so, your shopping cart locks the product in your DB but is never able to unlock it back (because you will never receive a timeout communication from the PG) - until unless you run a separate thread or a cron job which keeps on freeing up locked products based on timeout value. If you have a large online store, doing 10000Tx simultaneously, this problem would lock 10000 of your products for the entire timeout value (in case an attacker launches an intelligent DoS on your store).
- The user Z just keeps the browser window with PG open. A timeout has to occur before it is communicated back to the shopping cart.
Solution
Note - I have not yet implemented this in any of my products - this is just a theory!
In the first scenario, open up the payment gateway as a frame inside your website - with you controlling the top header like frame & the PG controlling the other frame. Further, create a constant pingback AJAX connection to your shopping cart through the top frame. Once the AJAX connection dies, you have an almost sure shot way of knowing that the browser is no more alive, or Z’s is no longer connected. Your cart logic can then take appropriate actions of unlocking your product. - This solves problem scenario 1
The second scenario is the worst of the worsts! Browser has not been closed, and the user Z can make the Tx anytime before PG expires his Tx. What we can try here is put up a javascript clock which keeps ticking like a timer - again, we can use our top frame as thats the only part that we control when a PG is displayed. This will keep informing the user about the urgency to finish the Tx. This timer can change colors from green to yellow to red, signifying increasing priority, etc. Moreover, on the server side - one can either have a separate thread/cron-job to unlock the locked products - or - before any new access is made to the locked up DB, the cart logic an check up which all Tx’s are in a stale state & free them up. This will surely slow down the system a bit, but this would almost render the DoS attack useless. That solves problem scenario 2.
This is just my maiden attempt at Payment Gateways. If you think, I can improve my idea, feel free to add your suggestions in the comments section.
ApnaBill.com would be definitely using some (if not all) of these concepts.
Posted in ApnaBill, Rails, Startups, Technology, Web 2.0 | Comments (0)

