06 September, 2013

Back....

Hello World,

Its been a while. I was busy working with Polycom as a Software Developer Intern in a product called Millennium - 360 degree panoramic 1080p video solution which would hit the market shortly. Hopefully everything goes well.

Alrighty... So what I got now..I came across one thing recently which I thought I would share.

So everyone would have used wikipedia atleast once. So how do you print a wiki article?

Open the wiki page  -> Chose Print option from web browser ? Is that what you think...
Won't the pages look disordered with images scattered and contents not justified properly......
What if you want to combine many wiki articles and take printout?
 Do you download all html pages and print each page? Isn't this annoying?

So wiki has come up with this ( I'm not sure when it was ) concept called "Book Creater".
If you had already known about this, there is nothing new I'm gonna tell.
For those who doesn't know about it, go on.

Goto wikipedia.org main page (http://en.wikipedia.org/wiki/Main_Page)
Under Print/Export in left pane, chose create a book -> Start book creater.
Now you can visit any wiki pages you want and add to your book. At the end, this can be downloaded as a pdf which can be later printed or you can read it using your gadgets. Cool isn't it :)

This is such a nice feature which I didn't know earlier :)
Anyways, hope you can make use of this cool stuff.
Take care guys.  Will come up with articles as and when I learn new things or something strikes my mind.

17 April, 2013

Self Modifying Code

Sorry guys. It's been a while. I'm near the end of Spring Semester with hectic things ahead.
In the mean time, I thought I would post something for us to chew.

Okay this post is about Self Modifying Code which I came across recently in my course work
where there was a line "The issues with Binary Translation (VMM) is Self Modifying Code".

 Lets not look into VMM aspects, rather I shall restrict myself to the later.

What is Self Modifying Code?

Program that purposely alters its own instructions while executing.
Something like a chameleon :-)

If we write a code that improperly manipulates a buffer then its a self modifying code :-) leading to crash.

Questions arise as to why we need this kind of code for which I would suggest to read the wikipedia article for its usages.

Of-course one can use this to create viruses ! making life difficult for anti-virus programs / honeypots.

It is not the code that gets changed [ Of course it needs to :-) ] but the executable that needs to change while its running. This restricts us to OS specific.

Say suppose we have a program emitting some output. Now lets open the executable using
hex editor, modify the executable to emit a different one.

If we see windows updates, its evident that program which is in execution is closed, re-written and started again. Can't this be done while the program is in execution?

Consider a huge deployment where there is a small bug with respect to your component.
The fix is just adding a check or changing some macro.

Instead of rebuilding the entire component,  is it possible to write a small piece of code ( a function ) which could tweak into image of running file and fixes the bug by altering it.
This would be of great help. isn't it ? :-)

So how do we do it?  I'm also trying it.
In the mean time, you guys too can try.

Lets state our objective

a) We know the operating system where our "*.so || *.exe || *.sl" is running.
b) Our objective is to tweak this executable for a minor fix that was found in site deployment.
    [Note : we are not supposed to restart the process]

Have fun while trying :)

30 March, 2013

