Tuesday, September 8, 2009

this is a test


hay hay hay

----------------------
Posted through via web
View original post

Wednesday, April 23, 2008

Tuesday, April 8, 2008

Hacks@LUMS-101

31 March 11:00PM:
The stars were dim, moon covered with light clouds, birds sleeping and people resting. At the same time, the geeks in Newt were up to something. The first ever hack in the history of LUMS CS was about to take place. 
29 March 2:00PM:
The idea was under development for quite some time. We knew we had to do something on 1st April but what and how? Suggestions came from every corner of newt. Great minds invested countless hours on evaluating ideas such as,
> Cover the room's entrance with wallpaper
> Fill the room with empty drink bottles
> Paint the room ceiling with multiple colors
> Move everything (including tables & computers) in Newt lab to some where else
and many others.
But the idea that took the prize came from Yaser. The mission was finalized as,
Mission
Subject: Dr. Umar Saif
Objective: Fill the room with balloons
This may not sound a great challenge but we had to do it with the door locked.

30 March 11:00PM
We analyzed Dr. Umar's room and devised an ingenious plan. The plan was simple but elegant,
1> buy 200 balloons
2> get a couple of hand pumps
3> slide the balloons one by one below the door, fill them with gas
4> tie them with thread and push them in the room
After taking the oath of secrecy, the plan was finalized.

31 March 11:30 PM 
We started the execution. But everything seemed to go wrong. I had already bought 100 balloons from a gift shop. But the balloons did not turn out to be strong enough. Next, the pumps Mansoor brought from his home were leaking. All seemed lost; but then Mansoor came up with a device to replace pumps (the patent for which has already been filed). It was yet a simple solution. Mount a balloon on a pepsi bottle, make a hole in the bottom and fill the balloon.

1 April 12:00 AM
The mission started. We mounted the balloons on the bottle, inserted the balloon in the room from under the door, filled it, tied it and released it. 
The progress was slow. The danger of being caught was there :(. Balloons were popping and we hardly put 10 balloons in the room in first hour. On emergency notice, Mansoor and others went to buy more balloons from the nearby store. 
1 April 1:00 AM
But with the inclusion of Murtaza we picked up the pace to an average of 1 balloon/minute. As the number of balloons increased in the room so did the adrenaline. Soon there were close to 100 balloons in the room. But we went on to put another 30-40 in there. When we stopped, it was 3:30 in the morning. Though tired, the sight of the room from the window was enough to keep us motivated.

Next day, the whole lab was waiting for Dr. Umar to come (which is usually not the case :)) but he did not. The balloons survived the whole day. We were unable to see Dr. Umar's first reaction when he entered the room but the thought of opening a room full of balloons still puts a smile on our faces.

Sunday, February 24, 2008

Startup Insiders 6 @ LUMS Lahore

Frankly, I did not have high hopes for Startup Insiders #6 @ LUMS, after the disappointing experience at previous Startup Insiders #3 (as it was restricted to very basic things). But the gathering was exactly what it should have been. An informal, bi-directional, moderated and mature discussion.
Since I did not note down anything, I have to rely on my memory. So I will definitely miss things and might misquote. Also I will only be covering the best (IMO) points by each panelist. (See the video for details)

Jehan Ara and Jawad Farid introduced the panel and the format.

Panel
  • Jehan Ara
  • Jawad Farid
  • Dr. Umar Saif
  • Faisal Qureshi
  • Zia Imran
  • Fahad Bangish
  • Zafar Khan
  • Nadeem Malik
Format
Each panelist was given 2 minutes to answer the question (or face the consequences :)). The audience could interrupt the speaker at any time and direct the question to anyone/all panelists.
The Yellow Cards
But the best feature was, 'The Yellow Cards'. Some people (including yours truely :)), were given yellow cards. If someone felt that the discussion was going off topic, he/she would raise the card and stop the conversation.
This minute change turned out to be the best thing. As with the previous event, a lot of people tried to jump in with whining and complaints. Though most of them were answered comprehensively by the panelist but we also made good use of the yellow cards. This moderation mechanism was one of those things that kept this discussion on track.
Discussion
It started off slowly, Jawad showed a series of advertisements including the ads for Apple's 1984 Mac, Mastang, Lexus and FedEx. He explained the concept behind each individual ad and how it targetted a specific audience. The core thing out of that 30 minutes was,
You must be able to specify the attributes of your product in 30 seconds. Identify the qualities of your product and relate them to the customer needs such that it makes the customer ask for your card
After that it was primarily Q&A with the panelists with following highlights,

