Friday 18 November 2011

Back on Track

Today on weekend as usual i spend the evening with my friend, and watched the third ODI between Pakistan and Sri Lanka. I missed much of Pakistani inning due to office hours , but watched the Sri Lankan inning with some sporadic interruptions. As Pakistani cricket now a days trapped in whirlpool of controversies, with spot fixing charges to Afridi - Waqar exchanging incendiary arguments, Pak vs SL series is some relief. As Pakistani team and PCB going through transformation, what i saw today really awaken the old days enthusiasm and love for this game in me. Today we played as complete unit , and after a long time i have seen such a commanding captain. Misbah have proven all his critiques wrong today , he commanded the team from front . It may be his heyday, that every risk he took paid him off. First sacrificing his own wicket for Younas Khan , which in end proved a vital decision . Than in bowling he played a lot of wagers which paid him off , but couple of times Tanvir disappointed him and us a lot. He consulted Younas Khan and Afridi on every critical moment , as in the ending overs of the match , Younas was placing fielders for Umer Gul , this was a great sign of improvement. Misbah seems quite confident and mature as captain and he is not threaten or afraid that some one is gonna out run his captaincy. This is a conspicuous sign for politic free team structure. Shoaib Malik's role today was just reduced to a 12th man , which i loved. No controversial player was named in playing 11 (players involved or suspected to be involved in fixing). I hope we see better cricket in following year.

Saturday 12 November 2011

In the times of Joe Frazier

Famous Left Hook To Ali in Fight of the Century
7 November 2011, Joe Frazier was knocked out from this world for good. A fierce and competent boxer of all times defeated by liver cancer. But Joe Frazier and all other boxers of 60's and 70's were most misfortune because they were in the times of Great Muhammad Ali. The extraordinary persona of Ali enchanted the whole world and all the other boxers were completely over shadowed by him. But still comparatively short but shrewd guy with arrogant swagger came to the scene of boxing and amazed everyone. Frazier or Smokin Joe, he was referred as, became professional in 1965. He won gold for USA in Olympics previous year. His style was very aggressive, always tried to narrow down the distance between himself and opponent. He was one of the most fiercest puncher of that era. He was famous for throwing fury of jabs and uppercuts but his most lethal weapon was his left hook, ironically he broke his left arm in childhood which though healed completely but was a bit short from his right arm. The accident not only shortened his range but also crocked his arm a bit which some experts say did him good.
Joe Frazier was best puncher of his time, as his first 10 fights ended earlier or in 6th round, and all were Knockouts. But the moment of glory for Frazier came on 8 of March 1971 after six years since his first fight. The fight was tagged as "The Fight of the Century". Venue was Madison Square Garden New York and each player was paid record prize of 2.5million dollars. Well what a fight that was, Muhammad Ali dominated in start but after 8(total of 15 rounds) round, Joe Frazier was in command. This was the fight in which Joe landed a superb left hook to Ali showing the canvas to him, second time in Ali' s career. Frazier became world heavy weight champion by a unanimous decision. To keep this for the glory of Joe I am not mentioning the fight of Frazier with Foreman in which Foreman ruined him in just 2 rounds.
Frazier was one of the two  fighters who completed hatrick with Ali, with famous Gorilla in Manilla, both resulted in Frazier defeat. Frazier belonged  to the era where on the scene of world boxing Ali floated and stung but still Frazier made his mark. The International Boxing Research Organization ranked Frazier among the ten greatest heavyweights of all time.

Thursday 10 November 2011

Artificial Intelligence in H.D