What is it like for an Indian student to pursue MS/PhD from a US university?

    Courtesy : Quora

    Before I answer this question, I would like you to know that I am not from one of the premier Institutes in India . What I say henceforth is largely from a view point of an average Indian pursuing his/her graduate studies in the United States. I will warn you that this is going to be a subjective analysis and more like I am venting out my frustration against fellow Indian students. I know I am likely to draw a lot of flak for this and may fetch comments like I should check out some of the top schools, but yeah well, I am in one of the top CS programs and things are no different from a 2nd tier school. You can only imagine the shock I felt.

    The American way of life.
    Folks here are largely individualistic. And I applaud them for being so. I might have seen only a niche group of Americans here, but I can safely conclude that they are polite, humble and most important of all, have this extreme passion for a godforsaken field that we, status loving, name dropping folks, are largely alien to. I know of a American teammate who is crazy about collecting motocross statistics and he is pretty serious about it . The passion is so infectious, it makes me go weak on my knees, to the point of being mistaken as someone experiencing a hot flush. No kidding. There is just no match to the passion these guys have.

    Point to be noted: They are one of the few groups that go on a vacation during Spring Break, mostly because they are disciplined with their work and manage their time well.
    .
    Occasionally, I do run into some whack-jobs who are anti-abortion or anti-gay, but that's a minuscule number and doesn't represent the whole. Americans in general are a private lot, love sports and take a great deal of pride in who they are and what they do.They could be running your local grocery store and they are mighty proud about it. Unlike us who look down upon anyone not a Computer Science Engineer or a Doctor, they are less pretentious and more open to failures. A Stanford graduate never talks about his pedigree because he knows what it is to be subtle and he knows that it is the idea that matters more than where the person is from. I appreciate this quality a lot and I only, only wish we, as a nation, embraced it.

    We all grew up in a place where there is so much noise about all things personal : grades, salary, property details to the precision of the last decimal point. That way, it is a breather here because almost all conversations with the non-Indian graduate students revolve mostly around their various hobbies, their interests, ideas and some dry humor. No one asks you whether you secured an internship or a job . They will never ask you your grades and will never question you if you are seen talking to someone from the opposite sex. Privacy, civility and respect is almost embedded into their culture as is lack of personal space and lack of sense of individuality in ours. I seldom hear them say "Oh well, when I was at Stanford, I got job offers from X , Y and Z!

    The Indian way of American life:

    The culture shock I experienced was from the Indian Community : There will be a certain 'Indian Student Association' in your graduate school. My two cents on this one. Run like Usain Bolt from them. Run as fast as you can. Their sole reason for existence is to display their 'accomplishments' in the pretext of on-boarding freaked out freshers like us. I could hear imaginary trumpets blaring when I got introduced to a couple of them. This is where your brainwashing begins and your starry eyed dream of an international experience begins to fade with the song-dance gala welcome party and samosas. And god forbid you are from the meek (elegant, I would say) southern part of India, you will probably receive 'light-hearted' racist comments about your 'Madrasi' idlis and sambhars. These are the same folks who extend their sincere support when one Mr.Khan gets questioned by the TSA and cry foul about how racism is rampant in the western world. These guys cannot differentiate Chennai from Bangalore from Hyderabad and even Orissa. Goodness gracious. I don't even want to comment on poor East-Indians. Double standards, not new right?

    Soon after, you will mail your Indian senior graduates asking them for suggestions on courses to choose, professors to work with, projects to work on, all with the primary intent of landing a plum job with a very well known firm. Things are often exaggerated (like the Indian weddings), you are scared the hell out if you dare go beyond the norm and pick courses that your senior friend brands as 'very difficult' by his standards. He will scare you SO much, that it reverberates all through your semester, your confidence taking a beating with every tiny mistake you make. And worse, you repeat the same cycle, plant this seed into another incoming student's head and there, you have an entire line of Indians not signing up for a course because, oh well, seniors did not take it. Indians here are risk averse, not because they are not capable of taking risks (a foreign graduate study is risk in itself) but because they are surrounded by a peer group that psychologically prevents them from taking risk. I hardly see them trying out something as unpredictable as a start-up or going for that arduous PhD that they dream of.
    Herd mentality has its victims. Not new to us, is it?

    You were perfectly capable of doing well in that subject till you decided to get that bloated advice from your senior friend. Trust yourself to make the right call here and pick courses that you are passionate about, not because your senior friend tells you that it is 'easy' or 'difficult' or worse, that not signing up for that course will not fetch you a job (This, by far, is the lamest advice I have heard from an Indian senior. Made me cringe)

    The other side of this affair, the dangerous one, here goes: There are a certain 'easy' courses in your curriculum. By easy, it means easy grades or a lenient professor. Well, before you know it's easy (takes a month to realize that) your Indian friends and their senior bum-chums would have ragged you on your incompetency for not signing up for an intellectually challenging course like they did. Here I am paying nearly all my life savings in tuition for a subject that everybody makes fun of. How does that feel? It feels bloody miserable that such black and white judgement process exist in a world class university and your peers do not let you enjoy what you are studying. Easy or difficult, it's the learning I enjoy more so than anything. Of course, you could always show the finger and move on, but it does become a little difficult when the peer group views you as an intellectual misfit. They are all out to prove their choices, decisions are far superior to yours. Sounds familiar?

    The great Indian hype : If you happen to have worked for the biggies back home, you are a superstar here. Your friends hype your work, when you yourself don't care a penny about it, suddenly everyone thinks you are a smart kid, and nasty comments like 'Well, you are the smart one, you will obviously crack this, it's a joke for you' will be spewed. And if you fail to crack it, the same group immediately writes you off, leaving you wondering if you signed up for this after all. I did not create the hype, I did not publicize my work, but here I am being made fun for failing something I did not even claim I could solve!

    Minor annoyance, the Facebook feed of your party-kid Indian friend : There is also this certain Indian group who are one of those misinformed college kids clicking endless pictures and doing endless check-ins at every happening and non-happening place in the city. They are another reason for you to cringe. Having never seen the US or been here once or twice on a family trip , they are this uber excited , hyper active social beings who make us all look like party kids, desperate for attention. There is a flood of photos of your wannabe Indian friend with an American/Ukranian/German/French guy/girl (Who cares! they are all a bunch of good looking white folks anyway!) every 10 minutes on your news feed. Believe me, it makes you immensely popular among your Indian friends, you become the talk of the town (your Indian group). It is pretty much like living in India.

    You, if you are one of those pitiable Indian student with a hefty loan and with the sole purpose of learning, with dreams and ambitions beyond a job, inclined to know more about the American way of life, the history, the politics, the culture, the people, will be left wondering if you accidentally landed in India. Worse, they will look at you with contempt if you make the slightest indication that you are not inclined to their way of life, you are different, and you want to be a part of a broader culture that emphasizes on individualism than the collective thinking we have been brought up to accept. If you follow the election primaries/ presidential elections, my suggestion is to keep it a secret and pretend you enjoy Bollywood songs when you are with your group. Helps to bond and make them feel home.

    Your friends are nosy. They want to know who you hang out with, your grades, who you stay with, if things are okay with your roommates, the white 'chick' you find hot, whether you managed to get an internship, if not, some unsolicited advice on how I should be prepared for an unpaid internship, your salary and your plans of securing a job after Master's and more unsolicited advice. The rat race repeats all over again, the very same reason why you left India.

    Academics
    Life is not as easy-peasy as those Facebook photos depict. It is a lot of work, actually. More like a correction facility for all the tardiness back in our undergraduate classes. You will be forced to wake up early, forced to sleep late, forced to think for every assignment, forced to feel miserable about your performance in term exams and forced to shut up about your grades. You will be forced to become more disciplined in life. This is why I wrote in the beginning that I am not from one of the premier Indian institutes, because those guys are probably used to such load. If you are an average student like me, you will wonder where you are going wrong, in spite of being one of the top students in your class back home. It was rote learning back there, it is not that way here. Not a day passed in the first couple of months where I did not wish that I had studied in the US since the very beginning.

    But, of course, there is an easy way out of this, something you must know by now, given how things work in India. You can always get your answers on the internet or by discussing them with your Indian friends beyond the permitted levels and break all the academic honesty rules. Rules are meant to be broken isn't it? That's how things are back home! And with the self-righteous attitude we have, we collectively look down on anyone caught for academic dishonesty, but pretty much do it ourselves. 'Hey let's work on this assignment' is the norm, even if it clearly states that collaboration is not allowed. Any guesses why the Indians score well and way above average? Here it is.

    I know I did drift from the main topic. Now back to your actual answer.You will do great if you are sincere with your work, if you have a desire to learn, if you are curious and if you don't let the above affect you much. As another post here highlights, professors are approachable (Indian professors alike), resources are aplenty and school will keep you busy enough to forget a lot of peer pressure I mentioned above.You can select courses from technical/non-technical departments alike, while you are majoring in say Computer Vision. It need not be always coherent, because a lot of us are here to explore.You are not expected to become a subject matter expert and specialize in something. It is recommended, not mandatory. I know of a professor who majored in Music in his undergraduate studies and went on to get his PhD in Computer Science. That is the flexibility this system offers. Awesome isn't it?

    If you are in one of the research schools, I recommend you to get a hang of the kind of research that goes on and think about how you could contribute your tiny little idea to the academia, no matter how nebulous it is. That said, there is nothing wrong in looking for a job (I too want to make my living) but do not let it become a priority, because you are here for graduate studies and jobs/internships are more or less a by-product of what you do here. Education is something very close to my heart and it does bother me personally when the whole purpose is diluted with unnecessary add-ons like what I mentioned above.


