Re-sizing ListView columns in C# according to data

I was searching for an easier and simpler way to resize columns in list-view in window-forms in C#, and I got the trick on this link.

Link of the post

The following is the text copied from the above link.

This one is easy. If you set a ListView column’s width to -1, it automatically resizes to fit the data it contains. If you set the width to -2, it resizes to fit its data and column header.

This example displays buttons that let you set the ListView’s column widths to 100 pixels, -1, or -2. The program uses the SetListViewColumnSizes method to set all of the column widths at once.

// Set the listView's column sizes to the same value.
private void SetListViewColumnSizes(ListView lvw, int width)
{
    foreach (ColumnHeader col in lvw.Columns)
    {
        col.Width = width;
    }
}

ہمارے علما اور اسلام

میرا ایک دوست تھا، عابد نواز. ہم ١٩٩٩ میں نویں جماعت میں ایک ساتھ بیٹھے تھے. افغانستان پر امریکا کروز میزائلوں کا حملہ کر چکا تھا. عابد نواز بہت پرجوش تھا اور کہا کرتا تھا کی ہم لوگ ڈنڈوں سے امریکی ٹینکوں کا برا حال کر دیں گے. میں خود اس کی اس طرح کی باتیں سن کر ہنستا بھی تھا اور اس کی عقل پر افسوس بھی کرتا تھا. 

آج جب میں سوچتا ہوں تو مجھے اور بھی افسوس ہوتا ہے کہ ہمارا دینی طبقہ اور ہمارے علما  بھی دنیا سے بلکل اسی طرح بے خبر ہیں. وہ اسلام کو نافذ کرنے کی باتیں تو کرتے ہیں لیکن وہ اسلامی نظام کے بارے میں بہت کم جانتے ہیں. ہمارے علما اسلامی معاشی نظام اور موجودہ سرمیدارانہ نظام میں کوئی فرق نہیں جانتے. ہمارے علما موجودہ کرنسی کے نظام اور متبادل اسلامی نظام سے بلکل لاعلم ہیں.

میں چند مدّت سے قرض اور اس پر افراط زر کے اثرات پر سوچتا رہتا ہوں. میں نے چند علما سے اس مطلق بات بھی کی لیکن وہ جو جواب دیتے ہیں وہ ثابت کرتا ہے کہ یہ لوگ کچھ نہیں جانتے. ہمارے علما کفر اور سرمیدارانہ نظام کے ٹینک کو اپنی لاعلمی کے ڈنڈوں سے توڑنا چاہتے ہیں اور پچھلے ایک صدی سے عوام کو بیوقوف بنا رہے ہیں.  

پولیس کو تباہ کرنے کے طریقے

پولیس کا مقصد کسی معاشرے میں امن و امان اور نظم و ضبط قایم کرنا ہے.  اس کے بغیر معاشرہ جنگل بن جاتا ہے. معاشی سرگرمیاں رک جاتی ہیں اور لوگوں کی عزت اور جان و مال محفوظ نہیں رہتا. اور آخر میں کمزور لوگ یا تو بھوک سے مر جاتے ہیں یا طاقتور کے ہاتھوں مار دیے جاتے ہیں.
کسی بھی معاشرے کو تباہ کرنے کیلئے اس کے پولیس نظام کو خراب کرنا ضروری ہے. اس کے کیی طریقے ہیں.
.پولیس میں رشوت اور سفارش کو رواج دیا جایے.
.پولیس میں غلط طریقے سے غلط لوگوں کو بھرتی کیا جایے.
.معاشرے میں تعلیم کا معیار اتنا گرا دیا جایے کے پولیس کو باصلاحیت لوگ نہ مل سکے.
.اگر معاشرہ مسلمانوں کا ہو) پیغمبر کے کارٹون چاپ دیے جیئں. معاشرے کے لوگ خود ہی پولیس پر احتجاج کے دوران حملے کرکے اس کو ناکارہ کردیں گے)

Good Memories and Shower in Summer