Well Artificial Intelligence is the most abused term used in nowadays computing. Thanks for the advent of Emotional Intelligence we can differentiate between different kinds of intelligence. Intelligence is some what an umbrella terminology encompassing, emotional and academic intelligence. We human beings are themselves very complexed machine , we havent learned enough of our selves. so it would be a disaster if we juxtapose computers in our own image.
As once Thomas Carlyle said , "What is all knowledge too but recorded experience, and a product of history; of which, therefore, reasoning and belief, no less than action and passion, are essential materials?". This quote is the first line of the textbook "Artifical Intelligence Illuminated by Ben Coppin", and i am glad that a Scottish satirist made this distinction back in 19 century. So when we talk about Artifical Intelligence , this means that we are talking about academic intelligence , the intelligence which has nothing to do with emotions, experience, consciousness. The intelligence what is required to solve problem by regression , learn by propagation or hit and trial rule that does not require these elements. it seems that this sort of intelligence is inferior to ours and its in fact , but where computers beat us is there resilient ability to repeat same things for eternity without getting tedious. And by considering all possibilities of some problem million time faster than human mind. In some way the emotion less machine can perform better in most of the cases , like human mind get lazy, exhausted,tired etc. these arguments look trivial but when in reality these thing make difference.
The thing is that A.I is comparatively new term and domain, and there is no one who is currently focussing or discussing the philosophical implications from computer world. there is only one name in philosophical circles who attacked the philosophical queries relating to A.I and his name is Hubert Dreyfuss. With his two astute works , "What Computers Cant Do" (First Published in 1972) and than "What Computers Still Cant Do" (First Published in 1992) , H.D argues the disability of computers were having any consciousness and their disability to understand and learn things that do not follow any rules. H.D a renowned phenomologist is of the view that learning and intelligence does not follow any rules. According to him people have invented or created many things which contradict there culturual or geographical needs , and they have done this by some inner urge , he named that force or impetus "Calling". I totally concur that computer can not have this inner urge or creative force in them till now and it does not seem to be possible in near future too. i also agrees that computer learning is done by heuristics which definately follow some rules. But i will say that human creativity and imagination is boundless, it does not follow rules. the imagination's boundary are limit less, in my imagination i can fly on peaguses , can kill hercules with bare hands etc. means human creativity does not know limits , it does not have sense of causality , neither it follows relational heurmentics. but when we manifest this knowlsge in real world , we have to take care of all implied rules this world follows. so manifested knowldge follows all the heuristics that can be mapped in program though how diverse and vast resrvoir of knowledge we have in our mind.
But in the end A.I is still an unexplored land and we needs a lot of learning and understanding pending on our part.

Monday 7 November 2011

Fundamentals of Coding.



The best way to define computer is that, computer is an electrical device which performs some computations on information in accordance to the instructions given to it. The instructions given to computer should be in compliance with the hardware architect of the computer.
But I am not going to focus on computer hardware organization or its architect, but the more important thing is writing instructions which gives computer its diversity and the ability to do wonders. From first generation languages like FORTRAN ,Pascal ,Cobal,Ada(named after first programmer in world ,Lady Ada Lovelace) to most modern and sophisticated languages like C#,Java and etc. , there have been a lot of changes but the pattern of writing instructions are same .Once I asked my teacher what are the fundamentals of writing a program, and his reply was that if you are able to use and understand control flows, conditional flows and data flow , you have learnt to write good programs and now after 4 years I realized how true he was , the programming revolves around these phenomena.
1. Data Flow:
            Computers perform computations on some sort of information, or simply on data.
So data is fuel for computers, and writing a program needs ample information about which sort of data you are going to use. For simplification we divide data in two categories mainly, one text and other numeric (data have more complex forms like images, audio/video etc). Both types have further classifications too. The most important thing is that when u are writing a code you must be aware of your data type (what sort of data you are using), scope of data and its flow.
Some languages are loosely bonded like PhP in which you are not required to mention the type of data when declaring them. In some languages like C you have to declare all variables (data) before writing the other instructions.
The scope of data refers to its availability in program. If you had declared a variable in a block than you won’t be able to use it outside that block. Same as some variables are declared with static or global keywords giving them access to be used in complete code.
You should also be aware of the flow of data , means if u are using   the data in loops and conditions etc. you should be able to know the points where the data is being updated especially if you are using pointer type , it helps you to debug the code properly and remove both logical and syntactical errors.