23 March, 2013

Nitty-Gritty Things - 1

In this blog lets talk about some nitty-gritty implementation stuffs.

Okay. So assuming the reader knows C/C++

a) How to add time restrictions to user input?

To elaborate, we know in C, the user input is read using scanf/getc/getchar and in C++ using cin object.

So our objective is to add some time limit so that user inputs the value before the timeout.

a) You can do by calling a script written in bash/python etc from C code and evaluate.
b) May be create a thread and fire the thread when timeout happens.

Is there any other way? <Think before scrolling down>
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

http://www.gnu.org/software/libc/manual/html_node/Setting-an-Alarm.html
http://pubs.opengroup.org/onlinepubs/009695399/functions/alarm.html

After reading the above links, I came up with this.

#include<stdio.h>
#include<unistd.h>

#define TIMEOUT 5
int main()
{
        int t_iTemp;
        while( alarm(TIMEOUT), ( t_iTemp = getchar() ) != EOF )
        {
                putchar(t_iTemp);
        }
        return 0;

}

This program waits for 5 secs. If user doesn't input anything, it exits else just echoes the input
and waits for next 5 secs.

The idea is simple i.e to generate a signal based on timer.
But the important takeaway is about alarm function.


Okay lets see one more.

b) Say you are developing a clock app. Now you will have conditions for hours,seconds,mins etc

