Monday, 27 July 2009

How to connect two computers in Windows XP

Here are the steps to connect two computers in Windows XP. This will let you share files and folders, printers, play network games, etc...

Steps

  1. Connect the two computers together either with a Crossover cable or a Hub/Switch to the ethernet card in your computer.
  2. Set the IP address on both computers. Goto Start > Control Panel > Network Connections (choose switch to classic view if you cannot see network connections)
  3. Look for your Local Area Connection ethernet adapter, right-click and choose properties.
  4. Select Internet Protocol TCP/IP and choose properties.
  5. Setup the IP as 192.168.1.1 and the subnet mask of 255.255.255. 0 on the first computer and 192.168.1.2 on the second with the same subnet mask.
  6. Choose OK then OK/close again.

Tips

  • To share your files, right click on any folder and choose Sharing to make them shared.
  • You can also do this with your printers to be able to print from one computer while the printer is connected to the other.

Things You'll Need

  1. A Crossover cable. This a Cat5 Ethernet Cable that the wires have been switched around to allow two computer only to talk to each other or you can purchase a switch/hub with two Standard "Straight-Through" Ethernet Cables.
  2. Check to see if your computer has an Ethernet Adapter in the back of the computer. Most new computers have this. You can tell by the documentation from the computer or by looking at the back of the computer. It looks like a phone jack, but larger.How to connect two computers in Windows XP

Change System Properties Logo and Information

Below are some useful links if you are interested in changing the PC manufacturer logo and information in the System Properties dialog box which is opened when you right click on the My Computer icon on desktop.

Computer System Properties Panel

If you have purchased a machine from one of the big manufacturers, you will have seen that they have customised the "System Properties" window with their own logo. In addition, there will usually be a button next to it, which gives you additional support information. These two items are known as OEM information, and can be easily replaced with your own. This is useful if you build your own computers, or in a larger office allowing you to place the company branding on the machines along with details on how to contact your internal

World General Knowledge

The London University was the first British University to admit women for degree courses.

New York is popularly known as the city of Skyscrapers

Madagascar is popularly known as the Island of Cloves

Thailand is the country known as the Land of White Elephant.

Korea is known as the Land of Morning Calm.

Bhutan is known as the Land of Thunderbolts

Salto Angel Falls in Venezuela is the highest waterfalls in the world.

United States Library of Congress in Washington DC is the largest library in the world is the

The author of Harry Potter Books is JK Rowling

Nickname of New York city is Big Apple

Theodore Roosevelt was the youngest President of the USA.

Brazil is the largest coffee growing country in the world.

Verkoyansk in Siberia is the coldest place on the earth.

The length of the English channel is 564 kilometres.

Damascus is the world's oldest known city.

Detroit in the USA is the city which is the world's biggest centre for manufacture of automobiles.

The country which is the largest producer of rubber in the world is Malaysia.

Amazon River carries maximum quantity of water into the sea.

Cuba is known as the Sugar Bowl of the world.

The length of the Suez Canal is 162.5 kilometers.

James Cook discovered Australia.

Mohammed Ali Jinnah was the first Governor General of Pakistan.

Alexander Eiffel was the person who built Eifel Tower.

Rose is the national flower of Britain.

The national flower of Italy is Lily.

World Environment Day is observed on 5th June.

The earlier name of Sri Lanka was Ceylon

United Nations Organization(UNO) was formed in the year 1945.

Admiral Robert E. Peary was the first man to reach North Pole.

The place known as the Roof of the world is Tibet.

The first Pakistani to receive the Nobel Prize was Abdul Salam.

The first woman Prime Minister of Britain was Margaret Thatcher

Science Related

Electricity doesn't move through a wire but through a field around the wire.

The computer mouse was invented 30 years ago.

Almost 20 years ago first test-tube baby born in England.

The longest cells in the human body are the motor neurons. They can be up to 4.5 feet (1.37 meters) long and run from the lower spinal cord to the big toe.

The sun is 330330 times larger than the earth.

The first American space stations name was Skylab, In 1979 skylab fell on the earth in thousands of pieces fortunately all in the oceans.

The Stegosaurus dinosaur measured up to 30 feet (9.1 meters).

An inch (2.5 centimeters) of rain water is equivalent to 15 inches (38.1 centimeters) of dry, powdery snow.

The average ice berg weighs 20,000,000 tons.

The Hubble Space Telescope weighs 12 tons (10,896 kilograms), is 43 feet (13.1 meters) long, and cost $2.1 billion to originally build.

The largest flying animal was the pterosaur which lived 70 million years ago. This reptile had a wing span of 36-39 feet (11-11.9 meters) and weighed 190-250 pounds (86-113.5 kilograms).

There are 206 bones in the adult human body and 300 in children

The most powerful laser in the world, the Nova laser at Lawrence Livermore National Laboratory, CA, USA, generates a pulse of energy equal to 100,000,000,000,000 watts of power for .000000001 second to a target the size of a grain of sand.

The fastest computer in the world is the CRAY Y-MP C90 supercomputer. It has two gigabytes of central memory and 16 parallel central processor units.

The cosmos contains approximately 50,000,000,000 galaxies.

Boron nitride (BN) is the second hardest substance known to man.

The only letter not appearing on the Periodic Table is the letter "J".

The seeds of an Indian Lotus tree remain viable for 300 to 400 years.

The microwave was invented after a researcher walked by a radar tube and a chocolate bar melted in his pocket.

No matter its size or thickness, no piece of paper can be folded in half more than 7 times.

A car traveling at 80 km/h uses half its fuel to overcome wind resistance.

The typewriter was invented in 1829, and the automatic dishwasher in 1889.

The wristwatch was invented in 1904 by Louis Cartier.

When glass breaks, the cracks move at speeds of up to 3,000 miles per hour.

Alexander Graham Bell invented the telephone.

The Earth's equatorial circumference (40,075 km) is greater than its polar circumference (40,008 km).

Flying from London to New York by Concord, due to the time zones crossed, you can arrive 2 hours before you leave.

The surface speed record on the moon is 10.56 miles per hour. It was set with the lunar rover.

Just twenty seconds worth of fuel remained when Apollo 11's lunar module landed on the moon.

Computer Related

Abacus is cnsidered as the first known counting device and it was orginated from Asia. Abacus worked on a place-value notion meaning that the place of a bead or rock on the apparatus determined how much it was worth.

In 1642 a French mathematician and philosopher Blaise Pascal invented the first mechanical digital calculator using gears known as the Pascaline.

In 1812 Charles P. Babbage later known as the "father of the computer",designed a machine, the difference engine which was steam-powered, fully automatic and commanded by a fixed instruction program.