It is a hot day, and no power since noon, and it is afternoon.
I have to take shower as it is my third day without shower.
I take shower every second or third day, since my only activity is sitting in front of computer and daily 5 km walk in afternoon.
Due to no power, I can’t take shower with fresh cold water of well, so i will give a try to the tank water which is not warm either, just normal.
And when I stood below the shower, and water droplets are running over me, I remember some occations from previous year.
In Berdoch, a hill point near our village, the fresh water-pond I was bathing in was very cold and the sensation of coldness was giving me shiverings.
In Pirsay, another hill point near our village, when it began to rain while me and my friends were bathing in the running water, the rain-drops were hotter than the stream water. And I didn’t like the August rain which felt warm.
I was thinking all of these while showering with normal not-hot water and deep inside cursing wapda, I got a strange sensation in my body, just like the cold-water gave me when I was bathing in the hill-stream water.
The sensation and feeling overcame me and after the shower I had nothing on my face but a satesfied smile, like I had taken a bath with cold water in a hot afternoon.
And I thought, good memory of old times can change how you feel now and alter you mood.
Good memories are our treasures that come handy in bad times.
So, try to gather good memories once in a while and try to enjoy even the bad timings through them.

 

Blessings of PPP Leadership on Pakistani People

Two days ago, at 16 June 2012, Prime Minister (PM) of Pakistan, Saeed Yusuf Raza Gilani, was coming to Mardan and so there was no load-shedding all over Mardan district all day long. Someone said that it seems a blessing associated with the PM. This raised a strange thought in my head, which might seem too crazy but in the current situation where there is no power in the hot summer despite the regular payment of bills, i think it would be not taken so seriously. So here I am presenting the strange thought of mine about the blessings of PPP PM and leadership.

Suppose there is a blessing with the PM and wherever he visits the load-shedding vanishes from there. And people see electric-power for the day long. Now, the PM is a common landlord from Multan and he has been PM only once and there is no other important thing about him, and still he has so much blessing.

What about Benazir Bhutto (BB), who was twice PM and daughter of a founder and PM of PPP. Further, she is the martyr of PPP and her death was the main cause of current PPP government. More, her death gave us the current PM and the blessings associated with him.

I was thinking about what if we use the blessing of BB against load-shedding. If we dig-out her corpse from her grave and move it all around Pakistan and I am sure wherever it will go, due to its blessings the load-shedding would vanish. And there is one other advantage. PM is a busy person and he has to attend several meetings and other humanly needs. But BB is dead and her corpse would not need anything to do and so the corpse will be free all the time to travel everywhere. I think people will appreciate it a lot. So the current government and PPP leadership should seriously think about it. And it can also help them in the incoming election a lot. And the BB dead body will be helpful at second time to bring PPP in government again.

The above is only an idea or suggestion and even I myself am a little skeptic about its working. And I am not associated with any political party. And I am not accepting any responsibility of deeds committed by the resultant incoming PPP government. But to be careful, I apologize in advance.

Government Degree College, Khairabad Mardan

 

Bad and Corrupt Teaching in Khairabad Degree College Mardan

Bad and Corrupt Teaching in Khairabad Degree College Mardan

College name is Khairabad Degree College. It is located on Bunir Road, between Rustam and Shahbaz Gari in Khairabad, Mardan.

It is third major degree college of Mardan district. Students from Sawabi and allMardan regions come here.

In my time, it was a good college, with good teachers. I admire the teachers who were very intelligent and knew how to do teaching. They never wasted our time, though we did wasted theirs and ours. They advised us regularly to not waste time and it very precious thing. And I, personally, learned a lot of from them, and until now they are my role models. Whenever I think about that time, all I do is pray for them.

Now a day, like other government institutes, its worst of its kind. I asked one student about how the teachers are. He told me that about every teacher comes to classes only once in a week, and then students search for them. And when they come, they don’t do any teaching, either they don’t know the actual subject matter or they are not interested at all.

As my field of study is computer science, I asked him about the computer science. He is also a student of computer science and he told me that the teacher name isAurang Zeb or Aorang Zeeb, or Aorang Zeb, whichever is valid, and is from Sawabi. He knows nothing about computer science. He rarely comes to class, and he even can’t come to the first class of the day, since he wakes up late in morning. He has been made lecturer on Sifarash or illegal recommendation and approach of Shah Ram Khan from Sawabi.

Aurang Zeb or Aorang Zeeb, or Aorang Zeb, whichever is valid, used to tell the students that he is doing the tiny amount of teaching only to avoid the embarrassment in some future meetings or confrontations with the students; otherwise he doesn’t give a damn about them and their study.

The student has read computer science for two years and has no concepts about computers and programming. He will have at least 30 to 40 class fellows, and he and his class fellows have wasted their two years. This means, 60 to 80 years of students have been wasted, by one teacher, Aurang Zeb or Aorang Zeeb, orAorang Zeb, whichever is valid.