The thing we will talk is how do you display 00 when the clock moves from 59 in case of mins/secs and 23 in case of hour.

When we think about it, its nothing but printing "00". But remember here we are talking about numbers :-)

What happens when you assign 00 to a integer and print it. It should be printing 0 instead of 00.
So how do you print an integer as 00. This is what we will be talking.

<Think before scrolling>
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
.
.
..
.
.
.

You can use a format specifier :D

int a = 00;
printf("%d",a) -> 0
printf("%02d",a) -> 00

However there are functions which can replicate a given number/character which is the takeaway.
Check the below link.
http://www.cplusplus.com/reference/iomanip/setfill/


 int hrs = 0;
 cout<<setw(2)<<setfill('0')<<hrs<<endl;

Hope you enjoyed reading and got something out of it.
Please post comments/suggestions(if any).

20 March, 2013

Performance metrics of Computer Systems - 1

When we think about evaluating the performance of a system, some things that comes to our mind are

a) Configuration and Flow that needs to be bench-marked.
b) Number of instances of node/server (1 or many ).
c) Duration of the task.
d) Tools that are gonna be used for analyzing and preparing report.
e) Existing benchmark report of the system for comparing the new data.


Let me give you my idea on each of the above aspects as well as my views on performance metrics of a system. Specifically let me discuss about "arriving  at benchmarks when we release the Version 1 of the software" in this blog.

consider a simple coin toss :)  Yeah its about probability and queuing :D
How are we going to measure the performance of this toss?
a) May be height travelled by the coin ?
b) Number of flips it makes? etc etc.

We use "laws of physics" as a tool to measure the performance metrics of the coin.

Now consider a system where messages are received, parsed and given to various components and sent back. This kind of system is called Open system.

There is one more type of system called Closed System. Interpret it to a CI machine where CI-coordinators submit jobs which in-turn is executed on a set of machines ( servers ) and returns back to idle state.

Our software (Version 1) can be open or closed. As we don't have any previous benchmarks for this software, we have to arrive at a theoretical bench-mark so that we are able to ascertain the practical measurements.

So how do we arrive at theoretical benchmarks?
Using Queuing models :-). Yeah its all maths buddy :D

For those who have taken a Queuing course, these things should not be new. Others please continue reading.

As we are used to event-driven programming, lets continue our thoughts using this.

What is event-driven programming?
Some events happen and based on the event we execute some tasks ( code ). After this may be the server goes to wait state to handle next set of events.

So lets define 4 set of events.
a) Customers / Messages arrive randomly (which we call Poisson arrivals)
b) Customers / Message wait in queue for getting processed.
c) They get processed. ( called exponential service times)
d) They leave the system ( our system memory allocs are put back to pool. )

Of-course there are certain systems where messages arrive at fixed time slots like burst ( Systems like ALOHA / Slotted ALOHA uses something like this. Other case may be where attacker is trying to send a burst message causing buffer overflows in network elements) or what not.

So having defined these events we can categorize our system ( software ) as M/M/N/K system.
First M denotes the arrival rate of messages into our system. Second M denotes the rate at which it is processed. N denotes the number of servers handling our messages and K denotes the system capacity.

Why do we have two M's ?
Aren't the messages going to be served in the order they arrive?

