Posts

Showing posts from November, 2010

Python program that show the use of a function

def solve(numlegs,numheads):  for numchiken in range(0, numheads+1):   numcow = numheads - numchiken   totallegs = 4 * numcow + 2 * numchiken   if totallegs==numlegs:    return [numcow,numchiken]  return [ None, None ] def barnyard():  numlegs = int(raw_input('Enter the number of legs:'))  numheads = int(raw_input('Enter the number of heads:'))  cow, chiken=solve(numlegs, numheads)  if cow == None:   print 'There is no solution'  else:   print 'There are ', cow, 'cows'   print 'And' ,chiken, 'chicks'

Dealing with Cyberbullies

Dealing with Cyberbullies Bullies are now taking advantage of technology to intimidate and harass their victims. Dealing with cyberbullying can be difficult, but there are steps you can take. What is cyberbullying? Cyberbullying refers to the new, and growing, practice of using technology to harass, or bully, someone else. Bullies used to be restricted to methods such as physical intimidation, postal mail, or the telephone. Now, developments in electronic media offer forums such as email, instant messaging, web pages, and digital photos to add to the arsenal. Computers, cell phones, and PDAs are new tools that can be applied to an old practice. Forms of cyberbullying can range in severity from cruel or embarrassing rumors to threats, harassment, or stalking. It can affect any age group; however, teenagers and young adults are common victims, and cyberbullying is a growing problem in schools. Why has cyberbullying become such a problem? The relative anonymity of the internet...

Assember language

A second generation programming language that uses easily recognized symbols, called mnemonics, to represent instructions.

C

A transprotable programming language  that can be used to develop software.

Number of Muslim army on the eve of Conquest of Makkah

Q.What is the number of Muslim army on the eve of Conquest of Makkah? A.10,000.

Pakistan's Basic Fact

Flora Pine,Oak,Poplar,Maple,Mulberry Fauna The Pheasant,Leopard,Deer,Ibex,Chinkara,Black buk, Neelgai,Markhor,Marcopolo sheep,Green turtles, Tiver and Sea fish,Crocodile,Water Fowls. Popular Games Cricket,Hockey,Football,Billiards. Tourist's Resorts Murree,Quetta,Hunza,Ziarat,Swat,Kaghan, Chitral and Gilgit. Archaeological sites Moenjo Daro,Harappa,Taxila,Kot Diji,Mehr Garh. Major cities Islamabad,Karachi,Lahore,Peshawar,Quetta,Rawalpindi, Hyderabad,Multan,Sialkot, and Faisalabad. Agriculture cotton,wheat,rice, and sugarcane. Exports Cotton,textile goods,rice,leather items carpets,sports goods, fruits,handicrafts,sea food(Fisheries) Area croped in Pakistan 22.14 million hectares. Industries Textile ,cement ,fertiliser ,steel ,sugar ,electric goods ,shipbuilding. Imports Industrial equipment,vehicles,iron ire, petroleum,edible oil.

Pakistan's Basic Fact

National Anthem Approved in June 1954 Verses composed by Abul Asar Hafeez Jullundhri.Tune Composed by: Ahmed G. Chagla.Duration:80 seconds. The State Emblem The crescent and star which is symbol of Islam.The sheild in the cintre shows four major crops.Wreath surrounding the sheild represents cultural heritage.Scroll contains Quaid's motto:Unity,Faith,Discipline. National Flower Jasmine.

How to protect your computer from virus

Don't open email form strangers or attachments you weren't expecting especially attachments with  exe extensions. Back up important files on CD's or DVD's,Zip drives or other storage devices on drive. Install the newest antivirus software on your computer,such as Norton AntiVirus2000 or McAfee Virus Scan for Windows ,or Virex for Macs. Check your software  vendor's Website regularly for updates that will protect against viruses and  worms_like the Love Bug_released since your antiviral soft-ware was written.

The useful and informative websites

Computer and the Internet ZDNet:www.zdnet.com Worldwide Web Consortium:www.w3.org Education College Edge:www.Collegeedge.com/Default.asp Government http://www.pak.gov.pk/ . News http://nawaiwaqt.com.pk/ http://www.dawn.com/ http://www.washingtonpost.com/ Job Search Sites(USA) Career Builder: http://careerbuilder.com/ Career Path: http://www.coreerpath.com/