Jawad Farid
An entrepreneur does not complain but solves problems. This is critical as your customer does not care if its raining, your building is on fire or there are strikes. Buy generators to cover electricity shortage, dig holes and put tube wells to get water. Solve the problems you face, do not complain.
Know your customer, know his pain. Identify the points that are most painful and then convince him that your solution solves these pains better than any other exisitng solution. You can make the best product in latest technology but if you can not convince your customer to use it, its not worth anything to him.
These points convey the essence of entrepreneurship. Entrepreneurship is not about making money, its not about having a huge company. It is about solving problems, creating value and converting that value into money. Jawad was spot on with the details on how he got his first customer and how his company ended up having the business they are doing right now.

Jehan Ara

Jehan Ara was the anchor for most of the time and she sure did not make anyone sleepy. She added to almost every question but particularly to the questions pertaining to the 'impossibilities' of starting the business.
There are lot of problems with working in Pakistan.
  • resource dependency
  • lack of infrastructure
  • bad image of Pakistan
However, we must face these problems and try to solve them. Complaining will not help. Our universities need to produce good people, our people need to imporve our image by working hard and being honet. The image is not just built by government, but by the people. Companies in India face lack of infrastructure, poverty and bomb blasts at a much higher scale than Pakistan but still they manage to overcome these problems.
Frankly, I think the questions like 'It is not possible to work in Pakistan' should not be answered anymore. Entrepreneurship starts with annoying passion and belief in your idea. If you do not have faith in yourself, do all of us a favor and dont become an entrepreneur.
Dr. Umar Saif
Dr. Umar (looking fine and dandy as usual) spent a lot of time listening. But he added some valuable thoughts when it mattered.
One thing common in all these people is commitment and hard work. These people worked really hard at whatever they did, whether it were studies or business. Withouth hard work, you are bound to fail even in a job, let alone your own company.
Faisal Qureshi
Faisal Qureshi undoubtedly dominated the whole session with his all round personality. He was surrounded by no less than 15 people during the refreshment and at the ending. I am sure he could have easily won the NA elections today :).
I dont care WHY I dont use your product. The bottom line is that i DONT. I should be using it but I dont. Now figure out how can you make me use it. You only get 30 seconds before I leave your product and the image I have will stay with me.
Find your 'Mamoon Akbar'
You have to find a link to your first customer. A customer probably gets 100 phone calls today for business and listens to 1% with some seriousness. But if his 'Mamoon Akbar' calls him and tells him about you, he will listen to you. Find that 'Mamoon Akbar'. This will open the door for you. After that its your job to 'con' him into buying from you (he later explained it as con from CONvince not from CONvict).
Before the customer buys your product, he decides if he wants to have a relation with you. Every thing matters in this regard. Dress up nicely, talk nicely and be honest. You have to look like in control. Do not let anyone else dress up and look better than you and take the center stage. If you cant do that, hire someone who can.
I guess I wont be showing up in the next gathering in slippers :P
MBA degree neither makes you a better human being nor a better business man, it only opens up doors for you that might not be opened otherwise.
*cough* *cough*
You are responsible for the two square feet you occupy. You destroy it when you trash the city, when you make a personal attack, when you lie or cheat. At the end of the day, be responsible.
You should aim to absorb and keep growing yourself, help others because that help will definitely come back to you.
Faisal's thoughts about innovation, impact, responsibility and success were just extraordinary.


Some other good questions were,
Q: Three things you now have and wish you had when you started?
A:
Faisal Qureshi: People management
Nadeem Malik: If I had what I have now, I would not have been what I am now
Fahad: More money
After that, the discussion went off topic :(

Q: How to balance your team?

A: Find people who can complement your skills. If you cant implement a tech idea, find someone who can. If you cant sell, find someone who can sell.

Q: How to target a wide range of customers? (the long tail)
A: You should divide your customers in categories. Then build your strategy around each category. Each category has different buying power, needs and problems. Identify them and sell to them according to their needs.

Some lame questions/comments were,
-Give us some practical advice (meaning shortcut to success)
-We should not follow the examples of Yahoo! and Google (I ll be blogging about this later)
-How can we work in these awful conditions? (some more whining)
-You have to be experienced to start a company

Conclusion

I feel that 50% of the audience was the wrong type of audience. This event is for entrepreneurs, since not everyone can be an entrepreneur, not everyone should be in it. Currently, it is mainly advertised to the university students who treat it as a workshop for career making and even worse, a shortcut to making money.
The session started with me at a very low energy level, expecting not much. But as the session picked up the pace, it became more and more engaging. The penalists did not talk about WHAT they have accomplished, rather HOW they accomplished it. There were times when the discussion went off topic but was never derailed (we had lots of yellow cards to make sure). At the end of the session, I had a high energy level and motivation (despite getting only one sprite). I am sure the discussions with Jawad and Faisal Qureshi will provide me food for thought for a long time.

Thursday, February 7, 2008

2's Complement of 3

Are we going in the right direction? This is the question you need to ask at every step of your startup. There is no definitive answer to it. But you are certainly on right track if you are able to interest great people in you, your idea and best of all, have them join you.

When we started in summer 07, we wanted to do great things. We knew we could only do great things by having great people. Steve Jobs says that you should hire people better than you. I say hire people who can kick your ass. 

But it is not easy to convince great people and it should not be. Great people are like magnifying glass. They will highlight the flaws in your thinking, your ideas and your execution. This is exactly what makes them great. The ability to look in corneres that others neglect.

In 7 months a lot has happened, but 7 Feb 08 marks the first (visible :)) success of 2's Complement as Yaser Amer Awan has joined us as the third Founder (not a hire). For those who dont know him, he is, a sportsman, a hardcore gamer, a passionate hacker and has a great business mind. Above all, he has vision and the drive to reach that vision.
All I can say is, 2's Complement has been upgraded from 15 to 30