In 1947 the giant calculating device ENIAC (Electrical Numerical Integrator and Calculator) machine was developped by John W. Mauchly and J. Presper Eckert, Jr. at the University of Pennsylvania.

In early 1960s Gene Amdahl designed the IBM System/360 series of mainframe computers, which considered as the first general purpose digital computers which uses intergrated circuits.

In 1961 Dr. Hopper developed the COBOL (Common Business Oriented Language) programming language.

In 1964 the International Business Machines (IBM) publishes and marketed the term "word processor

In 1965 Dr. Thomas Kurtz and Dr. John Kemeny developped BASIC (Beginners All-purpose Symbolic Instruction Code) programming language .

In 1969 the Internet was started.

In 1969, computers were first used to communicate synchronously.

In 1970 Dr. Ted Hoff developed the famous Intel 4004 microprocessor (G) chip.

In 1971 the Intel released the first microprocessor, a specialized integrated circuit which was able to process four bits of data at a time.

In 1976 Apple Computers was founded by Steven Jobs and Stephen Wozniak.

In 1981 the IBM PC was introduced with a 16-bit microprocessor.

Life Cycle of Frog

The Egg
Frogs lay their eggs in water or wet places. A floating clump of eggs is called frog spawn.

The large and slippery mass of eggs are too big to be eaten. This is nature's way of protecting them. But, the smaller clumps of eggs will be eaten by the creatures living near or in the pond.

The egg begins as a single cell. Several thousand are sometimes laid at once. It becomes surrounded by a jellylike covering, which protects the egg. The female may or may not stay with the eggs to take care of the young after she has laid them. The egg slowly develops. But, only a few develop into adults. Ducks, fish, insects, and other water creatures eat the eggs.
Life Cycle of Frog
The Cell Splits

The single cell in the egg eventually splits into two. These two split making four cells, and so on. Eventually, there are many cells in the egg.
The Embryo

The mass of cells in the egg come to form an embryo. Organs and gills begin to form, and in the meantime, the embryo lives off of its internal yolk. This supplies it with nutrients for 21 days. Then . . .
The Tadpole
Frog Lifecycle

After its 21 day development period, the embryo leaves its jelly shell, and attaches itself to a weed in the water. This quickly becomes a tadpole, a baby frog. The tadpoles grow until they are big enough to break free into the water. This can take from 3 days to 3 weeks, depending on what kind of frog they will become. They eat very small plants that stick to larger plants in the water. These tiny plants are called algae. The tadpole has a long tail, and lives in the water. It is extremely vulnerable, and must rely on its camouflage to protect it.
The tadpole has a long tail, and lives in the water. It is extremely vulnerable, and must rely on its camouflage to protect it. The tadpoles also face danger by being eaten by other water animals. Sometimes the pond dries up. As a result the tadpoles die.
The Tadpole Begins To Change
After about five weeks, the tadpole begins to change. It starts to grow hind legs, which are soon followed with forelegs. Behind their heads bulges appear where their front legs are growing. Their tails become smaller. Lungs begin to develop, preparing the frog for its life on land. Now and then, they wiggle to the surface to breathe in air. The tail becomes larger and makes it now possible for the tadpole to swim around and catch food. They eat plants and decaying animal matter. Some tadpoles eat frogs eggs and other tadpoles.
Almost There . . .
Over time, the tadpole becomes even more froglike. They have shed their skin and lips. Its mouth widens, and it loses its horny jaws. The tail becomes much smaller, and the legs grow. The lungs are almost functioning at this point.
The Frog
Frog
Eleven weeks after the egg was laid, a fully developed frog with lungs, legs, and no tail emerges from the water. This frog will live mostly on land, with occasional swims. The tiny frogs begin to eat insects and worms. Eventually, it will find a mate. The way this is done varies depending on the species. The female lays the eggs, the male fertilizes them, and the whole process begins again.

Lifecycle Frog

Life cycle of a Butterfly

Egg Stage
  • The female butterfly lays an egg on a plant.
Larva Stage
  • The egg hatches and the larva (caterpillar) comes out.
Pupa Stage
  • The caterpillar feeds on the plant and grows. When its skin becomes too small, the old skin splits open and the caterpillar pops out with a new skin on. This happens four or five times. When the caterpillar is fully grown it makes a little silk pad on a leaf or twig and attaches itself to it. The caterpillar's skin splits for the last time. It is now in the pupa stage.
  • Under the skin is the chrysalis. Many changes happen to the chrysalis. The wings, legs and rest of the butterfly are formed inside the chrysalis.

Adult Stage
  • The last stage is the adult stage when the chrysalis splits and the butterfly comes out.

Life Cycle of Butterflies

Mobile phone battery care

Looking after the battery in a mobile phone
This article tells you how to look after your battery.

Initial charge
When your new mobile phone is delivered, the battery will not be fully charged. The instructions will almost certainly tell you to charge the battery for at least 14 hours continuously, or for even longer. You are well advised to do this for the second charge as well.

Yes, this is very frustrating, and will stop you trying your new purchase out, but please do follow the instructions. It can make a huge difference to the performance you'll get from the battery in the future.
Note that the phone will indicate that the battery is fully charged after an hour or two, but for the initial charge, you should ignore this.
Mobile Battery
Why is this necessary?
A battery is made of several cells wired in series. Although good quality batteries are made with matched cells, there will be some variation between the cells in any battery.

When you charge the battery, some of the cells will be fully charged first. The charge current has to pass through all of the cells, and you have to be sure that the trickle-charging completely fills every cell, even though some of the cells are "full" and therefore the charger control circuits are cutting back the charge current. The way to ensure this is to leave the battery on charge for a long, long time for the first couple of charges.
Establish a routine
Depending on the type of battery you have, and how you use your mobile phone, what you do to keep the battery charged and ready will vary. If you are able to establish a routine, it is much more difficult to end up with a flat battery in your phone when you need to make or take a call. You may prefer to leave the phone switched on all the time, and charge every other night, or to switch the phone off, and charge it once a week. Another method may suit you better.

Fill it up!
The way that most batteries charge, they are 50% full in just a few minutes, but it takes longer and longer to approach the 100% mark. Most chargers switch to trickle-charging at around 90% capacity (see below) but if you leave the battery on charge for longer, it will slowly fill right up. Most people find charging overnight the easiest way to do this.
Mobile Phone Battery Care

Controlling the charge
Charging a battery is effectively turning electrical energy into chemical energy, which can be stored and converted back when electrical energy is needed to power the phone.

In general, the charging circuitry that regulates the charge current is built into the phone itself. It detects when the battery is fully charged, then cuts the charge current back to short pulses to keep it topped up. It does this by measuring the voltage of the battery as it is charged.