Pakistan's Basic Facts

Expots Cotton,textile goods,rice,leather items carpets,sports goods, fruits,handicrafts,sea food(Fisheries) Impots Industrial equipment,vehicles,iron ire,petroleum,edible oil Langugaes Urdu(National language),English(Official)&other Languages Include:Sindhi,Punjabi,Balochi,Pushto,Hindku,Kashmiri,Potohari Barahvi,Balti,Saraiki,Shina,etc. Literacy rate 55% Government Parliamentary form Parliament It consists of two Houses i.e. the Senate (Upper House) and the National Assembly(Lower House). The Senate is a permanent legislative body and symbolises a process of contiuity  in the national affair.It consists of 100 members.The four Provincial Assemblies, Federally Administered Tribal Areas and Federal Capital form its electoral college. The National Assembly comprises of a total number of 342 seats,out of which 272 are general,60 reserved for women and 10 non-Muslim seats. Federal Ombudsman Also called "Wafaqi Mohtasib" with its Headquaters in Islamabad and Re...

Pakistan's Basic Facts

Offical Name Islamic Republic of Pakistan Father of the Nation Quaid-e-Azam Muhammad Ali  Jinnah President Asif Ali Zardari(09.09.08) Prime Minister Makhdoom Syed Yusuf Raza Shah Gilani(25.03.08) Capital Islamabad Area 796,096 Sq.km. Punjab:                                                   205,345 Sindh:                                                    140,914 Khyber Pakhtoon Khuan:                 ...

Pakistan's Cheif Martial Law Administrators

Name Duration 1.Gen. Ayub Khan Oct.7,1958     to June.8,1962 2.Gen. A.M. Yahya Khan Mar. 25,1969 to Dec.20.1971 3.Z.A.Bhutto                     Dec.20,1971  to April 21,1972 4.Gen. Zia-ul-Haq             July 5,1977    to Dec.30,1985 

Internet Lingo

The following abbreviations are sometimes used in internet documents and in e-mail. BTW F2F FCLO fWIW FYI GG GOK HHOK IMHO IMO J/K LOL OTOH PLS POTFL TAFN TTFN By The Way Face to Face.:a personal meeting For crying out loud For what its worth For your information Got to go God only knows Ha,ha only kidding In my humble opinion In my opinion Just kidding Laughing loud On the other hand Please Rolling on the floor laughing That's all for now Ta-ta for now

Governor Generals of Pakistan

                Names                Durations Quaid e Azam Aug.15,1947 to Sep.11,1948 Khawaja Nazimuddin Sep.14,1948 to Oct.17,1951 Ghulam Muhammed Oct.19,1951 to Oct.5,1955 Maj. Gen. Iskander Mirza Oct.6,1955 to Mar.22,1956

Current Prime Minister of Pakistan

Q.Who is the current Prime Minister Of Pakistan? A. Syed Yusuf Raza Gilani is the current Prime Minister of Pakistan(Mar.25,2008 to till date)

Presidents of Pakistan

               Name                 Duration 1.Iskander Mirza.  Mar.23,1956 to Oct.27,1958. 2.Gen. Ayub Khan.     Oct.27,1958 to Mar.26,1969. 3.Gen. A.M. Yahya Khan.  Mar.25,1969 to Dec.20,1971. 4.Zulfiqar Ali Bhutto.   Dec.20,1971 to Aug.13,1973. 5.Ch. Fazal Elahi. Aug.13,1973 to Sept.16,1978. 6.Gen. Zia-ul-Haq.    Sept.16,1978 to Aug.17,1988. 7.Ghulam Ishaq Khan.  Aug.17,1988 to July.18,1993. 8.Farooq Ahmed Laghari. Nov.14,1993 to Dec.2,1997. 9.M. Rafiq Tarar. Jan.1,1998    to June.2,2001. 10.Gen. Pervez Musharaf. June.20,2001 to Aug.18,2008. 11.Asif Ali Zardari. Sept.9,2008 to till date.