No. Most systems have some thing called classes similar to IntServ/DiffServ model where customers paying more are grouped into higher classes and have better experience while those pay low have lower experience comparatively.

Also consider the case where server is bombarded with lots of requests it can't handle. What can server do now ?

It can delay the person entering the system through some protocols like Stateless Cookie protocol
i.e if some one sends INVITE message in case of SIP protocol or SYN message in case of TCP the server handling it can send a reply asking him to solve a hardest puzzle/ calculating a hash which would take sufficient amount of time for the sender to compute and reply. In the mean time server clears the messages in its queue and is ready to accept new connections.

So we are deliberately delaying the customer entering the system. This happens with IRCTC [ Indian Railway Reservation Systems Servers :) ]

So coming back to our M/M/N/K model, this model has a set of predefined formulas through which
one can arrive at various metrics of system like throughput, delay, waiting time of customer(message), time spent by the message in the system etc.

Using these values along with the system parameters one can arrive at the theoretical bench-mark of a system and then use it to compare with practical data of our version1 software.
 
Let us conclude it for now. Other factors would be posted gradually.
Hope you got something out of this post.
Please post comments/feedback (if any).

15 March, 2013

My experiences with Thread safe code - 1

In this post, let me share my views and experiences about things to be done while coding in a distributed environment with respect to thread safety.

Persons who had taken a course on operating systems would be knowing about thread safe code. For those who doesn't know anything about it, as always let me give a gist.

What is thread?
Thread is a light weight process.

What is process?
A process is a program in execution.

For example : Consider microsoft word. When you open it, the process starts running i.e this program is in execution. This program has lots of features like spell check, auto correct etc which are independent threads running along with it.

In a single threaded process, only one flow of control exist.  The code executed by these processes  need not be thread-safe. In multithreaded programs, the same functions and the same resources may be accessed concurrently by several flows of control.

Let me explain thread-safeness  through an example.

Consider the case where there are group of people who come together to perform a particular task.
Each people has a role i.e they have some boundaries/memory which they don't cross.
Ex : Hadoop/GFS(Chubby)/Open Stack etc.

To illustrate still more, consider a bathroom.
Only one person can use it at a time. Other persons should wait for their turn.

A thread-safe code protects shared resources from concurrent access by locks. 
Thread safety concerns only the implementation of a function and does not affect its external interface.

For further info please read this.

So having defined some basics of thread safe function, let me share my experiences on it.

If you had read my previous post on design patterns , I would have spoken about something called service and session. I was writing a separate library in my previous concern where the objective was to provide some features like calculating current time and attaching to message based on customer specified version.

This library written would be loaded by the service using dlopen and would be accessed for each and every session. So for calculating the current time, I was looking for some system calls which would return me the time/date etc and I came across this function called localtime. I was happy, used it & finished my implementation and was waiting for code review comments from my technical lead.

To my shock, the implementation was not supposed to be done in the way I had done.
My usage was proper. I have used proper libc function which is a tested code.

But then why?

I missed seeing the below one in  the local time function.

/***********************
The function accesses the object pointed by timer.


The function also accesses and modifies a shared internal object, which may introduce data races on concurrent calls to gmtime and localtime. Some libraries provide an alternative function that avoids this data race: localtime_r.
***********************/
I should have used localtime_r function () . Why ?

Because there can be multiple parallel sessions running in the server and there is a potential chance of multiple sessions accessing this library at same time leading to corruption.
I was thankful as it was caught in review stage else it would have leaked after deployment.

So the lesson learnt from this

"If you are programming in a multithreaded environment and you are looking for system functions defined in libc kind of libraries, confirm whether it is thread safe or not and then use it".

However there are many others which i would post gradually. I just glossed over some things in this post.

Thanks for reading. Lets conclude it for now about my view/experience on writing thread-safe programs.

Please post any comments/suggestions so that I can improve.
 

14 March, 2013

Dumping my ideas - 1

As you would have noticed in my profile, I used to think a lot on new things by using existing infrastructure both technically and socially. This blog is not about how to cultivate this. May be I can post later on how to develop ourselves.

Okay coming to the topic, I used to discuss ideas with my best pal Arun who is currently a Master's Student at Georgia Tech. But as things get tougher in our grad days, we hardly speak about new ideas currently as we have a lot of grad stuff to do. These ideas run in some swapped block and occasionally/randomly we used to bring it to main memory  :P. There is no specific scheduling algorithm for it.

