Tuesday, September 11, 2012

Jugaad restaurant. Bicycle kitchen. Delhi

The cheapest kitchen on wheels. Has a small gas stove with a flat pan on top to make and serve naan, chappathis (kinda breads), and a large vessel with pre cooked chana masala (chickpeas). A full meal should cost around 20 rupees.


Monday, September 10, 2012

Jugaad lawnmower, Delhi

Rectangular frame, handles, rudimentary wheels, an AC motor attached to an MCB, wires and of course a whirring blade.

Let's call this Doer John, made in India ;)



Monday, August 27, 2012

ISO 8583. An introduction. Plain and Simple

This post is dedicated to all who have just stepped into the financial transaction processing technology world as we know it and want a primer on one of the most prolific protocols powering this world- the ISO 8583.

Introduction

Almost all of us would have swiped a card or two at an ATM or a PoS terminal (or a Square dongle ;)). At the very least, the card serves as an identity factor. Among other things , the magnetic stripe on each card stores something called the PAN (Primary Account Number). For most credit cards, it is the same as the credit card number printed on the front surface/ plastic.

The act of swiping a card on a card reader essentially involves passing this 'identity' of the card to the electronic sub-system and represents a Card Present type of transaction. Alternatively, one could have typed in this information (card number) on a screen of an online shopping interface but then this would effectively become a Card Not Present transaction.

Anyways, we now have the identity of the card in the electronic form. One of the most popular uses of this information is to let the system know which account to debit. (In case you get confused by 'debit' and 'credit': Debit = Deduct from your card/ account. Credit = Create money in your card/ account. In case you wish to find out more about the Latin origins of the words, start here:Why do accountants use debits and credits instead of simple pluses and minuses?)

Origin

Way back in 1987 (I think), The International Organization for Standardization (ISO) declared a standard called the 8583 to facilitate the flow of transaction information interoperably. I believe Visa and Mastercard had come into existence much before this and some form of interoperability existed even before this standard was declared. The important point is that both Visa and Mastercard had adopted this standard at some point in time. Also, the standard has gone through numerous iterations and various financial institutions have tweaked it to create many flavors/ variants.

What and Why?

So what is ISO 8583? It is one of the many standards describing how to pack certain data fields such that it could reliably be unpacked as well and is mostly relevant for the financial transaction processing world.

So this standard helps the electronic system which reads the card number, the transaction amount and other relevant data fields to pack it all up so that it could be transmitted electronically to a transaction processing system where it could then be unpacked back into individual data components and then processed. It also helps the transaction processing system pack and send the response back to the initiating device where it could again be unpacked and the customer be intimated of the transaction response.

There exist numerous methods for packing and unpacking data. It could be as simple as comma separated fields. Eg: I could choose to send the transaction information as simple comma separated values as:
"1234123412341234,1000,INR,987" (Card Number, Amount, Currency, Merchant ID).

The issue with such a simplistic model of data packing is that it lacks meta information. That is, the message itself does not contain any information on what exactly is being packed in it. Not that it could not have been overcome even with a comma separated version- just that it could get cumbersome. Also, I guess at that point in time, it was important to consider that the packing and unpacking could be coded easily into mainframes, not sure about this one.

Many folks have already begun writing obituaries to the ISO 8583 protocol thanks to the advent of the younger and dynamic (but not leaner) ISO 20022. However, thanks to its proliferation, ISO 8583 will be a difficult one to get rid of soon and hence one way or the other, in this industry you will need to know this veteran.

Principles

The ISO 8583 message is based on the principles that:
a. In a transaction message, you only get to pick any number of fields from a predefined set of fields. So, if you need a field called 'My girlfriend's phone number', sorry, ain't possible.
b. The meta information of which fields are present in the message are also a part of the message payload in a data structure called the 'bitmap'.

Structure

Most implementations contain a few bytes dedicated to a fixed header (eg: ^A^TISO016000010) after which the actual ISO 8583 message starts.

MTI