President of Pakistan

Q.Who is the President of Pakistan? A. Leader of Pakistan People's Party   Asif Ali Zardari is the current President of Pakistan.

Best Qoute

When you want a thing bad enough to go out and fight for it, To work day and night for it, To give up your peace and your sleep and your time for it; If only the desire of it makes your aim strong enough never to tire of it; If life seems all empty and useless without it, And all that you dream and you scheme is about it; If gladly you'll sweat for it, fret for it, plan for it, Pray with all your strength for it; If you'll simply go after the thing that you want with all your capacity, Strength and sagacity; faith, hope, and confidence, stern pertinacity; If neither poverty nor cold nor famish nor gaunt Nor sickness or pain to body or brain can turn you away From the aim that you want; If dogged and grim, you besiege and beset it, you'll get it!                     Author Unkno

Using Caution with Email Attachments

Using Caution with Email Attachments While email attachments are a popular and convenient way to send documents, they are also a common source of viruses. Use caution when opening attachments, even if they appear to have been sent by someone you know. Why can email attachments be dangerous? Some of the characteristics that make email attachments convenient and popular are also the ones that make them a common tool for attackers: Email is easily circulated - Forwarding email is so simple that viruses can quickly infect many machines. Most viruses don't even require users to forward the email—they scan a users' computer for email addresses and automatically send the infected message to all of the addresses they find. Attackers take advantage of the reality that most users will automatically trust and open any message that comes from someone they know. Email programs try to address all users' needs - Almost any type of file can be attached to an email message, so atta...

Cricketer's database