2. Control Flows:
                        As the computer instructions are read one at time (the instruction is executed at which Instruction pointer is pointing in memory), the flow of control is most imperative part in writing programs. By default computer reads instructions chronologically, but we can alter this flow by using the structures provided by computer languages.
Goto:
            The "goto" provides us the ability to skip the instructions and jump to the instruction which has been "label". The instructions within the goto statement and label are skipped and the control is shifted to the instruction after the label. The use of ‘goto’ is not considered as good practice in programming. It’s difficult to debug the code and it creates ‘spaghetti code ‘, analogy drawn from the curls of spaghetti.

Jumps:
            If you  r coding in machine languages than u can’t reject the importance of jumps. Jumps are same as goto or other way round (as machine languages are older). Jump as name suggests it transfers the control to the instruction where the label is pointing. Jump can also be used with conditions like jump when zero etc.

Functions:
            Functions are the art of writing programs. They add beauty in your code. Function is a block of instruction which can be run whenever needed by just calling its reference. The functions have ability to take some variables within and perform the operation on that and return the results. Its increases the readability of the code and gives the programmer to reuse its code whenever its needed. The function redirects the control to the code of the function and returns the control to the next instruction written after the reference of function.
3. Conditional Flow:
            Conditional structures are same as control flows, they decides which instruction to be executed but depending on some condition.
If-Else
            The classical example is “if else”, which is the most important and indigenous conditional structure in almost every language. The basic idea behind if else structure is that “if a condition verifies than run the instructions blocked in if or otherwise run the instructions blocked in else”.
But some time the code become complex and “if else “have to be used multiple time so to carter that we have another conditional structure named as switch.
Switch:
            Switch is very handy when you have to cope with multiple conditions. The basic structure of switch is that a variable is passed to switch and than it compares it with the ‘cases’ defined under the switch block, if any condition  mention in case verifies than the instructions under that case are executed. If none of ‘case’ is verify than the instructions under ‘default’ block are executed. One thing is important when using switch is that every case is ended with ‘break’ otherwise the cases after the verified case will be executed too.

Repetition:
Human beings get tedious after repeating some task, how interesting it may seem but computers are master in repeating the thing zillion times. They never get bored of repeating the same task. The repetition or loops are based on simple philosophy, repeat some thing for the time till condition is met. I won’t get into the loop variant, sentinel value and the techniques how to write good loops. There are two major loop structures and all other are their derivates. The first is ‘for’ in which we loop for some condition and until it’s met.
The other is ‘while’ which is same as ‘for’ structre but it’s the coder’s sense and good programming skill which tells which structure to use. But almost every ‘while’ loop can be written as ‘for’ and vice versa. The other structures like ‘do while’, ‘for each’ are derivates of basic for and while loops.
But as every skill is master through practice and there is a classical saying that, ‘it works perfectly in practice but it wont work in theory’. So the best thing to enhance your programming ability is to practice writing codes. That’s how you will learn to code programs which executes in lesser time and uses sophisticated data structures, and even complicated logics will be mapped in simple code.

#Though entry was made in 2011 but the reflections are from Fall 2006.

Robbed by an artist

Today on Eid ul Azha eve , my friend and I went to have some thing to eat. Our first preference was Bistro201. My friend really liked the ambiance and I had read a great review in dawn for it, but it was closed , so we headed  for Cuckoo's den, a place infested on historical monument. It was our first visit there, but all of our excitement faded away after seeing the menu. The dishes were stupidly expensive , but still we managed to order a plate of Biryani and Qeema Naan with some condiment. When our highly expensive order was served I was amazed to see it. The plate covered with rice and chicken , was imploring to be accepted as Biryani , I was under the impression that this place earns because of majestic Mughal vicinity it has , they will at least honor the Mughali Biryani. Well that area has its history of mugging people from their money , the means are change,but true intent is same , kudos to Iqbal Hussain for making his mom proud.