Tuesday, February 5, 2008

Lessons About Startups Part II

Startups magnify minute details and force you to think and work like you never have. There are many things you will need to learn and learn quickly.

Define Your Ethics

Define your absolute do's and dont's. Some examples are,

· Keep your word, even if it means losing something

· Respect other people

· Self-respect

· Accept your mistakes

· Be forgiving

And the list can go on. Important thing is that you MUST have some values. These values are the foundations of every decision. Do not let your values be defined by the world. Never compromise on your values. The stones with no weight are swept away with the waves and turned to dust.

Learn to say NO

During your journey, you will get a lot of opportunities. You will find people who will offer you money, support and contacts. What you must realize is that you do not and should not accept every offer. This means that you have to accept some and reject others. Remember that you have as much right to say 'YES' as 'NO'. But how do you know you are making the right choice? This you do by going back to your values. Evaluate the person making the offer on your values. Look at the person not just the words. To define your answer, you must have already defined yourself.

Do not be Apologetic

There is nothing conventional about startups. Being unconventional leads to uncertainty and you tend to get apologetic. You can get over this feeling by building confidence. And confidence comes from believing that you are doing something great. Take pride in your company, your product and your working 80 hours per week. You should not be ashamed of your desire to change the world.

Be Yourself

It is generally believed that companies are run from huge, well decorated offices by grey-haired managers and MBAs. This thinking is so dominating that the startups also take to be true. So they feel inclined to pretend like big companies. They pretend to sound and look conventional. Because if they do not, they look out of place and exceptions just look silly in the first glance. Do not be afraid of looking silly. Part of entrepreneurship is learning from your mistakes.

Do not pretend someone you are not. People laugh at monkeys who pretend even though they pretend very well.

Do Not be a Whiner

I hate whiners. Not just me, but every sensible person hates people who whine and cry. Your server crashed; fix it, you are out of money; find some way to earn more, aliens kidnapped your pet cat; get a new one. But do not cry and blame the world. If you are not used to accepting and cleaning up your own mess, stay in your cubicle.

Make your own decision

Making a decision is difficult. Decisions are just another name for well thought out guesses. These are based on your past experience, your judgment of future, your fear of failure and your intelligence. No one else can see these things as good as you. Do not take the easy way out by following someone else's decision. No one is going to take the blame if the decision goes bad. It is better to fail on your own rather than succeed on someone else.


It seems impossible to remember and follow all these guidelines. Yes, it IS impossible. Nobody said startup was going to be a walk in the park. This is one reason why you should have multiple founders. Make sure that if you forget, someone from your team remembers.

Friday, October 26, 2007

Lisped