This voltage rises as the battery fills up, but the rate of rise of the voltage falls away at the point where it is full. Mathematicians recognise this as the delta of the charge voltage going negative, and this negative delta detection is what the charge control circuit uses to know the battery is full.

If the phone is unable to detect that the battery is full, the excess power (which cannot be turned into chemical energy) is turned into heat, and as a safety "back stop" the phone monitors the temperature of the battery, and stops the charging if it overheats. This could be too late, though...

Stay cool

The biggest killer of rechargeable mobile phone batteries is heat. This heat usually comes from overcharging. The charge controller may not be able to tell that the battery is fully charged, possibly because you took it off charge when full, switched it off then on again and then put it back on charge a short time later (maybe taking it out of and back into a car kit). If this happens, the "negative delta" point is already passed, and only the over-temperature limit is left. By the time this cuts in, the cells can have been damaged.

Discharge carefully

You can buy battery conditioners, which claim to be able to revitalise tired batteries by discharging and recharging the cells. they often fail to do this effectively, though. If you use a bulb and wire to discharge a battery, you will probably do more damage than good.

Why? and How?

The cells in a battery (for NiCd and NiMH each gives 1.2volts) are wired in series to give the power needed by the phone. Without being able to connect to each individual cell, a discharger can only guess at the state of the individual cells, and they generally just run the battery down till the total voltage adds up to 1v per cell. Professional dischargers connect directly to each individual cell, but few mobile phone batteries have the connections needed to do that.

If you simply use a bulb to drain the battery, you will run it completely flat. As mentioned above, batteries are made of cells wired in series, and some have more capacity than others.

As you discharge a battery, there will come a point when one cell is empty, but the others have charge remaining. If you continue beyond this point, you will start to reverse-charge the cell, which damages it, reducing its capacity.

Next time the battery is discharged, the weakest cell is even weaker, so the damage gets worse and worse, until you have no choice but to buy a new battery.
The best way to discharge a mobile phone battery is to leave it on the phone till the phone switches off.
Nickel Cadmium (NiCd)
All the foregoing applies to NiCd batteries. To get the best life out of a NiCd, let it run down every second or third charge. Do it more often and you shorten its overall life: do it less often, and you risk reducing its charge capacity.
Nickel Metal Hydride (NiMH)
NiMH batteries need much the same care as NiCd, except that you only need to run them down every week or two, if they are charged every night.
<
Lithium Ion (Li-Ion)
Lithium Ion batteries are very different. You should not deliberately discharge a Li-Ion cell. In fact, if you were to manage to run one flat, it would probably be damaged. There is electronics inside each Li-Ion battery to protect it from such abuse, but don't take the risk!

To keep your Li-Ion battery in good shape, simply charge it overnight before it runs down. If a full battery at all times matters to you, you can top it up whenever you like, but you'll probably get a longer service life from it if you only recharge it when it is getting a bit low.
Storage

Batteries of any type don't like to be left discharged. In general, if you have a spare battery, it is probably best to use it alternately with its partner.
Batteries of any type don't like to be left discharged. In general, if you have a spare battery, it is probably best to use it alternately with its partner.
Declining years

Age and infirmity come to all of us, but mobile phone batteries get there quicker than their users!
NiCd
A NiCd battery will lose its charge capacity, and may run flat on its own. This is often caused by sharp, spiky crystals growing through the separators of the cell, causing a short circuit. It is possible to "flash" these away by applying a very high current (such as from a large battery) for a short while. The current through the spike will melt it away, curing the short circuit, but that's not really a cure: the hole in the insulator will still be there, and there will probably be other crystals poised to do the same in another place. If your NiCd battery has managed 700 or more charge cycles, or has been exposed to excessive heat or other abuse, replace it!
NiMH
A tired NiMH battery will probably give good standby times, but as soon as you make or receive a call, you'll discover that it can't provide the current needed. This is because age and heat cause the crystals inside the cell to get bigger, which means that their surface area falls in proportion to their volume. Unfortunately, there is nothing much you can do about this. If a NiMH battery has managed 500 or more charge cycles, it has done well. Time for a replacement!
Li-Ion
Li-Ion batteries can fail suddenly, possibly because the electronics inside it have gone wrong, but in general they simply fade away. Because the capacity falls gradually over the charge cycle life, when to replace it is a matter of when the charge capacity is no longer sufficient for your needs. Never try to revitalise a Li-Ion battery in any way, or expose it to excessive heat: the very high power density of Li-Ion makes such actions very dangerous.
Replacement

Because of the subsidy system, it is often cheaper to upgrade to a new model of phone (complete with new battery) than it is to buy a new battery. Having said that, it really is worth replacing a worn-out battery. It is common for people to remark that they wish they'd bought a new battery sooner - putting it off is rarely wise!
Disposal

When it is time to say good bye to an old, tired, battery, don't throw it on a fire: it could explode. Don't put it in your dustbin: there should be facilities for recycling rechargeable batteries provided by your local council.

Tips for Better Living Life

1. Take a 10-30 minutes walk every day. And while you walk, smile. It is the ultimate anti-depressant.
2. Sit in silence for at least 10 minutes each day. Buy a lock if you have to.
3. Buy a DVD Recorder and tape your late night shows and get more sleep.
4. When you wake up in the morning complete the following statement, 'My purpose is to_______ today.'
5. Live with the 3 E's -- Energy, Enthusiasm, and Empathy.

Tips for Better Living

6. Play more games and read more books than you did in last years!
7. Make time to practice meditation, yoga, tai chi, and prayer. They provide us with daily fuel for our busy lives.
8. Spend time with people over the age of 70 & under the age of 6.
9. Dream more while you are awake.
10. Eat more foods that grow on trees and plants and eat less food that is manufactured in plants.

11. Drink green tea and plenty of water.. Eat blueberries, wild Alaskan salmon, broccoli, almonds & walnuts.
12. Try to make at least three people smile each day.
13. Clear clutters from your house, your car, your desk and let new and flowing energy into your life.
14. Don't waste your precious energy on gossip, energy vampires, issues of the past, negative thoughts or things you cannot control. Instead invest your energy in the positive present moment.
15. Realize that life is a school and you are here to learn. Problems are simply part of the curriculum that appear and fade away like algebra class but the lessons you learn will last a lifetime.
16. Eat breakfast like a king, lunch like a prince and dinner like a college kid with a maxed out credit charge card.
17. Smile and laugh more. It will keep the energy vampires away.
18. Life isn't fair, but it's still good.
19. Life is too short to waste time hating anyone.
20. Don't take yourself so seriously. No one else does.
21. You don't have to win every argument. Agree to disagree.
22. Make peace with your past so it won't spoil the present.
23. Don't compare your life to others'. You have no idea what their journey is all about.
24. No one is in charge of your happiness except you.
25. Frame every so-called disaster with these words: 'In five years, will this matter?'
26. Forgive everyone for everything.
27. What other people think of you is none of your business.
28. GOD heals almost everything.
29. However good or bad a situation is, it will change.
30. Your job won't take care of you when you are sick.Your friends will. Stay in touch.