The Message Type Indicator.
The first 4 bytes describe the message type. Eg:

02 00
which tells that the message is actually a financial transaction request. (The response to this request would also be in ISO 8583 and would carry an MTI: 02 10). Various MTIs exist and can be found on the web.

Bitmap

Now that we know that this is a financial transaction, we would naturally expect a few important fields to be present. But which ones exactly? This is where the bitmap comes into play. It is almost a visual representation of which fields are actually present in this message and which fields are not.

Imagine a switchboard with 64 ON/OFF switches arranged one after the other from left to right. Lets assume that each switch represents each of the 64 main pre-defined fields. (The 1st field is interesting, we will come to that later). For every field that is present in the message, assume that we turn that particular switch ON and for every field that is absent, we ensure that the switch at that position is turned OFF.

For example, assume we had only one field present and if that field was field no. 3, all other switches except the third one from the left would be in OFF position.

If we write 1 for every switch that is ON/ field that is present and 0 for every switch that is OFF/ field that is not present, we get a series of 1s and 0s. This series of 1s and 0s is called the binary bitmap. It is, as I'd mentioned, a linear visual map of which all fields are present in the message payload.


Data Element Map, B64. Binary. 64 bits

Eg:
F2 38 80 01 08 E0 80 0F

11110010  00111000  10000000  00000001  00001000  11100000  10000000  00001111


(all the bit positions that are 1 implies the corresponding fields are present)
Hex  Binary           (Positions that have 1)
F2= 11110010  ->  (1,2,3,4,7)
38= 00111000  ->  (11,12,13)
80= 10000000  ->  (17)
01= 00000001  ->  (32)
08= 00001000  ->  (37)
E0= 11100000  ->  (41,42,43)
80= 10000000  ->  (49)
0F= 00001111  ->  (61,62,63,64)

Bingo, we've just read the map! Therefore the fields that will be present in this message are field numbers: (1,2,3,4,7,11,12,13,17,32,37,41,42,43,49,61,62,63,64)



Note the first bit. Field 1 is a special field which indicates the presence of an extended bitmap. Since this sample message contains 1 on the 1st position, it means that this message contains another bitmap with another 64 bits.

Extended bitmap, b64. Binary 64 bits

80 00 00 00 00 00 00 00
(=hex .extended bitmap field)
(80)10000000 -> (position 64+1=65)

This extended bitmap shows that field number 65 is also present in this message.

Data elements

Immediately after the bitmap, the data elements start serially. From the bitmap we know that fields 2,3,4,7 are present one after the other. All that we need to do is to read them one by one. Each field number has a predefined type in the ISO 8583 definition and has a predefined length. Some fields have variable length in which case the first N bytes provide the length of the field.


Example:

Data Element 2. Length 16. Value : 0000011319353459 = Primary account number
Data Element 3.  Length 6. Value : 011000 =Processing code. 011000 = cash withdrawal
Data Element 4. Length 12. Value : 000000020000 =Amount 200.00
Data Element 7. Length 10. Value : 0804030013 =DateTime DDMMhhmmss
Data Element 11. Length 6. Value : 051028 =Systems Trace number
Data Element 12. Length 6. Value : 083013 =Time, hhmmss
Data Element 13. Length 4. Value : 0804 =Date, MMDD
Data Element 17. Length 4. Value : 0804 =CaptureDate, MMDD
Data Element 32. Length 6. Value : 123456 =Acquiring institution ID code 123456
Data Element 37. Length 12. Value : 192165102801 =Retrievel Ref. No.
...
Data Element 65. Length 50. Value : Customer Withdrawal   =Statement narrative, right pad spaces.


Thats all folks! You've been hereby introduced to the venerable ISO 8583 :). I have only scratched the surface and the intent was a friendly introduction to its structure. There are many more layers involved in actual implementations of the protocol. The following lines could help you learn further.

Additional resources

1.The Wikipedia on ISO8583
2. jPOS - an open source implementation started by Alejandro Revilla and a default choice for many developers
3. (paid) ISO specs: 2003