I asked him about other teachers, and he told me the same story about them also. I will write about them in next posts.

Americans and their Justice

Justice system and human-rights system of developed nations is skewed, how much, lets see.
Americans used agent orange on Vietnam which resulted in millions of deaths, disabilities, and affected several generations, despite extremely harsh social and economical difficulties of local population. That also affected American soldiers who were involved in the alleged use of the chemical weapon.
The American soldiers and their families sued their government and the civilian companies involved in production and use of the agent orange. This resulted in about 127 million US dollars as compensations.
Koreans were also affected as some of the chemical was stored there. They also sued and they got 62 million dollars in compensation.
All the above happened in a developed nation and between two such nations. Now lets see what happens when it comes to the undeveloped nation.
Victims of agent orange in Vietnam also placed a lawsuit in American courts and they got nothing. Though they got a few million dollars in aid which was divided in several parts and a considerable part of which went back to America as compensation of the aid workers. And it was considered a great generosity of Americans for helping poor nations.

http://en.wikipedia.org/wiki/Agent_Orange

Prays that makes no sense

We all know that it is useless to pray from God life of dead.
We all know that the situation in our country, Pakistan, and society is worsening with time. Anyone living in such society can never be happy and satisfied. This is a bad thing that is present for a long time. This will remain the same unless it is changed by some collective efforts. That means making individual and personal sacrifices and we are strictly against that.
So, I want to say that there is a great irony and stupidity when we pray for each other, “there may be no unhappiness to you and you may get only happiness” (which is not possible when living in this society, unless someone starts using drugs). We pray that there will be no mishaps (but living in such a society by itself is a big mishap). And we pray from God to give us satisfaction, but satisfaction can come to someone who has done something for others and society, and here if anyone wants to do something for society by sacrificing personal interests, we call them stupid and losers, as they are doing something which has no apparent outcomes and worldly benefits.
So, when we, wise and clever people pray, what we want from God is something nonsense like praying for dead person’s life.
But we, the clever and wise guys, forget that at the end of the day the so called losers and stupids get some satisfaction since they have done something for God’s creatures, and worldly success and goals are temporary and not guaranteed by God, even to prophets.

Pakisan and India Fight and West reaps the Fruits

whenever Pakistanis and Indians fight, no side gets benefit. Only west gets.
Pakistanis and Indians must understand that their fighting on ambiguous historical facts and politicians and media with hidden agendas is doing no good to any nation. It has been a hurdle in the prosperity of the region and the subsequent dependence on western shameful aid…
Learn from China + Taiwan + S. Korea + Japan… They are strongly against each other, but they are doing a lot of trades and who gets benefits? The whole region. And western financial, military and political dominance is disturbed and that is why they are shitting in china sea to engage them in wars and buy western weapons…
Wake up stupid and idiot people….

Pakistani Fertilizers and CIA plus Taliban

Why should Pakistan stop fertilizer factories and destroy its agricultural system? Only try to help Americans who started drug production in Afghanistan? If the smuggling of fertilizers from Pakistan are responsible, then why CIA doesn’t target the fertilizer smugglers in Afghanistan instead of killing innocent kids, women, and men in Pakistani tribal regions? The CIA can track down and kill the so called terrorists in Pakistani region but can’t stop Taliban in Afghanistan to transport tonnes of fertilizers to make bombs.

Remember, Taliban stopped drugs in Afghanistan and Americans started it again via CIA, which already has a history, after occupying Afghanistan.

In ten years of occupation in Afghanistan Americans till didn’t understand how complex and hard is to control Pak-Afghan border, which is not well defined and consist of extremely hard-to-access regions and Pakistan could not have proper control from the beginning. And still Americans are playing the blame-game.

Americans have deployed more than 130,000 army and have Afghan army and they have deadly drones of CIA but can’t defend Afghan borders and stop smugglers to provide fertilizer to Taliban. Its and irony. They can’t control Afghanistan and fight and blame Pakistan for their problems.

Pakistanis are suffering most from Afghan war, as Pakistan is feeding millions of Afghans for decades which is hard for its society and economy. And Americans dead-squad are suffering just a little while they are using body parts of innocent Afghans as trophies.

 

« Older entries

Follow

Get every new post delivered to your Inbox.

Join 95 other followers