31. Get rid of anything that isn't useful, beautiful or joyful.
32. Envy is a waste of time. You already have all you need.
33. The best is yet to come.
34. No matter how you feel, get up, dress up and show up.
35. Do the right thing!
36. Call your family often. (Or email them to death!!!) Hey I'm thinking of ya!
37. Each night before you go to bed com plete the following statements: I am thankful for ______. Today I accomplished ______.
38. Remember that you are too blessed to be stressed.
39. Enjoy the ride. Remember this is not Disney World and you certainly don't want a fast pass. You only have one ride through life so make the most of it and enjoy the ride.

40. Please Forward this to everyone you care about.


Tips and Tricks in the Kitchen

Prevent Onions From Burning, Frying: Prevent Onions From Burning, Frying Add a little milk to onions while frying, this will help retain a rich color and prevent them from burning.

Cook pulses like chana etc. even if you have forgotten to soak them overnight: Cook pulses like chana etc. even if you have forgotten to soak them overnight Just put the chana in a flask full of boiling water for an hour. They are ready for cooking.

Okra will not stick to the vessel: Okra will not stick to the vessel Adding a spoonful of curd to the Okra while cooking while ensure that they do not stick to the vessel or turn black.
To remove excess oil in any fried vegetables: To remove excess oil in any fried vegetables Sprinkle a little gramflour over the vegetables. Gramflour absorbs the excess oil and makes the vegetable tastier.

Curry turned out a bit oily and pungent: Curry turned out a bit oily and pungent Take two bread slices and powder them coarsely. Add this to the curry and mix well. Bread absorbs the excess oil and spice.

Hurry to cook 'dal' ? : Hurry to cook 'dal' ? Add a little oil and turmeric powder to the dal before placing it in the cooker. It will get done in 10 minutes flat.

Boil potatoes faster: Boil potatoes faster Peel and cut potatoes and boil them in water to which a little vinegar is added . They will be done in no time and will retain the texture as well.
Retain the green of vegetables: Retain the green of vegetables Green vegetables lose color if subjected to continuous heat. So, don't overcook them.

Boiling Pasta & Noodles: Boiling Pasta & Noodles Boil pasta/noodles in plenty of water and remove just before it is fully cooked. They continue to be cooked even after it is removed from flame and drained.

Serving Boiled Noodles later: Serving Boiled Noodles later If noodles/pasta has to be used after some time, then refresh the boiled noodles in cold water and drain. This way they will not stick to each other.

Instant Lemonade: Instant Lemonade Pour lemon juice with sugar and a little salt into ice trays, to make cubes which can be used for instant lemonade.
Make A Soft Fluffy Omelet: Heat a non-stick pan and add a little more butter than usual. Now beat the egg and stir briskly (even while frying) with a fork. This way more air goes in your omelet, making it light and fluffy. Fry till done and serve hot.

Computer tip - Caps Lock Alarm

Caps Lock Alarm

Don't you hate it when you accidentally hit the Caps Lock key? Sometimes I have a whole sentence typed in before I realize my mistake!

What if you could set your computer up so it alerts you when your pinky finger wanders off and taps the Caps Lock key? With this tip, I'll show you how to make your computer beep & flash the next time it happens.

The first thing you'll need to do is get the computer to beep when you hit the Caps Lock key. Here's how:

1. Click the Start button, Settings, Control Panel (XP Users, hit the Start button, Control Panel). Open the Accessibility Options Icon.
Control Panel
2. On the Keyboard tab, click the "Use Toggle Keys" checkbox.
Accessibility Options
That's it for the beeping part.

Next, we need to get your screen to flash you, err, flash at you. Here's how:

1. From the Accessibility Options screen, click the Sound tab and check the "Use SoundSentry" checkbox.
Accessibility Options
2. Next click the Settings button and select "Flash active window" from the "Warning for windowed programs" drop down box.
Settings and Soundsentry
That's it. Hit OK until you're clear of property and settings screens. Open your favorite word processor and hit your Caps Lock key.

Mouse Pads

History of the mousepad


During a 1968 presentation by Douglas Engelbart marking the public debut of a mouse, Engelbart used a control console designed by Jack Kelley of Herman Miller that included a keyboard and an inset portion used as a support area for the mouse.

According to Kelley and also stated by Alex Pang, Kelley designed the first mousepad a year later, in 1969.

Details of a mousepad designed by Armando M. Fernandez were published in the Xerox Disclosure Journal in 1979 with the description:

CRT CURSER CONTROL MECHANISM PAD


To assist the operation of a cathode ray tube pointer 10 wherein a metal ball is rolled on a hard surface, the disclosed pad may be utilized. A resilient, rubber-like material 12 is bonded or otherwise attached to a hard base material 14 which keeps the rubber-like material flat. The base has four rubber-like pads 16 on the opposite side from the resilient material to refrain the pad from sliding on the surface of a table, for instance.

—Xerox Disclosure Journal, Volume 4, Number 6, November/December 1979
By 1982, most users of the Xerox ball mouse were using mousepads.

 Mouse Pads


Benefits of the mousepad

The three most important benefits of the introduction of the mousepad were higher speed, more precision, and comfort for the user. A secondary benefit was keeping the desk or table surface from being scratched and worn by continuous hand and mouse rubbing motion. Another benefit was reduction of the collection of debris under the mouse, which resulted in reduced jitter of the pointer on the display.

When optical mice, which use image sensors to detect movement, were first introduced into the market, they required special mousepads with optical patterns printed on them. Modern optical mice can function to an acceptable degree of accuracy on plain paper and other surfaces. However, some optical mouse users may prefer a mousepad for comfort, speed and accuracy, and to prevent wear to the desk or table surface.


Types of mousepads


A variety of mousepads exist with many different textured surfaces to fit various different types of mouse technologies. Vinyl board cover, because of its tackiness, was a popular mousepad surface around 1980.

After the rubberized silicon surface was incorporated onto the surface of the steel roller ball mouse, the popular fabric-surface mousepad was found to be the most appropriate. It helped keep the rubberized roller-ball surface cleaner and with better tracking, speed and accuracy than just a desk surface, which collected dirt and slowed the mouse's motion.