This is one such idea that we spoke last month. I'm not sure whether this already exists. So, if some one is planning to use this idea let us know before you start as current world is a patent world. :-)

Time Line :

17/2/2013 -> This idea struck my mind.

18/2/2013 -> We spoke about this. Thought about its feasibility and factors.
14/3/2013 -> This blog is written.

Let me explain my idea in subsequent paragraphs.

Everyone loves food :-) There can't be even a single person in the world who can say "I hate eating".
That's the reason food stores/hotels came up with websites where customers can make online orders and get them delivered using delivery guys associated with that shop. Ex : Pizza / Burger shops, Notorious restaurants etc etc.

Then came a new trend of online sites like www.justeat.in whose objective is to make all restaurants to advertise themselves using their platform so that people can purchase stuffs and it gets delivered using the shop-appointed delivery guys. As the site says, all they need is an area name through which they can suggest us shops to purchase or spam us by placing ads.
How do they get paid?
1) They provide a common platform for all guys to create their sites. So the hotels should be paying them.
2)  They can place ads and use click feature to track and charge.
3) They can also charge based on the purchases made to a particular shop.

However the common thing is, if we want to host our shop/hotel/store we need to either create our own site by buying all necessary servers, hiring engineers or  use cloud providers like GApp Engine or AWS or Azure. In this case its justeat as persons use this to advertise their shops but they need to pay for it.

Okay so whats my idea? Before spilling it out, let me give some use-cases on who would be benefited.

1) Contractors who work as delivery guys in shops.
2) Home Makers like our mom.
3) College students and all people who want to work part-time .
4) Restaurants who don't have sufficient capital to invest in website for them.
5) Common person like you and me.
6) The country.

and many more. [ Note : Comment if you have any more use-cases after reading it. ]

To create a website which has the following features.

1) Restaurant owners / Home makers post their foods that are available for sale in this site.
2) Delivery guys register themselves with this site and give their locality preferences for delivering so that he/she is able to see posts only related to his/her region.

Now how things gets delivered?
Common man who needs food looks,orders and pays to the site.
The site posts this requirement in delivery guys section based on locality.
Delivery guys allocates the order to them so that it doesn't gets chosen by other person belonging to same region. The order goes to the required shop/home through all means ( phone call , sms, email etc).

Now delivery guys visits that location picks it and delivers to the required location. Their credibility increases based on customer feed back / delivery of the item. If he doesn't deliver it and haves it for his own purpose he is barred from further correspondence. So we need to authorize these persons through some system [ like tracking them through some unique ID like SSN or Passport Number ].
Also the customer can claim he didn't receive by putting the blame on delivery guys. This can be authorized by delivering guys sending a signal(digital image of signature) to some server confirming the acceptance.


Income factor :

Delivery guys earn through tips as well as site pays him/her based on some factor in food order.
Site earns through may be a factor on usage. For example : If a particular shop / person ships lots of orders, he will be charged more. Similar to Pay when you use model of cloud computing :-)
If some one doesn't get any order, they needn't pay anything.

Now why it can be popular?
a) Delivery guys needn't be bonded to contract. They get paid on number of customers they deliver.

b) Homemakers can make money from home by posting in this site.

c) College students can earn part-time handy money by doing this in their region. Suppose two
persons are in love with each other. The girl can order. The guy delivers it to her home. Lol :P

d) Restaurants who don't have sufficient capital to create their site can try this feature and increase their revenue.

e) Common person like you and me often visits restaurant. Through this site we can do something like this. We can place the order as well as register in the site as delivery person. We visit the shop get the food and also get paid by the site for delivering it. So "we earn for what we eat" :)

f) Finally the country gets benefited as production rate increases and there are lots of persons now with some jobs :)

Isn't this nice or am i missing some things?

I would like to thank one of my friend Karthik on bringing some couple of problems to me.

a) By using this system, delivery guys  gets to know the preferences of persons belonging to a particular locality as he knows both producer & consumer. So he can go on starting his own business of delivery by cutting down the revenue of site-restaurant owner/homemaker. [ like Man in the Middle attack. i.e remaining silent till the connection is made and attacking the person ]

b) .. c)...

I'm in the process of thinking about other attack vectors in this and possible solutions.

I hope you enjoyed reading this.
Please feel free to give your opinions by commenting here :)