Sunday, August 12, 2012

Here comes the hot stereotyper

Thinking of someone as being a stereotyper makes the thinker a stereotype stereotyper of stereotypers. Therefore everyone is a stereotype and a stereotyper :)

Thursday, July 05, 2012

Eko CodeSprint 2012



Dear all,

We are searching for some kick-ass developers who have fallen in love with the fine art of coding AND for folks who have kick-ass devs as their friends!

If (YOU are the cool dev dude/ dudette)
{

Fire up your browser right-away and jump on to www.interviewstreet.com/challange/. Register for our global talent hunt/ EKO-CODESPRINT scheduled on the 14th July.


We're sure you have a hundred questions in your mind right now. We will try to answer a few right away:


Do I need to have a computer science degree?
Nope (not that we have anything against a fancy degree). But you do need to be one of the best coders out there.


I am an Erlang guy. Suits you?
Sure! But most of our work is currently done in Java/ C/ C++/ PHP/ Perl. We believe that real coders are multilingual and fast learners in any case ;)


I only speak Elbonian (http://en.wikipedia.org/wiki/Dilbert#Elbonia). I can also do sign language. I barely translated this on some online tool. Me too? 
Unfortunately, none of us are fluent in Elbonian or sign language. We will need you to be pretty fluent in plain old English; reading, writing and speaking.


Anything else you want to bore us with?
Yes. One more thingy- we need you to be dexterous with MS Office and its likes/ clones/ substitutes.

}
else
{

Fikar not! Put your friends network to some good use and you stand to win yourself a brand new iPad (that you can then rightfully show-off in case one of your cool buddies makes in to team Eko.
Just do the following right away: LIKE our Facebook page www.facebook.com/ekoindia and join event https://www.facebook.com/events/394510847252792/


Now to answer some of your questions:
1. Now, I have a thousand good friends on my buddy list. I stand a good chance at winning the iPad right?
Right. But please remember that if your friend does get selected and joins Eko, he needs to have mentioned your name on the application form (and of course, you should have 'Liked our Facebook page :)
2. I live in Elbonia. Could you please ship my iPad there (assuming that I win it)
Sorry. Unfortunately we can only buy and ship your iPad to a valid address in India :(

}


Simple. Right? So what are you waiting for? The last date is 31th July 2012!

Tailpiece:

You must be wondering "what/ who the hell is Eko?". So here goes:

Eko (www.eko.co.in) provides branchless banking solutions to the unbanked and under banked population using next door shops. We are creating a network of Human ATMs, which will change the way financial services are offered. We have handled over a billion rupees in the last year and a half and have served over two million customers.

If you have the DNA to jump of the cliff and try something new, if you want to compete with the best in the world, if you want freedom to do your job then Eko is the company for you because we intend to create this team by hiring the best and giving them the canvas to change the world!

Saturday, June 23, 2012

The (Social?) Enterprise

Social is a wanton word which seems to get hooked with many other otherwise normal words, reducing them to mere clichés. Enterprise, I believe, has been its most famous victim. 

What is an enterprise? Let me shrug dictionary definitions and think of the images that the word conjures up in my mind. I see a tea-stall by the road-side, with a rickety bench and a perpetually running heater sitting under an infinite supply of hot water, tea leaves and milk. The person who runs it might most probably be owning it as well. This enterprise sells a rejuvenating cuppa tea to a bunch of people who seem to cling on to the cheap cup for as long as they could.  The customers it serves. The owner probably returns home and does his bit for running his/ her family. He/ she would also interact with the neighborhood 'kirana' store for a supply of sugar, tea and milk. The vendors. Even the simplest form of enterprises are about an ecosystem, about inter-dependence, sustenance and growth. Maximizing shareholders' value. Delivering genuine or perceived needs of its customers. It is inherently social.

Another image that comes to my mind is the telecom enterprise. A vast array of professionals, equipment and software that run a myriad maze of departments, directly employing thousands, some sections run by other vendors- themselves large organizations, also armies of handset and equipment manufacturers... Their aim, making a person A take out a box from the pocket and communicate with a person B, or even the world at large. The customers it serves. What is unseen is the millions it indirectly empowers. The major operators in India today sell their talk-time through a network of around two million retail outlets. Massive ecosystems that have literally spawned economic activities that simply did not even exists in peoples' imagination even a decade ago! Amazing. Maximizing shareholders' value. Delivering genuine or perceived needs of its customers. Even this is inherently and massively social.

Now, imagine the words 'social work'. What image does this bring up? Do you see the telecom operator as a social worker? Or the tea-stall owner? Why not? Why does someone like Anna Hazaare sound more a 'social worker' than say, Sunil Bharti Mittal? One could argue, that this perception is because of a perception of 'selflessness' of the promoters/ protagonists or the size of the 'cause'. But isn't that a flawed metric and a flawed perception? While 'social' is about the network and the general good that results and about how many people the network affects and not about the first node that spawned it or the center node. Its about the branches and the fruits and rarely about what the seed has become or aspires for itself. Sure, if the seed just bloats itself up into a giant seed with no branches, no fruits, no nothing- that is a genuinely fraudulent, useless and a non-enterprise seed (and must be destroyed). But that seed is so against the basic nature of a seed! Seeds and entrepreneurs must literally give themselves up for the enterprise so much that they no longer resemble the tiny round seeds they were, their old identities die with the birth of their enterprises. Their growth and identity becomes synonymous with their enterprises. I don't see anything wrong with that, infact I think that is very right. That's the law of nature which must be more right than laws made by us.

So, my hypothesis is that the word social is redundant in-front of the word enterprise. It leads to connotations and perceptions that perhaps hide the greatest social workers among us and highlight just the loud, visually jarring ones. To denote enterprises that are genuinely in the act of general bad as opposed to general good, lets boldly call them 'anti-social enterprises' - because they are. 


Now that brings a dilemma, would a mining company that delivers economic development for the country, generates profits and maximizes shareholder value while destroying the local ecology qualify as a (social) enterprise or as an anti-social one? Or, what about the enterprise that manufactures cigarettes ('nicotine delivery devices'- The Insider)? It employs a lot of people and empowers thousands of tobacco farmers while also becoming a cause for cancer for its customers. Is this a social enterprise? Or what about weapons manufacturers? Is the simple word 'enterprise' required for describing these middle-ground ventures with ambiguous leanings? Perhaps when these industries were formed, the benefits far outweighed the then understood ill-effects? Maybe. I am not sure. Maybe, telecom will become tomorrow's tobacco and folks will be blogging (if that would still be in fashion) about its ambiguous leanings then ;). 


For now, for the sake of simplicity, let me suggest that if the ill-effects due to an enterprise are well known, documented and proven, we must simply acknowledge them as 'anti-social enterprises'. Enterprises must not result in threatening Life itself. Simply because 'life' is still something we have not been able to understand, leave alone the power to replace. It is THE most precious thing. 

But till then, lets deprecate the term 'social enterprise' with just 'enterprise'. That sounds more natural and real. And if tomorrow reveals something new, we just need to be open enough to listen and learn (and maybe reclassify ;-).

Three cheers to the enterprises!

Tuesday, April 17, 2012

The changing face of India

These are the outliers; but outliers that point to a trend that will soon become the norm.


(Context: From a recent trip. A barber in a small shop in Jalandhar, Punjab. Not a fancy place; the kinda place where you can still get a haircut for around Rs.50/ ~$1. Where I had a quick haircut and a 'L'Oreal hair conditioning' session cross-sold to me in the process :))
  • Barber.
  • Should be around 25. (Identity withheld on request)
  • Owns a fancy Nokia handset with a big screen.
  • Prepaid mobile customer.
  • Is a migrant worker from a Saharanpur, UP (If I recall correctly)
  • Subscribes to a few GB 'internet pack' for around Rs. 100 a month.
  • He taught me how to download the latest movies and songs "for free" from (a certain banned but extremely popular site songsonline.pk or something like that).

I can see the mobile slowly but steadily taking roots as the first internet access device for the masses in India. Not there yet; but gaining momentum on the way. There is still a majority of people who use basic mobile phones (and these phones; at times second hand or third hand and made in china; have been reported to be available for as less as Rs. 50!). The changing face of India.

Monday, April 09, 2012

Boarding pass outside the airport. Ticket-less on Indian Railways

Sometimes when I travel on domestic flights, I do not take the airline ticket printout with me. The CISF security staff wont let me in without one. So, like most others in my situation, I'd walk to the airline counter outside the airport (these are primarily ticket booking counters), show them an SMS on my phone that contains the PNR number. The folks at the counter then take a ticket printout off their desktops. Now, the ticket printout is only good to get past the CISF guards and into the airport, till the check-in counters. I am supposed to show the ticket and my identity proof to the folks at this counter where they print the boarding pass. The boarding pass then gets me across the security check counter, past the gate and into the airplane.

A few days ago I reached the Bengaluru airport with just my PNR SMS. I walked to the Go-Air ticketing counter outside; seeing that I just had a single hand bag; the lady at the counter checked me in and issued a boarding pass directly! That was a simple step that saved paper and saved me time standing in a longer queue at the check-in counter inside. Great UX improvement by Go-Air/ Bengaluru airport (BLR)/ whoever was responsible for this.

Now, I also had the chance to travel on Indian railways recently. Indian railways is in shambles, the infrastructure simply is decades behind the rest of the world and the massive demands on it. However, ticketing has moved to the next generation :). This time I traveled with just the SMS sent to me by the railways containing my name and my PNR number! The ticket checker, verified this against his roster and checked my identity proof. Thats it! So it was a paper-ticket-less travel. A really great step by the Indian Railways/ IRCTC.

A lot of room left for innovation and improvements in both these sectors.

Happy Easter

'Easter' has a lot of history and a lot many connotations. Even among Christians, the practice and the ritual of Easter varies. For most believers however, Easter is an affirmation of their faith. It celebrates the belief that three days after Jesus Christ was crucified (Good Friday) and buried, He rose again; in fulfillment of the scriptures. Even his closest disciples did not seem to have been entirely expecting this, scared as they were after the rather dramatic events thus far; they actually are said to have run to the now empty tomb. ~2000 years hence, the faithful use this occasion to renew their faith and carry on.

I do not understand the science behind faith, I do simply try and believe. Most endeavors in life seem to be, to me, mere matters of faith. I do hope for faith atleast as big as a mustard seed :).

To have faith is to be sure of the things we hope for, to be certain of the things we cannot see. Hebrews 11:1

Wishing you all a Happy Easter and the days after!

Saturday, April 07, 2012

i, Samsung Galaxy Note

Hi,

This is my story. And I am the Samsung Galaxy Note that hangs around with the owner of this blog. Its been three months since he picked me off the Samsung store someplace in Delhi and I've been with him ever since. To tell you an honest truth, he spends more time with me than his laptop now (smirk)! In fact lately I've noticed that even his kids seem to find me unputdownable :).

You see, I figured out pretty soon that I was way more than a dumb smartphone and smart as I was, I figured that I had to tell the whole wide world my story (before Anupam got any stupid ideas on reviewing me on his stupid blog. I am the self appraisal kind). And I've penned this using my blogger app; no laptops or PCs were harmed in this production. (Update: had to use the laptop to fix the paragraph breaks and the pic positioning. The blogger app needs to get some of its priorities sorted.)

No one is paying me a penny to pen my story. Not Samsung. Not Apple. Not anyone in between. So what you hear here will be an unbiased expose. Plain, simple and raw.

My editor asked me if I was trying to rub off the iPhone charisma on the title of this post. I simply said that 'i' was as much an English word as it is an alphabet and just because some unimaginative American put it before the 'phone' (and the 'iPhone' became a minor celebrity) did NOT mean that they owned the letter i! I used i to simply assert myself as folks have for ages. I certainly am not copying anything!

The first day Anupam held me by his ear to make the first call, some of his colleagues thought he was holding his bathroom slipper in his hand! (i am sure they are myopic and would advise them to consult an optician). I admit I am slightly-larger-than-your-regular-phone but I am not THAT big. I would describe myself as tall, slim (and gorgeous). In case you feel shy holding me close to you, (you're missing something) you could always get a dumb Bluetooth hands-free.

With my 5 and a half inch super AMOLED screen, I show things crisp and bright. Maybe not as glamorous as the retina displays, but a class apart nevertheless.

The only problem I must confess is that all this requires me to have a high metabolism rate and hence the need to get frequently hooked to the power charger. I ain't the marathon type and I ain't the cross-country kind. I am more like the 9 to 5 office goer who is used to the usual niceties of life. So don't expect me to be all charged up by the end of your road trippy unless you'd thought well in advance about hooking me up with your car charger.

I must admit that i can handle 3d graphics and hd video pretty nicely. In fact I think my screen size gives a distinct wide screen touch. Youtube and TED videos? No sweat!

Its the apps on the Android store, recently renamed playfully as Play, that add a zing to my life. I sure don't make Anupam miss his antique Blackberry thanks to the Google mail app (I still don't fancy the Samsung mail client; have simply disabled it). Skype and whatsApp and gTalk do everything to keep him in voice, message and video contact with his kith and kin. Google plus auto syncs all his pics on the cloud. I have a low-res eye infront for the video calls and a high-res one behind that should make you throw away your old point and shoot. Google maps shows directions, places and distances. Unfortunately Navigation does not work in India :( i guess it must be a giant challenge for Google! Book readers, pulse, news apps- you name it. I've got GPS, gyros and accelerometer. I can also double up as a wifi router!

That brings me to my USP. Note. I come with a stylus! Would you believe that? Most folks had thought these appendages were prehistoric and obsolete (remember the palm pilots and the iPaqs?). Well Samsung seemed game to go retro. As i'd said, you'll only hear the honest truth from me. So here goes. The truth is; I still ain't a substitute for the good 'ol pen and paper as far as note taking is concerned. However, if you feel artsy, boy can I inspire a masterpiece? And kids simply love me. I have a whole range of stuff for them to touch and learn. Drawing apps, jigsaw puzzles, games and a cat that repeats what they say.

I do have my quirks as well. For instance, imagine you were calling up the customer care number for your bank; now the IVR plays: "press 1 for this and press 2 for that". By the time you want to press 2 the screen gets locked (timeout?). Now you have to go through the entire phone unlock routine (which at times screws up). Once unlocked you've got to pull down the top tray, then click the green phone icon. Then the keypad shows up. Now if you're not lucky enough; do expect to drop that call.

With all the tech wizardry and the buttonlessness, I realized that for my makers, making the good 'ol phone call was a lesser priority. Another case to the point. I have what is called an integrated address book. I can aggregate all your contacts on your sim, personal email, official email, facebook, twitter and what not. Result? I have over 300 contacts in triplicate and 400 duplicates. So Anupam has to figure out which of the 5 Anjus listed on his contacts holds the latest phone number of his wife! (he better remember his better halfs number, i'd say). I think id have done way better if i'd been designed with a simple green button and a red button; atleast on the edge if not on my face.

All said and done, i'd consider myself closer to a laptop than a phone but still have the slim looks of a phone. And I definitely ain't cheap. So if you wanna have some fun on the go, at home and in your workplace then its me you've got to befriend. If you're still looking for a plain phone or a long distance runner, look elsewhere.  5 million of my brothers have been 'placed' so far and counting. Samsung has also promised an ICS update for me soon. Dreaming about it! And don't dare dropping me, it would break my heart, display, my cheap plastic exoskeleton and your bank account.

So long folks. Adios amigos! Get a work life balance :)