Optical mice have the problem of not working well on transparent or reflective surfaces (such as glass or highly polished wood). These surfaces, which often include desk and table surfaces, cause jitter and loss of tracking on the display pointer as the mouse moves over these reflective spots. The use of mousepads with precision surfaces eliminates spot jitter effects of modern optical mice.
Designs
Originally, mousepads were available in a simple rectangular shape. In recent years, though, they have been available in many shapes and designs. Ergonomic designs are available with built-in wrist rests made of silicone gel, foamed and beaded materials.
Companies often give away mousepads for promotional reasons, and computer manufacturers often include a mousepad with their logo on it, usually with technical support information. Many artists have published work on mousepads.

There is now a fairly large variety of high quality "gaming grade" mousepads. In the beginning there were only a few such manufacturers: Everglide (arguably the first to come onto the market), fUnc Industries, Icemat, SteelSeries and Ratpadz (made by [H]ard|OCP). In 2005 several more companies followed suit, including Razer, Qpad, Corepad, Xtracpads, X-Ray, Gamerzstuff, Ideazon, and Allsop. These pads are available in a wide variety of sizes to suit the different sensitivity settings that gamers choose. The Corepad Deskpad XXXL, possibly the largest pad on the market, is a massive 90cm x 45cm.


Mousepad materials
Modern mousepads are typically made of foam rubber with fabric bonded to the upper surface. However, many other types of material have been used, including fabric, plastics, recycled rubber tires, silicone rubber, leather, glass, cork, wood, aluminum, stone and stainless steel, for example. High-quality gaming mats are usually made from plastic or high-tech fibers.

Article Source : Mouse Pads

Photo organiser - Google's Picasa

The Picasa photo organiser is the first hard disk-installed software ever. It is a photo software & that Google has acquired on july last year and it has now released the second version of Picasa as picasa 2.0. Different from previous versions, Picasa 2.0 has significantly enhanced its editing tools and searching ability. Just click to see instantaneous edits of your digital photos,use white balance, lighten gloomy shots, crop, flatten curved horizons, zoom and also add gentle focus.
Your options are displayed all the times, so you can see what you like and if you are not interested in editing, there are also multiple UNDO options available to you. Picasa easily mingles the editing tools of Adobe Elements and other popular programs without any outflow.
Microsoft's desktop can locate photo images,But it can only able to guide the words that are shown within the data that your camera automatically adds, as well as any words in the photo filenames. None of those new products are going to help you find your photos more other thanpicasa.

Your photos certainly doesnot contain enough information to find all the digital pictures of a particular family member. It's not going to happen without a civilized photo management software and a little bit of effort from your side also.But if you have both then you will surely find success.
Features and Benefits of Picasa 2.0

Google Picasa Logo

Google Picasa Screenshot

  • Find the pictures you forgot you had.
  • Move and re-name pictures from insidePicasa.
  • Make a label.
  • Add a star rating.
  • Keep one picture in multiple albums.
  • Password-protect collections.
  • Basic Fixes are back - and better.
  • Amazing effects turn so-so picturesinto works of art
  • Write captions that stay with the picture.
  • Zoom. Pan. Tilt. Get the angle you intended.
  • Send photos via email that are a joy to receive.
  • Make beautiful slide shows.
  • Move to any device or folder.
  • Burn to CD or DVD for archive purposes.
  • Give gift CDs with slide shows.
  • Create a network backup of your pictures.
  • Put pictures on your own site, for free.

speed of light ?

The speed of light in a vacuum is an important physical constant denoted by the letter c for constant or the Latin word celeritas meaning "swiftness". It is the speed of all electromagnetic radiation in a vacuum, including visible light, and more generally it is the speed of anything with zero rest mass.

In metric units, c is exactly 299,792,458 metres per second (1,079,252,848.8 km/h) but 3×108 m/s is commonly used in rough estimates. Note that this speed is a definition, not a measurement. Because the fundamental SI unit of length, the metre, has been defined since October 21, 1983 in terms of the speed of light, one metre is the distance light travels in a vacuum in 1/299,792,458 of a second. Thus, any further increase in the precision of the measurement of the speed of light will actually change the length of the metre; the speed of light will remain precisely 299,792,458 m/s. In imperial units, the speed of light is about 186,282.397 miles per second, that is about one foot per nanosecond.
A line showing the speed of light on a scale model of Earth and the Moon
A line showing the speed of light on a scale model of Earth and the Moon
When passing through a transparent or translucent material medium, like glass or air, light will have a slower speed than in a vacuum; the ratio of c to the observed phase velocity is called the refractive index of the medium. In general relativity, a gravitational potential can affect the speed of distant light in a vacuum, but locally light in a vacuum will always pass an observer at a rate of c.

Reasons We Plant Trees

Ten Reasons We Plant Trees
1. Trees save energy and money. Just three trees strategically planted around your home can cut your air conditioning bill in half.
2. Trees save tax dollars. Trees in a city slow stormwater runoff and reduce the need for storm sewers. Tree shade also help cool municipal buildings, lowering electricity bills.

3. Trees cool our cities. Urban "heat islands" are directly related to massive tree-cutting for development.
4. Trees clean our water and air. From low level ozone in our cities to pesticide and fertiziler runoff from our farms, trees absorb harmful pollutants.
5. Trees help community life. Tree planting and community based forestry can Planting Treesadd significantly to a local community's sustainable economy while restoring the environment.
6. Trees protect soil. By holding soil in place with their root systems, by deflecting pounding rain with their canopies, and by adding nutrients each fall with their leaves, trees are crucial to keeping and improving our soil.
7. Trees provide habitat for species of many kinds -- including endangered species. A key project of American Forests is "Trees for Tigers" in the Russian Far East that is restoring habitat for the endangered Siberian tiger.
8. Trees can pay your "carbon debt". Planting just 30 Global ReLeaf trees will absorb the amount of carbon dioxide that is generated in the production of energy for the average American lifestyle each year.
9. Trees provide clean water and natural flood control. Forests act as natural reservoirs, and they protect watersheds, providing clean water for cities, bays and rivers.
10. Trees are a beautiful part of our lives. From striking individual trees that are of historic significance or are simply large and majestic, to a grove of trees in a city park, trees enrich our lives by simply being there. Trees are not just a key to the natural ecosystem -- trees are an essential part of community life.

Great and Magical Thoughts

Some people complain that there are thorns on roses, while others praise thorns for having roses among them.
A person's true character is revealed by what he does when no one is watching.

Angel of Great and Magical Thoughts Forever

Although the tongue weighs very little, very few people are able to hold it.

Falling down doesn't make you a failure, but staying down does.

Don't be afraid of pressure. Remember that pressure is what turns a lump of coal into a diamond.

Even a woodpecker owes his success to the fact that he uses his head.

The poorest of all men is not the man without a cent but the man without a dream.

The only preparation for tomorrow is the right use of today.

People don't care how much you know until they know how much you care.

