Pakistani Photojournalist Wins Pulitzer Prize
Pakistani Photojournalist Adrees Latif wins the prestigious Pulitzer Award. Details at Pakistaniat post about him.
Pakistani Photojournalist Adrees Latif wins the prestigious Pulitzer Award. Details at Pakistaniat post about him.
So here is a programming question once again,
Consider a list of unsorted positive numbers in which each number has a pair except one of the number, the problem is to find that number in minimum complexity with O(1) extra space. The complexity in this case should not be more than O(n).
For instance, in the list {5,7,4,9,5,7,4} the answer should be 9. I will post my solution in the comments some time later.
The Great Pakistanis.
So here I go, out of patriotism :), I have decided to write names of great Pakistanis(of all fields, that I know) and their achievements/life history. Despite of many millions of problems Pakistan is an extra-ordinary place. From Sky high mountains to deep down Oceans, from -50 C degree to +50 C Degrees, from illiteracy to Nobel prize and from nowhere to going Nuclear, it all sounds amazing…
The main reason of doing so is to commemorate them and also many people of Pakistan don’t even know names of many of great people from Pakistan, especially scientists and writers, so I want all to know about them also. This list will continue growing over time.
So to start from, here is the initial list,
1. The Quaid-e-Azam, Muhammad Ali Jinnah - Politics, Law, Statesman ship, Father of Nation
2. Allama Muhammad Iqbal – Poet, Thinker [Tough he died before Pakistan]
3. Liaqat Ali Khan - Politics, Movement of Pakistan
4. Prof. Dr. Abdus Salam – Physics, Nobel Prize in physics
5. Prof. Dr. Salimuzzaman Siddiqui – Chemistry
6. Prof. Dr. Rafi Muhammad Chaudhry – Physics
7. Allama Mashriqi (Inayatullah Khan) – Mathematics, Movement of Pakistan, Khaksar Tehreek
8. Abdul Sattar Edhi - Social Welfare
9. Faiz Ahmed Faiz, Poetry, writing, philosophy
10. Zulfiqar Ali Bhutto – Poltics, Former Prime Minister and President of Pakistan
11. Ahmed Shah Pitras Bokhari – Humorous Writing, Literature
12. Dr. Abdul Qadeer Khan – Metallurgist, Father of Nuclear Program for Pakistan
13. Sir. Zafar Ullah Khan – Law, International Relations etc..
14. Shoaib Mansoor – Television Programming/Filming
15. Sadquain – Art, Calligraphy, Painting
16. Imran Khan – Cricket, Social Work
17. Jehangir khan – Squash
18. Jan Sher Khan – Squash
19. Noor Jahan – Singing
20. Mumtaz Mufti – Literature, Fiction, Sufism
21. Bano Qudsia - Literature, Fiction, Sufism
22. Prof. Dr. Atta Ur Rehman – Chemistry, Higher Education
23. Wasim Akram – Cricket
24. Ibn-e-Insha - Urdu Literature
25. Javed Miandad - Cricket
Right now I am finsihing the list here, but keep me informed by your comments about all those great whom I am missing here.
Regards,
P.S: This post is free of religion, genderism, provincialism, and any kind of biasedness. So let me know of any names and comments only if they are not biased in any regard.
Here is a small C/C++ code snippet,
int n = 20;
for( int i = 0; i < n ; i—) // i minus minus(in case of typo)
printf(”Hello World!”) ;
First try to find the answer to this program. It will obviously be an infinite loop or memory over flow or …
The question is to make this snippet work and print the “Hello World!” 20 times correctly as if the statement i— would have been i++.
The restriction however is to change only one ASCII character in this code. This means you can change, replace, move, introduce only one character to this program and the program still remains a valid C/C++ code.
There are three possible ways I know to do this. May be there are more. If you find two then you are good, if three you are brilliant and if more than extraordinary
Have happy time solving this.
For the time being, I have an interesting question to share rather ask
When ever we do the Asymptotic Analysis, we are given the source code or algorithm of a problem and we measure the run time complexity in terms of Big O, Big Omega etc…by doing the line to line analysis of the code.
Now the question is, lets say we are given an executable containing the code of a given problem (lets assume a sorting or searching algorithm), now how will we find the complexity of the executable i.e the asymptotic complexity? means is it taking linear, quadratic or exponential time etc…
Do try to think on this, it’s small but interesting question..
So I have been lately using this good online-offline organizer, planner and calendar control. Yes iScrybe is a really cool piece of web software. The coolest things is it’s ability to make you say, ohh this is all I have wanted from planner/calendar softwares always but couldn’t possibly say so that these are the exactly same features I wanted. So all those interested in great softwares add iScrybe to your favorites list.
P.S: As beta invitations to the software are now over, you can ask me to share any of my list(if possible in terms of time and information) in making you eligible to get an account over iScrybe.
So finally after a long time, I am back to blogging. This post is just to make sure that I am still active and will continue to post the things that charm me :).
Today is a worst day of Pakistan Cricket History. This world cup came after 4 years and Pakistanis are out in 2 games, lol. Pakistan is defeated by Ireland in the Pool Match, and hence are virtually out of the World Cup 2007, as eventually they will be lower to Ireland on points table even if they win against Zimbabwe in their last pool match.
Ireland which is a newer team and most of the players in their team have not played more than 15/20 matches has outplayed Pakistan. They batted, bowled and fielded extremely well. The sole responsibility of loss goes to batsmen specially likes of Inzamam-Ul-Haq, M. Yousuf etc.. who have played more than 250 matches each and don’t even know how to play a moving ball or how to play against a lesser experienced bowling and don’t know where field placing is. Any ways as Pakistani team is out of World Cup 2007, there will be slightly lesser interest in World Cup of our nation and hence lesser time and energy of ours will be waisted. But in all a very very poor display of Pakistani team specially loss to Ireland, so all credits and luck to Irish team :). It sounded as today was day of comparatively weaker teams as Bangladesh outclassed India in another pool match.
Mumkin hay tu jisko samajhta hay baharan
oron kee nigahon main woh mosam ho hizan ka!
Hay Sil-Sila ahwal ka har lehza dagargoon
ay salik rah fikar na kar sood o zyan ka!
Shayed keah zameen hay yeah kissi aur jahan ki
tu jisko samajhta hay falak apnay jahan ka!
——— By: Dr. Allama Mohammd Iqbal
now this is awesome!
In 2004 I with my friend Aleem worked on idea of Semantic Web( as our senior project), and now I have been hearing news of Web 3.0. I decided to work on the idea further in 2005, and may be we could have made a very small scaled 4th generation search engine. Though this has never become reality but now it seems it’s hot time for putting Semantics and AI into web. Reading about Web 3.0 again thrilled me with the idea. Wikipedia has decided to jump into search engines and give Google a tough time :). So I hope may be I get a chance to become part of this Web 3.0 and make information retreival better.
So it’s new week, new month, new year and Eid-Ul-Azha/Adha on same day here in Pakistan. So Happy Eid and Happy New Year to all the people in the world
!
Haroon
I still believe that C was/is my oldest and first love :). And when I read this paper C Traps and Pitfalls By: Andrew Koenig of AT&T Bell Laboratories, this love was even consolidated ;). Specially the function call (*(void(*)())0)(); really made me believe that, “C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, it blows your whole leg”.
For the curious readers the hint is enough that this is the function call to a function whose address is stored at 0(zero) location, rest of the details can be read in the beautiful article that I mentioned earlier.
So I am back after a long break
Anything Possible! - its the motto of Parker Hannifin, the new client of our company. Well I have been included in this exciting yet tougher project in relatively old technology(COM, ATL, MFC etc.). This project has seriously shown me why MFC is not a big success(though I knew it academically) and why MS.NET is better than COM/DCOM. The domain of the project is HMI - Human Machine Inteface/Interaction. Imagine 0.6 millions lines of existing source code, extensive COM and ATL interfaces and classes, and 30 minutes compilation time, aint I having good time and fun doing this project? I will soon write about new learning and any discoveries(if any) relating this project. But for now I am still thinking how a personal never told thought (Anything Possible) can be motto of a billion dollar company, but again you know any thing is possible :). Another good thing about the project is it gave me company of my old batch mate and great friend Rana Hammad Hussain :).
Regards,
I just came across this link. You can now have the Holy Quran in MSN. Just add quraanmajeed@gmail.com in your “MSN Messenger” contacts list you have online Quran Translations in your MSN. You can ask for it’s any specific verse. And you can have a general search also. This is done by a Quran Bot. This is a real good effort and I really appreciate it.
So it’s Chand Raat (New Moon Night) here in Pakistan before the great Religious Eve of Eid-Ul-Fitr in 1427 A.H (Islamic Hijri Year) which marks the end of Holy Month of Ramadan, and the time is 1:51 A.M. This is one great day for Muslims for it’s congregational importance and is sort of gift for us bestowed by Allah according to our belief.
So Eid Mubarik to all the muslims and human in the world. May we undestand true meaning of this day and spread Islamic Essence with accomplishment. Also good Divali wishes to all the Hindus out there in the world ![]()
So another blow to Pakistani Cricket when Paki Paceman Shoaib and New Ball Bowler M. Asif were tested positive for prohibitted anabolic steroid Nandrolone during an internal dope test carried out by the Pakistan Cricket Board. They both reached Pakistan the other night and hence will miss the complete Champions Trophy.
Already Pakistan is suffering from strange happenings since the last test in England, but this is the most comprehensive blow to Pakistani team. I hope Pakistan perform well in the trophy thought it seems impossible
So 8th October came once again, but this time it was some thing really special. Yes, one year of the worst ever natural disaster (Earth Quake in Pakistan, specially in Northern Areas and Independent Kashmir of magnitude 7.6 at Richter scale) completed. Well this was one sadest and most terrible and horrible incident in Pakistan’s history. This day is also memorable to me also in that, it showed to world that this third world country, this country with lesser literacy rates, this nation with all the frauds and problems have a really, really big heart. This day we all witnessed that we can also work for our fellow country men without any reward (except some black sheep). As this day bring tears from heart and eyes, it fills us with joy that we will be together ever in any calamity. All I pray is that all the sufferings of effected are gone, and they get back to proper prosperous life by all the means possible. Long Live Pakistan!
My this post will be how to get the control that caused the Post back in ASP.NET code behind. I got this help from this page, all my courtesies to this guy :).
We will have to access the __EVENTTARGET element of the form. If any one has ever seen a client side HTML source of server side HTML code he/she must be familiar with __EVENTTARGET. A hidden tag is added to the form named __EVENTTARGET after a postback. This hidden input is set to the name of the control that was clicked in the __doPostBack JavaScript function(causing postback) and then the form is submitted. We can access this hidden input from our code-behind as it is submitted with the form and can be found in the Params or Form collections. This is how we get the control that caused a postback. Once we have the name you can get a reference to the control via FindControl and use it as needed.
string ctrlname = page.Request.Params.Get(”__EVENTTARGET”);
if (ctrlname != null && ctrlname != string.Empty)
{
return this.Page.FindControl(ctrlname);
}
The only problem of this method is if post back is caused by a button control. This is because a button is rendered as an input type=”submit” tag, and this causes the form to submit only, so a post back is not occured. Thus button will be added to the form collection of the page. So we can get this very control by a little bit of programming logic. So the code will be some like follows.
public static Control GetPostBackControl(Page page)
{
Control control = null;
string ctrlname = page.Request.Params.Get(”__EVENTTARGET”);
if (ctrlname != null && ctrlname != string.Empty)
{
control = page.FindControl(ctrlname);
}
else
{
foreach (string ctl in page.Request.Form)
{
Control c = page.FindControl(ctl);
if (c is System.Web.UI.WebControls.Button)
{
control = c;
break;
}
}
}
return control;
}
This method takes a parameter which is a reference to the Page, it then uses that to look for the control that caused the postback. You can easily use this as follows:
Control c = PageUtility.GetPostBackControl(this.Page);
if (c != null)
{
//…
}
Anousheh Ansari, first female space tourist is now in contact with Google’s Larry Page
mentioned at Google’s Blog. Wow, what an adventurous ride she is having from earth to ISS (Internationl Space Station). This is called as one outstanding, extra-ordinary experience in one’s life but you have to pay the price (U.S $ 20 Million). But still this experience is worth more than the price. Have a look of her experience at her flickr photos and read details of her life time experience at her space blogs.
So President of Pakistan, General Pervez Musharraf’s book has been launched in markets on 25th of September, and I got the chance to read the details on 26th. “In The Line of Fire“, This is an autobiography book, mainly revolving around Musharraf vs. Former Prime Minister of Pakistan, Nawaz Sharrif, Kargil War 1999, War on Terrorism after 9/11 so Mulla Umar and Osman Bin Ladin are also discussed. Though I have not seen the book, but it’s a highly anticipated book for me as I am much interested in chronology of history. As expected, criticism has started, and I expected some illogical and hypothetical comments from Biggest Secular state of World, and so has happened ;). I cannot comment according to my rationale, on this book until I have my hands on the book and read costly 368 pages :).