cricket match players record 2-D linked List struct Player { int player_id; char player_name[30]; char player_type[15]; // batsman,bowler or all rounder int runs; int wkts; struct Player *next; struct Player *prev; } Functions insertion( ) deletion( ) updation( ) search( ) dispose( ) show_all( ) calculate_total_runs( ) calculate_total_wkts( ) calculate_runrate( ) // calculate the run rate #include #include #include #include void total_runs(void); void total_wkts(void); void run_rate(void); void new_player(void); void listall(void); void update(void); void search(void); void delete_player(void); void dispose(void); typedef struct player {  int id,runs,wkts;  char name[30],fname[30],p_type[20];  struct player *next,*prev; }; struct player *header,*current,*preve,*temp; int tep; char ch,tap[30]; int sum=0,sum1=0; float runrate; void main(void) {  int gm=0,gd=0;  initgraph(&gd,&gm,"g:/tc/bgi");  heade...

Program which takes a character as input and tells weather its a lower case or upper case and if it is a vowel

Write a program which takes a character as input and tells weather its a lower case or upper case and if it is a vowel? #include #include void main(void) { while(1)   {    char ch;    clrscr();    char n;   printf("Enter Character = ");    scanf("%c",&n);     if(n>64&&n<91)     {      printf("\n\n\nCharacter ( %c ) is UPPER CASE",n);      if(n==65||n==69||n==73||n==89||n==85)      printf("\nCharacter ( %c ) is WOVELS",n);      else      printf("\nCharacter ( %c ) is NOT WOVELS",n);    }    else if(n>95&&n<123)     {      printf("\n\n\nCharacter ( %c ) is LOWER CASE",n);      if(n==97||n==101||n==105||n==111||n==117)      printf("\nCharacter (...

Best Qoutes

Go confidently in the direction of our dreams! Live the life you\'ve imagined. Author :Henry David Thoreau     Life's challenges are not supposed to paralyze you, they're supposed to help you discover who you are. Author :Anonymous     The question isn't who is going to let me; it's who is going to stop me. Author :Ayn Rand     First they ignore you, then they laugh at you, then they fight you, then you win. Author :Mahatma Gandhi     Nothing splendid was ever created in cold blood. Heat is required to forge anything. Every great accomplishment is the story of a flaming heart. Author :Arnold H. Glasgow     Happy are those who dream dreams and are ready to pay the price to make them come true. Author :Leon J. Suenes     Reach high, for stars lie hidden in your soul. Dream deep, for every dream precedes the goal. Author :Pamela Vaull Starr     Plan your work, then ...

4 Tips to stay Motivated

By: Shannon Clark Article Summary:  When you are feeling less motivated than before, your self-efficacy levels may be very low. New strategies for focusing and journaling can help you get back on top of your game. Try switching goals entirely to amp up your motivation! If you're like most people, from time to time you're going to find your motivational levels starting to wane, which can seriously derail your goals and overall belief capability in yourself. How much effort we regularly put into all the aspects of our lives helps us to form our own self-efficacy, which is essentially our belief in ourselves to get things done. When you have low self-efficacy levels, you'll find that you have an overall lower self-confidence and experience less success in all aspects of your life. By making sure you can stay the course with not only your workouts but any other projects you set out to accomplish, you help boost your self-confidence in your ability. It's not only great for t...

First day of the year

Write a program to show the first day of the year input through the keyboard. #include #include int main () { int year,days,d; printf("year?"); scanf("%d",&year); days = 365*year + (year-1)/4 - (year-1)/100 + (year-1)/400 ; d=days%7;//to find which day of week if(d==1) printf("\n\n\tmonday"); else if(d==2) printf("\n\n\ttuesday"); else if(d==3) printf("\n\n\twednesday"); else if(d==4) printf("\n\n\tthursday"); else if(d==5) printf("\n\n\tfriday"); else if(d==6) printf("\n\n\tsaturday"); else if(d==0) printf("\n\n\tsunday"); getch(); return(0); }

Company Policy Program

The policy followed by a companty yo process customer orders is given by the following rules:  (a)If a customer order quantity is less than or equal to that in stick and his credit is OK,supply his requirment.  (b)If his credit is not OK do nit supply.Send him an intimation.  (c)If  his credit id OK but the item in stick is less than his order,supply whit is in stick.Intimate to him the date in which the balance will be shipped. #include #include void main(void) {  clrscr();  long int order,date,stock,credit;  printf("Enter the date of order(DD):");  scanf("%ld",&date);  printf("Enter the required order:");  scanf("%ld",&order);  printf("Enter your past credit with the company:");  sanf("%ld",&credit);  if(order>50000)  {   printf("Sorry,We have 50,000 in stock now,the remaning will be supplied by 15th of the next month");  }  else if(credit>100000)  {...

Good Security Habits

There are some simple habits you can adopt that, if performed consistently, may dramatically reduce the chances that the information on your computer will be lost or corrupted. How can you minimize the access other people have to your information? You may be able to easily identify people who could, legitimately or not, gain physical access to your computer—family members, roommates, co-workers, members of a cleaning crew, and maybe others. Identifying the people who could gain remote access to your computer becomes much more difficult. As long as you have a computer and connect it to a network, you are vulnerable to someone or something else accessing or corrupting your information; however, you can develop habits that make it more difficult. Lock your computer when you are away from it. Even if you only step away from your computer for a few minutes, it's enough time for someone else to destroy or corrupt your information. Locking your computer prevents another person from bei...

Effect of Tawheed in Human Life

Effects of Tawhid on Human Life Abul A'la Mawdudi, Towards Understanding Islam Now let us study the effects which the belief in La ilaha illallah has on the life of a man and see why he should always make a success of life and why one who denies it becomes a failure in life, both here and in the hereafter. A believer in this Kalimah can never be narrow in outlook. He believes in a God Who is the Creator of the heavens and the earth, the Master of the East and the West and Sustainer of the entire universe. After this belief he does not regard anything in the world as a stranger to himself. He looks on everything in the universe as belonging to the same Lord he himself belongs to. His sympathy, love and service are not confined to any particular sphere or group. His vision is enlarged, his intellectual horizon widens, and his outlook becomes as liberal and as boundless as is the Kingdom of God. How can this width of vision and breadth of mind be achieved by an atheist, a pol...

Largest number in a 5x5 matrix

Write a program to pice up the largest number from any 5 row by 5 column matrix. #include #include void main(void) {  clrscr();  int arr[5][5],i,k,*fp;  for(i=0;i<5;i++)  {   for(k=0;k<5;k++)   {    printf("Enter the %d row and %d column element:",i+1,k+1);    scanf("%d",&arr[i][k]);   }  }  *fp=arr[0][0];   for(i=0;i<5;i++)   {    for(k=0;k<5;k++)    {     if(*fp     {      *fp=arr[i][k];     }    }   }    printf("%d is the largest of all",*fp);  getch(); }

What Does Islam Say About Life's Purpose?

What Does Islam Say About Life's Purpose? Have you ever stopped to ask yourself these questions? - • "What is the purpose of everything?" • "How did we get here?" • "What does it all mean?" • "What is meaning of Life?" People everywhere are asking the questions; "What is the purpose of life?" and "Why are we here?" You might be amazed to learn, that Islam is providing clear and concise answers for these questions. Most of those who reflect or think about life in any detail will consider and ponder these questions. There are as many different answers to these questions as there are people asking the questions. Some would hold that the purpose of life was to acquire wealth. Yet suppose they were to acquire millions of dollars, what then would they claim is their purpose after doing so? <> If the purpose of life is to become wealthy, there would be no purpose after becoming wealthy. The fact is that w...

Half diomand shape

Write a program which takes a as input and draw the half diomand shape. #include #include void main(void) {    clrscr();    int a,b,n,i,j,sp1,sp2;    printf("Enter Odd Number = ");    scanf("%d",&n);    for(a=1;a<=n+2;a=a+2)    {        for(sp1=a;sp1<=n;sp1=sp1+2)        printf(" ");        for(b=1;b<=a;b++)        {        printf("%d",b);        }        printf("\n");    }    for(i=n;i>=1;i=i-2)    {        for(sp2=n;sp2>=i;sp2=sp2-2)        printf(" ");        for(j=1;j<=i;j++)        {        pr...

First day of the Year

Write a program that takes the year as input and tell the first day of that year. #include #include int main () { int year,days,d; printf("year?"); scanf("%d",&year); days = 365*year + (year-1)/4 - (year-1)/100 + (year-1)/400 ; d=days%7;//to find which day of week if(d==1) printf("\n\n\tmonday"); else if(d==2) printf("\n\n\ttuesday"); else if(d==3) printf("\n\n\twednesday"); else if(d==4) printf("\n\n\tthursday"); else if(d==5) printf("\n\n\tfriday"); else if(d==6) printf("\n\n\tsaturday"); else if(d==0) printf("\n\n\tsunday"); getch(); return(0); }

7 Tips of Setting Goals

Introduction: Setting goals is one of the most important thing that you do in bodybuilding and if you don't have any written goals you might not be able to achive that you want,I've seen alot of people who joined the gym but due to the lack of goal they quit it in just a couple of months.And I don't want you to be one of those guys out there. Here are the seven tips that can help you setting goals and achive your dreams. 1.Decide exactly what you want: First,ask yourself what you exactly want, cool arms,big thighs,or just a fit body,etc.And your goal must be realistic,it must not be like "after 10 days I'm going have a 2inches increase in my arms ". This will not let you where you wanna go ,this will make you demotivated and you'll also be added to the list of the people who have failed in bodybuilding. 2.Paper work: What ever you want write it down on paper,because when you do so you prioritize the thing that you want and gives you the power an...

12 Steps To Rejuvenate Lost Goals

By: Diana Rini 12 Steps To Rejuvenate Lost Goals: Get Back On The Fitness Track Now! Have you ever resolved to get back on track with your fitness program on a Monday, before summer, or after the New Year? Whether you want to turn over a new leaf, get that six-pack, or simply get back on course with your fitness program, many well intentioned people vaguely set "a day" in which they resolve to get back on track to a regular fitness program. If for some reason Monday or New Year's well intentioned plan goes off course, the whole thing usually gets abandoned for another frustrating week, month, or year. This can lead up to more unwanted pounds and less resolve to reach your fitness goals. Even though we have all the resources within our fingertips, all the resources in the world are useless if we can't get ourselves to apply it. With the weekend, holidays, and maybe a few extra pounds now behind you (literally and figuratively), it's easy to lose your r...