Temper is what gets most of us into trouble. Pride is what keeps us there.

The difference between ordinary and extraordinary is that little "extra".

The heart is happiest when it beats for others.

One thing you can learn by watching the clock is that it passes time by keeping its hands busy.

Balance Sheet of Life

The Balance Sheet of Life
The Balance Sheet of Life
Our Birth is our Opening Balance!
Our Death is our Closing Balance!
Our Prejudiced Views are our Liabilities
Our Creative Ideas are our Assets
Heart is our Current Asset
Soul is our Fixed Asset
Brain is our Fixed Deposit
Thinking is our Current Account

Achievements are our Capital
Character & Morals, our Stock-in-Trade
Friends are our General Reserves
Values & Behaviour are our Goodwill

Patience is our Interest Earned
Love is our Dividend
Children are our Bonus Issues
Education is Brands / Patents

Knowledge is our Investment
Experience is our Premium Account
The Aim is to Tally the Balance Sheet Accurately.
The Goal is to get the Best Presented Accounts Award.

intersting facts

  • LONGEST BRIDGE:
Donghai Bridge, China 32.5 Kilometers
  • BIGGEST PASSENGER-SHIP

MS Freedom of the Seas:4300 Pessengers

  • BIGGEST BUS
Neoplan Jumbo cruiser double deck bus 170 Passengers
  • WORLD'S BIGGEST PLANE
Airbus A380 555 Passengers
  • 3 MOST VALUABLE BRAND NAMES ON EARTH:
  1. Marlboro
  2. Coca-Cola
  3. Budweiser

  • Male sea lion may have more than 100 wives and sometimes go three months without eating.
  • Acupuncture was first used as a medical treatment in 2700 BC by Chinese emperor Shen-Nung.
  • Christmas became a national holiday in the US in 1890.
  • About one-tenth of the earth's surface is permanently covered with ice.
  • Australia is the only country that is also a continent.
  • A honey bee must tap two million flowers to make one pound of honey.
  • A bird requires more food in proportion to its size than a baby or a cat.
  • A cow gives nearly 200,000 glasses of milk in her lifetime.
  • A rat can last longer without water than a camel can.
  • The penalty for killing a cat, 4,000 years ago in Egypt, was death.
  • The poisonous copperhead snake smells like fresh cut cucumbers.
  • Disneyland opened in 1955.
  • Donald Duck lives at 1313 Webfoot Walk, Duckburg, Calisota.
  • Donald Duck's middle name is Fauntleroy.
  • Coffee was first known in Europe as Arabian Wine.
  • Almonds and pistachios are the only nuts mentioned in the Bible.
  • Seven suicides are recorded in the Bible.
  • Ancient Chinese artists would never paint pictures of women’s feet.
  • Evard Ericksen sculpted “The Little Mermaid” statue which is located in Copenhagen harbor.
  • The Mona Lisa, by daVinci, is 2’6” by 1’9”.
  • A diamond will not dissolve in acid. The only thing that can destroy it is intense heat.
  • The largest gold nugget ever found weighed 172 lbs., 13 oz.
  • The only rock that floats in water is pumice.
  • Baseball's home plate is 17 inches wide.
  • Most-visited presidential grave: John F. Kennedy's in Arlington National Cemetery in Arlington, Va.
  • Colgate claims "Tooth Fairy" as a registered trademark.
  • 84% of a raw apple is water.
  • A pineapple is a berry.
  • An average human scalp has 100,000 hairs.
  • Bananas are America's #1 fruit.
  • A typical bed usually houses over 6 billion dust mites.
  • Ants don't sleep.
  • Only full-grown male crickets can chirp.
  • No two spider webs are the same.
  • Bats are the only mammal that can fly.
  • Bats have only one baby a year.
  • The only lizard that has a voice is the Gecko.
  • Uranus is the only planet that rotates on its side.
  • Antarctica is the only continent without reptiles or snakes.
  • A penguin swims at a speed of approximately 15 miles per hour.
  • Approximate number of facial expressions dogs can make: 100.
  • Our galaxy has approximately 250 billion stars.
  • The eyeball of a human weighs approximately 28 grams.
  • There are approximately 250,000 sweat glands in your feet.
  • There are approximately 45 billion fat cells in an average adult.
  • You need approximately 2,000 berries to make one pound of coffee.
  • There are approximately fifty Bibles sold each minute across the world.
  • Average length of a coat hanger when straightened: 44 inches.
  • Average number of hummingbirds required to create the weight of 1 ounce: 18.
  • Cats average 16 hours of sleep a day, more than any other mammal.
  • Every square inch of the human body has an average of 32 million bacteria on it.
  • On average, pigs live for about 15 years.
  • The ashes of the average cremated person weigh 9 pounds.
  • The average chicken lays about 260 eggs a year.
  • The average person laughs about 15 times a day.

Wise Words of Life

Sometimes you get Wise Words of Life not to read only...

If You die early it means that God loves You a lot....
As You are still on earth that means there is someone who loves You even more than God..

Wise Words of LifeSpeak less to people whom you love most,
Because if they cant understand your silence,
They can never understand your words

When GOD takes away
something from your hand,
dont think He punishing you ¦
he is merely emptying your hand,
for you to receive something better.
Have Faith!!!

Whenever you want
to know how rich you are?
Don’t count ur money!
just drop a tear &
look around at the
number of hands that
reach out to wipe your tears

Erasers are for people who make errors.
But a better saying:
Erasers are for people willing to correct their mistakes.

Speak less to people whom you love most,
Because if they cant understand your silence,
They can never understand your words...

As we sail through life,
dont avoid Storms & Rough waters,
just let it PASS… Sail on!
Because Calm Seas
will never make Skilled Sailors.

Happy Moments - PRAISE GOD
Difficult Moments- SEEK GOD
Quiet Moments - WORSHIP GOD
Painful Moments - TRUST GOD
Moment By Moment - THANK GOD
Wise Words of Life

Either live your dreams or kill yourself...never compromise...

We meet to create memories and we depart to preserve them, to meet and depart is the way of life, but to depart and meet is hope of life.........

Think twice before leaving a space in someone's heart, because its painful to realize how much you miss that space when you decide to go back n find someone's already taken ur place.....

Four ways to Live with Bless,
Look back and Thanks GOD,
Look forward and Trust GOD,
Look Around and Serve the GOD,
Look within Yourself and Find The GOD...

Success is like tip of the tail !!!If cat runs to catch the tail.It has to keep running forever.But if it walks in its own style.Tail follows!!Live life with your own rules....

All people have fears, but the brave put down their fears and go forward, sometimes to death, but always to victory.

Happiness is inward, and not outward; and so, it does not depend on what we have, but on what we are.