A programming language is much like the languages we speak. If a sound is missing from a language, the speakers cant produce that sound. More interesting is the fact that they do not understand the value of that sound. The lives of chinese people are not any worse because of the inability to say 'R'. Ditto for the programming languages.
  1. Languages vary in power. This can be proved by nagation. Let us assume that "All languages are equal in power". If all languages were equal, there would be no need for new languages because a new language means the inability of existing languages.
  2. New languages are created by programmers, not by standards. (JAVA whiners should read http://www.paulgraham.com/javacover.html). Languages are much like food. You can fool customer by wrapping bad crappy food in pretty packaging once, not twice.
  3. A language should get out of your way. A hacker's time is very valuable and the language should respect that.
  4. There is always a simple way to do everything. An elegant language should take the user to the most natural solution. Even if it means twisting the standards.
We have  a cyclic problem here. To understand the power of a language you have to learn it. And to learn it you must be convinced about the weakness of your current language. But how can you identify the weakness when you dont know it is a weakness? Kind of recursive, isnt it? The best way is to just take the word of a better haker. So if a person X who is a great hacker, says that a language Y is great, trust his word and study Y.
It was when I started reading Paul Graham that i heard about Lisp. I coould see people appreciating it, praising it, see it in action but not understand it. It seemed like just a big pile of CARs and CDRs. It took me three months of reading to witness the first glimpse of its power. And it was worth waiting. It was when I solved a problem in it that i saw its real strength.

Problem: You have to write a function that takes two lists, fun_list (a list of functions) and arg_list (list of arguments). Your function should apply each function in fun_list on every argument in arg_list and return a list containing the list of result of each function.

The C way
What we write and call C++, isnt remotely close to C++. So i wont be calling this C++ code.
  • First question: How to represent a list of functions? I ll just use vectors. DAMN, now i have to read about the syntax of vector. And how do I represent functions? That too with unknown signature? DAMN again! no problem, I ll just restrict the signature to some predefined value and mention it in my documentation. Or i can define it a template, but how do you do that? DAMN again. The arg_list also has to be defined as a template list.(Refer to 5)
  • Lets try Google for syntax issues (Refer to 3). Notice that we have already spend a good 10 minutes and we are yet to write a single LOC.
  • Okay, now that we have gathered all the stuff, lets get on with writing code. Lets start by a simple code and expand it to full form. Lets assume the each function operates on integers and return an integer as well.
#include <vector>
using namespace std;
vector<vector<int>> apply_funcs_to_args(vector<int (*)(int)> fun_list,vector<int> arg_list)
{
vector res;
return res;
}
And i am stuck as i need to confirm the syntax of function pointers. What to do? Back to Google and MSDN.SHEESH, hope somebody is keeping time, this is hard work dude.
Now i need a function that will apply a function to the arg_list and return the result. Here it is,
vector<int> apply_func_to_args(int (*f)(int) f,vector<int> arg_list)
{

int i = 0;
vector<int> res;
for( i = 0 ; i < arg_list.size() ; i++ )
{

res.push_back(f(arg_list[i]));
}
return res;
}

I have to make sure that this function is defined before apply_funcs_to_args or it will not recognize it. Now my final code becomes,
#include <vector>
using namespace std;
vector<int> apply_func_to_args(int (*f)(int) f,vector<int> arg_list)

{
int i = 0;
vector res;

for( i = 0 ; i < arg_list.size() ; i++ )
{

res.push_back(f(arg_list[i]));

}
return res;
}

vector<vector<int>> apply_funcs_to_args(vector<ret_type (*)(arg_type)&gt fun_list,vector<int> arg_list)

{

int i = 0;

vector<vector<arg_type>> res;

for( i = 0 ; i < fun_list.size() ; i++ )

{

res.push_back(apply_func_to_args(fun_list[i],arg_list));
}
return res;
 
}
But to make it work with any data type, i have to change it to template.
#include <vector>
using namespace std;

template<class ret_type,class arg_type>
vector<ret_type> apply_func_to_args(ret_type (*f)(arg_type),vector<arg_type> arg_list)

{

int i = 0;

vector<ret_type> res;

for( i = 0 ; i < arg_list.size() ; i++)

{

res.push_back(f(arg_list[i]));

}

return res;

}

template<class ret_type,class arg_type>

vector<vector<ret_type>> apply_funcs_to_args(vector<ret_type (*)(arg_type)> fun_list,vector<arg_type> arg_list)

{
int i = 0;

vector<vector<arg_type>> res;

for( i = 0 ; i < fun_list.size() ; i++ )

{

res.push_back(apply_func_to_args(fun_list[i],arg_list));

}

return res;

}

This code assumes that the return type of every function is same. So how do we handle different return types? We can make a generic class Result and force each function to return a pointer to class inherited from that class? Notice how a language restriction has forced us to propagate a change in some other code.
Okay, I am done. Where is my Electra? What! i am not? I have to test it too,well too bad, i am exhausted, maybe tomorrow. Infact i dont want to look at the code again because its too ugly.

Let me try Lisp. I can directly jump to writing whatever i am thinking. 

(define apply_funcs_to_nums(lambda(fun_list arg_list) (map (lambda (f) (map f arg_list)) f_list) ))

And we are done. Dont believe it? I myself was shocked to see that the code worked on the first run. And it took me not more than 5 minutes to write it and test it (infact I really didnt have to test it). And I spent the next two days in high fiving everyone just because I was so happy :D. This code is bug free, evident, non-restrictive and makes no assumptions. Its short and its beautiful.
Imagine a person who can pull this kind of stunt in every LOC. Do you think such skill can be beaten by scale? Would you be willing to take him on as your competitor?  I know I wouldnt.