Either live your dreams or kill yourself..never compromise...

The path that leads to happiness is so narrow that two can not walk on it unless they become one.

You spend your whole life believing that you are on the right track, only to discover that you are on the wrong train..
Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude.
- Thomas Jefferson

Sunday, 26 July 2009

Amazing facts on nature

- Rats can't vomit. That's why rat poison works so well.

- A hippo can run faster than a man can.

- A jellyfish is 95% water.





- A blue whales heart only beats nine times per minute.

- Some ribbon worms will eat themselves if they can't find any food.

- Flies jump backwards when they take off
Some Frogs smell of onion, and the Firebellied

-Toad smells of Garlic.

-You cannot get warts from toads!

-Toads have no teeth.

-Frogs have teeth on their upper jaws but none on their lower.

-The Bull Frog is the largest True Frog in North America.it can weigh up to 1.2 lbs and grow up to 18 inches long.

-The African Giant is the largest of all frogs.It can grow to 26 inches long and weigh as much as 10 lbs

-It's possible to lead a cow upstairs ... but not downstairs.

-Carnivorous animals will not eat another animal that has been hit by a lightning strike.

-The average cat consumes about 127,750 calories a year, nearly 28 times its own weight in food and the same amount again in liquids.

-Cats cannot survive on a vegetarian diet.

-Pet parrots can eat virtually any common "people-food" except for chocolate and avocados.
Both of these are highly toxic to the parrot and can be fatal.

-Elephants too run(sorry walk) faster than humans.

- Dolphins seem to have personal names.

- A tiger's stripes are unique.

- Lions and cats sleep more than 16 hrs per day.

Top 10
















C programming mind blowing Questions and answers

1.What will be the output of the following code?

void main ()
{ int i = 0 , a[3] ;
a[i] = i++;
printf ("%d",a[i]) ;
}
Ans: The output for the above code would be a garbage value. In the statement a[i] = i++; the value of the variable i would get assigned first to a[i] i.e. a[0] and then the value of i would get incremented by 1. Since a[i] i.e. a[1] has not been initialized, a[i] will have a garbage value.

-------------------------------------------------------------------------------------------------
2.
Why doesn't the following code give the desired result?

int x = 3000, y = 2000 ;
long int z = x * y ;
Ans: Here the multiplication is carried out between two ints x and y, and the result that would overflow would be truncated before being assigned to the variable z of type long int. However, to get the correct output, we should use an explicit cast to force long arithmetic as shown below:

long int z = ( long int ) x * y ;
Note that ( long int )( x * y ) would not give the desired effect.

-------------------------------------------------------------------------------------------------
3.
Why doesn't the following statement work?

char str[ ] = "Hello" ;
strcat ( str, '!' ) ;

Ans: The string function strcat( ) concatenates strings and not a character. The basic difference between a string and a character is that a string is a collection of characters, represented by an array of characters whereas a character is a single character. To make the above statement work writes the statement as shown below:
strcat ( str, "!" ) ;

-------------------------------------------------------------------------------------------------
4.
How do I know how many elements an array can hold?

Ans: The amount of memory an array can consume depends on the data type of an array. In DOS environment, the amount of memory an array can consume depends on the current memory model (i.e. Tiny, Small, Large, Huge, etc.). In general an array cannot consume more than 64 kb. Consider following program, which shows the maximum number of elements an array of type int, float and char can have in case of Small memory model.
main( )
{
int i[32767] ;
float f[16383] ;
char s[65535] ;
}
-------------------------------------------------------------------------------------------------

5. How do I write code that reads data at memory location specified by segment and offset?

Ans: Use peekb( ) function. This function returns byte(s) read from specific segment and offset locations in memory. The following program illustrates use of this function. In this program from VDU memory we have read characters and its attributes of the first row. The information stored in file is then further read and displayed using peek( ) function.

#include
#include

main( )
{

char far *scr = 0xB8000000 ;
FILE *fp ;
int offset ;
char ch ;

if ( ( fp = fopen ( "scr.dat", "wb" ) ) == NULL )
{

printf ( "\nUnable to open file" ) ;
exit( ) ;

}

// reads and writes to file
for ( offset = 0 ; offset < 160 ; offset++ )
fprintf ( fp, "%c", peekb ( scr, offset ) ) ;
fclose ( fp ) ;

if ( ( fp = fopen ( "scr.dat", "rb" ) ) == NULL )
{

printf ( "\nUnable to open file" ) ;
exit( ) ;

}

// reads and writes to file
for ( offset = 0 ; offset < 160 ; offset++ )
{

fscanf ( fp, "%c", &ch ) ;
printf ( "%c", ch ) ;

}

fclose ( fp ) ;

}





Predict the output or error(s) for the following:
1. void main()
{
int const * p=5;
printf("%d",++(*p));
}

Answer:
Compiler error: Cannot modify a constant value.

Explanation:
p is a pointer to a "constant integer". But we tried to change the value of the
"constant integer".

2. main()
{
char s[ ]="man";
int i;
for(i=0;s[ i ];i++)
printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]);
}

Answer:
mmmm
aaaa
nnnn

Explanation:
s[i], *(i+s), *(s+i), i[s] are all different ways of expressing the same idea.
Generally array name is the base address for that array. Here s is the base address. i is the index number/displacement from the base address. So, indirecting it with * is same as s[i]. i[s]
may be surprising. But in the case of C it is same as s[i].

3) Printf can be implemented by using __________ list.

Answer:
Variable length argument lists

4) char *someFun()
{
char *temp = "string constant";
return temp;
}
int main()
{
puts(someFun());
}

Answer:
string constant

Explanation:
The program suffers no problem and gives the output correctly because the character
constants are stored in code/data area and not allocated in stack, so this doesn't lead to
dangling pointers.

5) char *someFun1()
{
char temp[ ] = "string";
return temp;
}
char *someFun2()
{
char temp[ ] = {'s', 't','r','i','n','g'};
return temp;
}
int main()
{
puts(someFun1());
puts(someFun2());
}

Answer:
Garbage values.

Explanation:
Both the functions suffer from the problem of dangling pointers. In someFun1() temp
is a character array and so the space for it is allocated in heap and is initialized with character
string "string". This is created dynamically as the function is called, so is also deleted
dynamically on exiting the function so the string data is not available in the calling function
main() leading to print some garbage values. The function someFun2() also suffers from the
same problem but the problem can be easily identified in this case.

6) main()
{
char a[4]="HELL";
printf("%s",a);
}

Answer:
HELL%@!~@!@???@~~!

Explanation:
The character array has the memory just enough to hold the string "HELL"
and doesnt have enough space to store the terminating null character. So it
prints the HELL correctly and continues to print garbage values till it
accidentally comes across a NULL character.

7) main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("\n %u %u ",j,k);
}

Answer:
Compiler error: Cannot increment a void pointer

Explanation:
Void pointers are generic pointers and they can be used only when the type
is not known and as an intermediate address storage type. No pointer
arithmetic can be done on it and you cannot apply indirection operator (*) on
void pointers.

8) void main()
{
char ch;
for(ch=0;ch<=127;ch++)
printf("%c %d \n", ch, ch);
}

Answer:
Implementaion dependent

Explanation:
The char type may be signed or unsigned by default. If it is signed then ch++
is executed after ch reaches 127 and rotates back to -128. Thus ch is always
smaller than 127.

9) Is this code legal?
int *ptr;
ptr = (int *) 0x400;

Answer:
Yes

Explanation:
The pointer ptr will point at the integer in the memory location 0x400.

10) Is the following code legal?
typedef struct a aType;
struct a
{
int x;
aType *b;
};

Answer:
Yes

Explanation:
The typename aType is known at the point of declaring the structure,
because it is already typedefined.

11) Is the following code legal?
void main()
{
typedef struct a aType;
aType someVariable;
struct a
{
int x;
aType *b;
};
}

Answer:
No

Explanation:
When the declaration,
typedef struct a aType;
is encountered body of struct a is not known. This is known as 'incomplete
types'.

12) Is the following code legal?
struct a
{
int x;
struct a b;
}

Answer:
No

Explanation:
Is it not legal for a structure to contain a member that is of the same
type as in this case. Because this will cause the structure declaration to be
recursive without end.

13) Is the following code legal?
struct a
{
int x;
struct a *b;
}

Answer:
Yes.

Explanation:
*b is a pointer to type struct a and so is legal. The compiler knows, the size of
the pointer to a structure even before the size of the structure
is determined(as you know the pointer to any type is of same size). This type
of structures is known as 'self-referencing' structure

14) What is wrong with the following code?
int *foo()
{
int *s = malloc(sizeof(int)100);
assert(s != NULL);
return s;
}

Answer & Explanation:
assert macro should be used for debugging and finding out bugs. The check
s != NULL is for error/exception handling and for that assert shouldn't be
used. A plain if and the corresponding remedy statement has to be given.

15) There were 10 records stored in "somefile.dat" but the following program printed 11
names. What went wrong?
void main()
{
struct student
{
char name[30], rollno[6];
}stud;
FILE *fp = fopen("somefile.dat","r");
while(!feof(fp))
{
fread(&stud, sizeof(stud), 1 , fp);
puts(stud.name);
}
}

Explanation:
fread reads 10 records and prints the names successfully. It will
return EOF only when fread tries to read another record and fails
reading EOF (and returning EOF). So it prints the last record again.
After this only the condition feof(fp) becomes false, hence comes out
of the while loop.


11. How do I write code to retrieve current date and time from the system and display it as a string?

Ans: Use time( ) function to get current date and time and then ctime( ) function to display it as a string. This is shown in following code snippet.

#include

void main( )
{
time_t curtime ;
char ctm[50] ;

time ( &curtime ) ; //retrieves current time &
stores in curtime
printf ( "\nCurrent Date & Time: %s", ctime (
&curtime ) ) ;
}

-------------------------------------------------------------------------------------------------
12.
How do I change the type of cursor and hide a cursor?

Ans: We can change the cursor type by using function _setcursortype( ). This function can change the cursor type to solid cursor and can even hide a cursor. Following code shows how to change the cursor type and hide cursor.

#include
main( )
{
/* Hide cursor */
_setcursortype ( _NOCURSOR ) ;

/* Change cursor to a solid cursor */
_setcursortype ( _SOLIDCURSOR ) ;

/* Change back to the normal cursor */
_setcursortype ( _NORMALCURSOR ) ;
}
-------------------------------------------------------------------------------------------------
13.
How do I write code that would get error number and display error message if any standard error occurs?

Ans: Following code demonstrates this.

#include
#include
#include

main( )
{
char *errmsg ;
FILE *fp ;
fp = fopen ( "C:\file.txt", "r" ) ;
if ( fp == NULL )
{
errmsg = strerror ( errno ) ;
printf ( "\n%s", errmsg ) ;
}
}
Here, we are trying to open 'file.txt' file. However, if the file does not exist, then it would cause an error. As a result, a value (in this case 2) related to the error generated would get set in errno. errno is an external int variable declared in 'stdlib.h' and also in 'errno.h'. Next, we have called sterror( ) function which takes an error number and returns a pointer to standard error message related to the given error number.
-------------------------------------------------------------------------------------------------
14.
How do I write code to get the current drive as well as set the current drive?

Ans: The function getdisk( ) returns the drive number of current drive. The drive number 0 indicates 'A' as the current drive, 1 as 'B' and so on. The Setdisk( ) function sets the current drive. This function takes one argument which is an integer indicating the drive to be set. Following program demonstrates use of both the functions.

#include

main( )
{
int dno, maxdr ;

dno = getdisk( ) ;
printf ( "\nThe current drive is: %c\n", 65 + dno
) ;

maxdr = setdisk ( 3 ) ;
dno = getdisk( ) ;
printf ( "\nNow the current drive is: %c\n", 65 +
dno ) ;
}
-------------------------------------------------------------------------------------------------
15.
The functions memcmp( ) and memicmp( )

The functions memcmp( ) and memicmp( ) compares first n bytes of given two blocks of memory or strings. However, memcmp( ) performs comparison as unsigned chars whereas memicmp( ) performs comparison as chars but ignores case (i.e. upper or lower case). Both the functions return an integer value where 0 indicates that two memory buffers compared are identical. If the value returned is greater than 0 then it indicates that the first buffer is bigger than the second one. The value less than 0 indicate that the first buffer is less than the second buffer. The following code snippet demonstrates use of both

#include
#include

main( )
{
char str1[] = "This string contains some
characters" ;
char str2[] = "this string contains" ;
int result ;

result = memcmp ( str1, str2, strlen ( str2 ) ) ;
printf ( "\nResult after comapring buffer using
memcmp( )" ) ;
show ( result ) ;

result = memicmp ( str1, str2, strlen ( str2 ) ) ;
printf ( "\nResult after comapring buffer using
memicmp( )" ) ;
show ( result ) ;
}

show ( int r )
{
if ( r == 0 )
printf ( "\nThe buffer str1 and str2 hold
identical data" ) ;
if ( r > 0 )
printf ( "\nThe buffer str1 is bigger than buffer
str2" ) ;
if ( r < 0 )
printf ( "\nThe buffer str1 is less than buffer
str2" ) ;
}

Twitter Delicious Facebook Digg Stumbleupon Favorites More