Ads

Monday, April 30, 2012

Give Your Gmail Account A Bullet Proof Security By Enabling Google’s 2-Step Verification

Every one of us have email accounts which contains both sensitive and personal information. Imagine if one day you try to log-in to your account and couldn’t do it so. That’s the worst thing that any one of us can even think of (or may be most of us have already faced such situation for once). To avoid such thing we should take necessary steps to make our information as much secured as possible

And to do that, Google has offered a 2-step verification system, which is a bullet proof security thing for your GMAIL accounts and i recommend every user to enable this option immediately after reading the details and step by step guide below.

How This Security Works

Once you enable 2-step verification, you’ll see an extra page that prompts you for a code when you sign in to your account. After entering your password, Google will call you with the code, send you a SMS message or give you the choice to generate the code for yourself using a mobile application on your Android, BlackBerry or iPhone device. The choice is up to you. When you enter this code after correctly submitting your password we’ll have a pretty good idea that the person signing in is actually you.

What Is The Idea Behind This New Security

if someone manages to guess or crack your password, he won’t be able to login to your account unless he enters the second verification code as well, which was sent to your mobile.

What Are The Worries

a. You will have to spend some more time to log-in and verifying your identity by entering the verification code sent to your mobile. The verification code can be remembered for 30 days on a specific computer so that it only needs to be entered again once the 30 days are over.

b. If you lose your phone then you can’t log-in to your account as well.  Don't worry, during the 2-step verification process, it will ask you to add a backup phone to your account and will also  generate some backup codes that you can use in such situations.
 
c. You need to have your phone with you when ever you want to access your Google Account. 

How To Enable 2-step Verification

1. Open your “Account Page” and you will see this option under Personal Settings

2. Click on the “Using 2-step verification” link and it may ask you to enter your Gmail account password

3. After that you will see the 2-step verification setup page. Click the button “Set up 2-step verification

4. Now you have to decide, how you want to setup this verification. There are three ways to let Google send the two step verification code to you:
  • Using the Google Authenticator App for Android, BlackBerry or iPhone. (you have to install an App on your phone which generates the code for your account)
  • Sending an SMS message, works with any mobile phone and not just smartphones.
  • A voice call to any phone number so this is useful for those who don’t have a mobile phone yet
Note: I would prefer using the SMS or Automated voice message option because it can be really time consuming to find the Authenticator app and launch it again and again, scanning the QR code and so on
5. In order to receive a confirmation via SMS or Automated voice message, click on the “Other – Use another phone” option

6. On this Set up your phone page, enter the details and test your phone by clicking on the “Send Code” button. You will receive a code via SMS or Automated voice message (depends on your selection). Enter that code in the Code verification box and click “Verify

7. Once you verified your phone, click “Next”. Now you need to set up the backup option. The backup option is needed in case your phone is lost or stolen. You will be provided with backup codes required for signing in if your phone is lost.

8. Take the print out or keep the screenshot of this page in your computer and Tick mark “Yes, i have a copy of my backup verification codes” and click “Next”.

9. You can add one more mobile number (if you want) which can then be verified.

10. Click on the “Turn on 2-step verification” button and you are done.


How To Use 2-step Verification

1. After successfully enabling the 2-step verification option, Go to your Gmail account in order to Sign-in (sign out if you are already signed in)

2. Enter your username and password (like always) and Click sign in button

3. You will then be prompted to enter a code, which is tied only to a phone number you provided during the verification process. You can receive this code on your phone using one of the Google Authenticator apps available for Android, iPhone, and BlackBerry, via SMS, or through a voice call (depends which option you selected when you enabled 2-step verification option)

4. Enter the code and you can tick mark the box “Remember verification for this computer”. In this case, your verification code will be saved for this computer only for 30 days.  Click “Verify” and you are now logged In.
Note: Choosing the “Remember” setting is entirely “optional” but you may want to utilize this setting on the home computer to avoid spending too much time logging in with the two step verification code again and again. For all other computers e.g Office computers, college or internet cafes, you should not use the “Remember” setting at all. Recommended

5. If you don’t remember the verification code that’s sent to your mobile device, no need to panic. You can always request a fresh code using the link “Get a new verification code” (as shown in above screenshot) and let Google send an SMS message to your phone or make a voice call to you.

Important Notes:
  • If you can’t find the “Using two step verification” link in your Google Account settings page or your country name at the Set up your phone page, then don’t worry, this feature will be rolled out across all users and the link should appear shortly.
  • Use only that phone number which you are always carrying it with you.
  • Keep the backup codes at some private place. Incase you lost your mobile, then this information is indeed required.
  • You can provide backup phone details of someone whom you can trust for example any family member (Not a wife OFCOURSE)

Google’s two step verification is indeed a nice step towards enhanced Gmail security. And i recommend every user to enable it to give your email account a bullet proof security. Do share your comments and suggestions about this new security at below page commenting section.



Tuesday, April 17, 2012

Richest College Dropouts on Earth

“We don’t need no education” ~ Pink Floyd, “Another Brick in the Wall”
 A college education is often touted as being a prerequisite to a good life and a high income. Unsurprisingly, college prospectuses promote the success of their alumni as a reason why you should choose to complete a degree at their particular campus. However, there are plenty of billionaires in the world who traded in their college degrees for a successful business life. In fact, the Forbes World’s Billionaires list 2011 actually identifies the most wealthy college dropouts on earth today. Proof if ever it was needed that slackers don’t always comes second, and that when it comes to business, the studious can’t always cut it.

 10. Roman Abramovich
 

With $13.4 billion to his name, Roman Abramovich is joint 53rd on the list of the world’s richest people. Abramovich claims to have attended the Moscow State Law Academy, graduating in 2001, and has been linked with the Ukhta Industrial University and The Gubkin Russian State University of Oil and Gas in Moscow. Both of the latter universities deny that he attended, and it is rumored, but unsubstantiated, that he dropped out of the Russian capital’s law school. With sources conflicted about the precise course of events it seems somebody may be trying to change the record here – only in Mother Russia! Still, with an oil fortune, diverse investments and England’s Chelsea Football Club in his possession, all the hearsay surrounding his education is unlikely to bother the Moscow business magnate.
 

9. Mark Zuckerberg
 

 Still only 26, Mark Zuckerberg became the youngest self-made billionaire in the world and, with $13.5 billion in his pocket, the 52nd richest person on the planet. As immortalized in the Hollywood movie The Social Network, he dropped out of Harvard, where he studied psychology and computer science, to head west to California, overseeing the rise of the social media phenomenon that is Facebook. Even though Facebook was originally targeted at a college market, it was by dropping out and seeking venture capital that Zuckerberg gained such huge success.
 

8. Steve Ballmer
 

The 46th richest man in the world is following in the footsteps of the 2nd (of whom, more later). The current CEO of Microsoft, Steve Ballmer did complete a college degree (in mathematics and economics) before working for Proctor & Gamble but dropped out of the Stanford University Graduate School of Business to join Microsoft as its 30th employee. We think that qualifies him as a failing student of sorts, so he makes the grade for this list. That said, the savvy timing of his employment meant that his salary included a percentage share in the company which he has since parlayed into $14.5 billion of personal wealth, placing him 46th in the world in terms of net worth. So, if you’re an OTT ball of energy with a certain amount of business nous, it seems you can afford to drop out…
 

7. Michael Dell
 

It is clear that Michael Dell valued education only as a route to business success. At the age of just 8, he applied to take a high school equivalency test so that he could enter business sooner. What’s more, while attending high school he invested money from part time jobs in the stock market and successfully targeted newlyweds for newspaper subscriptions while working for the Houston Post, such that he made $18,000 that year – more than his teacher’s salaries. As a pre-med at the University of Texas at Austin, he founded the company that would become Dell. Unsurprisingly, he never completed his studies, but now has a personal wealth of $14.6 billion, making him the world’s 44th richest person. ‘Nuff said.
 

6. Azim Premji
 

Azim Premji managed to skyrocket the Indian IT company Wipro Ltd. from a worth of $2.5 million to one that is now valued at $1.4 billion. His 78% stake in Wipro along with other investments have generated him a personal worth of $16.8 billion, making him 36th on the world rich list. He took over the family business, which later became Wipro, after his father died in 1966. This unexpected tragedy meant he had to leave his course in electrical engineering at Stanford University. Azim Premji is nothing if not persistent, however, and he completed the degree 30 years later.
 

5. Sheldon Adelson
 

Precocious tycoon Sheldon Adelson owned his first business at the age of 12, making a career selling newspapers on street corners, and moved on through finance and charter tours to found COMDEX, a computer trade show that was first held in 1979. He briefly attended City College of New York, but dropped out before completing his studies. It seems to have been a good idea, though, as his acquisitions of Las Vegas casinos and hotels has brought him a net worth of $23.3 billion, making him the 16th richest person in the world.
 

4. Mukesh Ambani
 

Entering the top ten richest people on Earth now – so you know dropping out can’t always be a bad thing! – meet Mukesh Ambani, ranked 9th in the world, with a net worth of $27 billion. He joined his father’s business, Reliance Industries, in 1981 and now owns a 48% stake in the company. Reliance industries is India’s largest private sector company and has diversified interests in everything from communications to petrochemicals. Ambani enrolled at Stanford in 1979 but dropped out of his business masters in order to focus on his father’s business, a focus that has clearly reaped dividends. And while he had earlier gained a degree from from the University of Bombay, a dropout is a dropout, be they a billionaire or no…
 

3. Eike Batista
 

The son of a Brazilian mining executive, Eike Batista spent much of his childhood in Germany and studied engineering in Aachen University. However, rather than completing his degree, he started a gold mining company in the Amazon in 1980 – a move that took the shine off his educational record but would soon fill his pockets. In 2000, he sold his share of the company for a cool $1 billion; but he didn’t rest on his laurels, instead investing these funds into further mining ventures and oil and gas exploration. His business savvy and ability to take advantage of market trends have allowed him to amass $30 billion in personal wealth, making him the 8th wealthiest individual alive and giving him the number one spot in Brazil.
 

2. Lawrence Ellison
 

The death of his adoptive mother prompted Larry Ellison to drop out of his second year at University of Illinois. He then spent a single term at University of Chicago before dropping out again and moving to California in 1964. These two attempts at college certainly were not signs of a lack of determination though. In 1977 he founded the company that would become Oracle, a software firm specializing in data systems. His abandonment of academia to move to California put him at the heart of software and computer innovation, a move that has led to him amassing a fortune of $39.5 billion as of 2011, making him the 5th richest person in the world.
 

1. Bill Gates
The richest college dropout in the world is also one of the most well known. At number two in the world’s richest rankings and with a net worth of $56 billion, Bill Gates is a household name. He was the world’s richest person from 1995 to 2007 and again in 2009, unsurprising when you consider how ubiquitous Microsoft products are in homes and businesses across the world. Gates enrolled in Harvard as a pre-law major in 1973, but kept up the computer programming he had begun in 8th grade. It was these extracurricular activities that made him his fortune after the release of microcomputer design the Altair 8800 computer prompted him to set up a software company with Paul Allen. In 1975, he took a leave of absence from his studies at Harvard, only to return for an honorary degree in 2007.


Monday, April 16, 2012

Acidity - hyperacidity or acid dyspepsia

Acidity refers to a set of symptoms caused by an inequity. More names for acidity are hyperacidity or acid dyspepsia. Acid reflux or Acidity is one of the most normal diseases that cause heart burns in the upper body

Acidity can be a result of inappropriate dietary regimen or stress. It is a problem which when left unattended to, results in peptic ulcer and other complications. It is quite a simple problem when it begins, but it can get out of hand easily if not taken critically. It means the excess secretion of acid by the gastric glands of the stomach.

The usual signs of heartburn are a burning sensation or pain in the stomach after one to four hours of a meal. The too much secretion of hydrochloric acid in the stomach causes acidity. Acidity can be a result of improper dietary regimen or stress

The too much secretion of hydrochloric acid in the stomach causes acidity. Some causes of acidity include Alcohol, caffeine, nicotine, chocolate, citrus, tomato, peppermint, fried and fatty foods, over-eating, stress, some medications, and being overweight. Acid Reflux Disease causes harms to the esophagus as the acidic contents from the stomach, containing acids and pepsin, pushes back to the esophagus since the sphincter develops into weak and can no-more prevent the contents from stomach from gushing back in esophagus

Skipping meals, not eating on time, fried and spicy food, stress, anxiety, insomnia, obesity, pregnancy, smoking, alcohol, and wearing tight clothes can give you hyper-acidity and heartburn.

Acidity is a problem that occurs very commonly; so going in for allopathic medications every time doesn't seem to be a very good thought. Some herbal remedies are very effective in the treatment and prevention of acidity


Symptoms of Acidity
The main symptoms of acidity are:
  • Dyspepsia and heartburn
  • Discomfort, burning sensation in the upper part of the gut area, especially after eating.
  • Regurgitation of the gastric contents
  • loss of appetite
  • nausea, vomiting
  • feeling of sickness
  • flatulence accompanied by burping
  • constipation

Causes of Acidity
Acidity may be caused by many conditions such as:

# Medical conditions, such as gastroesophageal reflux disease, stomach ulcers
# Hyperthyroidism - excessive secretion of the thyroid gland.
# Anxiety, anger and stress.
# Constipation, flatulence or intestinal gases.
# Artificial stimulants or the thought of nearing the food time can create acidity.
# Excessive intake of stimulants like tea, coffee etc.
# Excessive intake of fried foods, spicy or pungent food,
# As a side-effect of some drugs used for treating other illnesses
# Overeating along with bad food combinations. Overeating puts extra load on the stomach, liver, kidneys.
# Eating too rapidly, therefore improper salivation of food.
# Excessive smoking, intake of alcohol
# Tendency to eat and drink together
# Insomnia
# Lack of exercise.
# Long gaps between meals leads to acidity, as it gives the acid in the stomach more time to act.

Home Remedies for Acidity
1) Eat a cup of vanilla ice cream or drink a glass of cold milk to get rid of acidity. This is an easy Home Remedy for Acidity.

2) Raita prepared with fresh curd, grated cucumber, fresh coriander, tomato is a sure shot remedy in aiding digestion, and helps eliminate acidity.

3) Mint: Fresh mint juice taken every day or fresh mint leaves boiled in a cup of water and sipped slowly after meals also helps to keep the stomach acids at bay

4) Mint juice before meals keeps acidity at bay. This is another good Home Remedy for Acidity.

5) Chewing 5-6 basil leaves relieves flatulence and acidity.

6) Half a glass of fresh pineapple juice should be taken after a meal for treating and preventing acidity

7) A piece of jaggery or gur after lunch and dinner prevents acidity

8) A very simple remedy for acidity is thin butter-milk mixed with 1/4 teaspoon of black pepper powder


9) One of the common Home Remedies for Acidity - Onion (pyaz): The juice of onions is an excellent remedy for acidity.

10) Habitual eating habits and a healthy diet can prevent acidity

11) Drink plenty of water (at least 6 to 8 glasses per day) and other fluids to maintain the acid balance in the stomach

12) A sherbet made with kokum and jeera gives relief from acidity.

13) Lemon rind can also be eaten to prevent heartburn

14) A glass of cold milk provides instant relief. This is an effective Home Remedy for Acidity.

15) Eat almonds to give relief to symptoms of acidity

16) Chew a few holy basil (tulsi ) leaves to get relief 

17) Bananas, watermelon and cucumber have protective action against the acidity and heart burn

18) Lemon: Juice of one lemon mixed in half glass of water and ½ teaspoon sugar if consumed before meals helps to relieve acidity

19) When suffering from acidity, drink five to eight glass of coconut water a day. This is another effective Home Remedy for Acidity.

Some Foods to Avoid for Heartburn
There are many foods that are commonly known to cause acid in the stomach and heartburn. These are citrus fruits, tomatoes, fatty foods such as pork chops, deep fried meat, or potatoes, aerated cold drinks, coffee, hot milk and so on. These are just some of the foods one should avoid for heartburn as consuming any of these in excess can cause acute discomfort.

However, not all the items named above react in the same way on everyone. People have different reactions to different stimulants and hence, one will need to carefully watch and identify which foods cause the greatest harm. Once you have a list, eliminate those foods from your diet to the extent possible. For example if you find that hot milk causes acute heartburn, then either stop having it altogether, or have it at room temperature or ice cold. 

Similarly, with fatty foods - either totally stop having them or have a Tums right before or after the meal which will neutralize the excess acid formed in the stomach. 


VITAMINS, MINERALS AND SUPPLEMENTS

In general the way to get crucial vitamins and minerals is through healthy foods, so for a completely well-nourished person, supplements may be a waste of money. But for people over age 50, even the best diet may not provide enough of some important nutrients.

Use this information to explore details about the Vitamins, Minerals and Supplements that are most important and specially as you grow older for people over 50.

Supplements may cause side effects. If you have certain diseases, such as cancer or diabetes, your body may have special nutritional needs. Be sure to talk to your doctor about the vitamins and supplements you take.



Vitamin A
How much?
Men: 900 mcg
Women: 700 mcg

Why you need it:

Promotes good vision; helps keep immune system healthy.

Good to know:

In supplements, look for vitamin A as beta carotene, not as retinol or retinoic acid, which increases the risk of bone fracture.

Food sources:

Dairy products, fish, darkly colored fruits and vegetables.

Vitamin B1 (thiamin)
How much?
Men: 1.2 mg
Women: 1.1 mg
Why you need it:
Necessary for healthy nerve and brain cells; helps convert food to energy.
Good to know:
Antacids and some diuretics may lower thiamin levels by decreasing absorption and increasing urinary secretion.
Food sources:
Liver, whole grains, enriched breads and cereals.



Vitamin B2 (riboflavin)
How much?
Men: 1.3 mg
Women: 1.1 mg
Why you need it:
Important for red blood cell production; helps convert food to energy.
Good to know:
Older men and women may be especially susceptible to riboflavin deficiency, which can cause cracking or sores at the corners of the mouth, skin irritation or weakness.
Food sources:
milk, eggs, fortified bread products and cereals.

Vitamin B3 (niacin)
How much?

Men: 16 mg
Women: 14 mg
Why you need it:

Necessary for proper functioning of the digestive system, skin and nerves; helps convert food to energy.
Good to know: Can cause skin flushing; may be prescribed to treat high cholesterol but should be used only under a doctor's care because of potentially severe side effects.
Food sources:Meat, fish, poultry, eggs.

Vitamin B6 (pyridoxine)
How much?
Men: 1.7 mg
Women: 1.5 mg
Why you need it: Aids in the formation of red blood cells; strengthens the immune system.
Good to know: Too high doses of supplements may cause nerve damage, numbness and trouble walking.

Food sources: Beans, nuts, eggs, whole grains.

Vitamin B12
How much?
Men and women: 2.4 mcg

Why you need it: Essential for keeping nerves and red blood cells healthy.

Good to know: As many as a third of people over 50 do not absorb enough B12 from diet alone; inadequate absorption may lead to neurological and balance problems.

Food sources: Fish, shellfish, meat, dairy products.

Vitamin C
How much?

Men: 90 mg
Women: 75 mg
(Smokers should add an extra 35 mg)

Why you need it:
Important for wound healing; boosts immune system; required for growth and repair of tissues in all parts of body.
Good to know:
No studies confirm vitamin C prevents colds although it may shorten the length of a cold; excessive amounts may lead to upset stomach and diarrhea.
Food sources:
Citrus fruits, tomatoes, kiwi, strawberries.

Vitamin D
How much?

Ages 51-70: 400 IU (10 mcg)
Age 71+: 600 IU (15 mcg)
Why you need it: Helps the body absorb calcium; may protect against heart disease, cancer, diabetes and several autoimmune diseases.
Good to know: The current recommendation is under review and may soon increase substantially. See also "D to the Rescue."
Food sources: Sun exposure provides the body's main supply of vitamin D; fatty fish, fortified milk and juices also contribute.

Vitamin E
How much?

Men and women: 15 mg
Why you need it: Helps protect cells from damage; may reduce the risk of developing cancer, heart disease and other chronic diseases, but further research is needed.
Good to know:
If you take a blood thinner, talk to your doctor before taking supplements; vitamin E increases bleeding risk.
Food sources:
Vegetable oils, nuts, fruits, vegetables.


Folic acid

How much?
Men and women:
400 mcg

Why you need it: This B vitamin helps form red blood cells and produce DNA.

Good to know:
High levels may mask vitamin B12 deficiency, especially in older adults. Recent research, suggests that for women, folic acid along with vitamins B6 and B12 may reduce the risk of developing age-related macular degeneration.

Food sources:
Enriched cereals, whole-grain breads, dark, leafy vegetables.

Vitamin K
How much?
Men: 120 mcg
Women: 90 mcg

Why you need it: Helps blood clot properly and helps maintain strong bones in older men and women.

Good to know: Can dilute the effect of blood thinners, so talk to your doctor if you take Coumadin (warfarin) or other blood thinners.

Food sources: Plant oils, green vegetables, cabbage, cauliflower.

[2] MINERALS
Calcium
How much?
Men and women: 1200 mg

Why you need it: Helps form and maintain healthy teeth and bones; needed for normal heartbeat; helps with blood clotting.

Good to know: The body needs vitamin D to help absorb calcium, so if you use calcium supplements choose one that contains D. Recent studies have linked calcium pills to increased risk of heart attack.

Food sources: Dairy products, green leafy vegetables, bok choy, calcium-fortified orange juice.

Chromium
How much?
Men: 30 mcg
Women: 20 mcg

Why you need it: Helps maintain normal blood sugar levels.

Good to know: There has been interest in treating high glucose levels and type 2 diabetes with supplemental chromium, but research to date is inconclusive.

Food sources: Meat, chicken, broccoli, apples, fish, grape juice.


Iodine
How much?
Men and women: 150 mcg
Why you need it: Necessary for normal thyroid function; prevents goiter, a swelling of the thyroid gland.
Good to know:
Deficiency occurs more often in women than men; when buying salt, choose one labeled "iodized."
Food sources: Seafood, iodized salt.

Iron
How much?

Men and women: 8 mg
Why you need it:
Essential for healthy red blood cells.
Good to know:
Men and women over 50 generally should not take a mutivitamin containing iron unless they have been diagnosed with iron deficiency.
Food sources:
Meat, eggs, fortified bread and grain products.


Magnesium
How much?

Men: 420 mg
Women: 320 mg
Why you need it:
Supports a healthy immune system; helps keep bones strong; regulates heart rhythm.
Good to know: Magnesium-rich foods may help protect against the development of type 2 diabetes; may also decrease the risk of high blood pressure in women.
Food sources: Whole grains, nuts, green vegetables.

Potassium
How much?

Men and women: 4700 mg
Why you need it:
Crucial for heart, kidney, muscle, nerve function; important in controlling blood pressure; works with sodium to maintain the body's water balance.
Good to know:
With age, kidneys become less able to remove potassium from blood, so speak with your doctor before taking supplements. A diet rich in fruits and vegetables generally provides sufficient potassium.
Food sources:
Cantaloupe, bananas, yogurt, leafy green vegetables and sweet potatoes.

Selenium
How much?
Men and women: 55 mcg

Why you need it:

Helps make special proteins that play a role in preventing cell damage.

Good to know:

May reduce the risk of certain cancers, including lung, colorectal and prostate, although not all studies have found this effect.

Food sources:

Red meat, fish, chicken, vegetables.


Zinc
How much?

Men: 11 mg
Women: 8 mg
Why you need it:
Aids in wound healing; keeps sense of smell and taste sharp.
Good to know:
Many people take zinc to ease the miseries of a common cold, but its effect is controversial; some studies suggest zinc can speed recovery, others conclude it doesn't work. Some studies show that taking a combination of antioxidants and zinc reduces the risk of advanced age-related macular degeneration.
Food sources:
Fortified cereals, red meat, eggs, seafood.


[3] SUPPLEMENTS
Omega-3 fatty acids
What does it do:

Important for blood clotting, cell division, relaxation and contraction of muscles.
Good to know:
The omega-3 fatty acids plentiful in fatty fish and fish oil supplements have built a powerful reputation for reducing the risk of a second heart attack. Studies on fish oil and memory have had mixed results. May interact with blood thinners.

Echinacea
What does it do:
This native American plant may reduce the duration of a cold.
Good to know:
Study results are mixed about whether it can prevent colds and other infections.

Ginkgo
What does it do: Derived from the oldest living tree species, ginkgo extract improves walking in people with certain circulatory problems that affect the legs.
Good to know:
Research on ginkgo's effect on Alzheimer's and memory loss has been disappointing. Ginkgo can increase bleeding risk, so talk to your doctor if you take blood thinners or have surgery scheduled.

Ginseng
What does it do:

The root of this plant appears to benefit people with heart disorders. It may also lower blood glucose levels in people with type 2 diabetes.
Good to know: People with diabetes should use caution with ginseng, especially if they are taking medication to lower blood glucose.

Monday, April 2, 2012

Set Operations in the Unix Shell

Various Set operations are covered here, Hope you Enjoy.

Set Membership
--------------

$ grep -xc 'element' set    # outputs 1 if element is in set
                            # outputs >1 if set is a multi-set
                            # outputs 0 if element is not in set

$ grep -xq 'element' set    # returns 0 (true)  if element is in set
                            # returns 1 (false) if element is not in set

$ awk '$0 == "element" { s=1; exit } END { exit !s }' set
# returns 0 if element is in set, 1 otherwise.

$ awk -v e='element' '$0 == e { s=1; exit } END { exit !s }' set


Set Equality
------------

$ diff -q <(sort set1) <(sort set2) # returns 0 if set1 is equal to set2
                                    # returns 1 if set1 != set2

$ diff -q <(sort set1 | uniq) <(sort set2 | uniq)
# collapses multi-sets into sets and does the same as previous

$ awk '{ if (!($0 in a)) c++; a[$0] } END{ exit !(c==NR/2) }' set1 set2
# returns 0 if set1 == set2
# returns 1 if set1 != set2

$ awk '{ a[$0] } END{ exit !(length(a)==NR/2) }' set1 set2
# same as previous, requires >= gnu awk 3.1.5


Set Cardinality
---------------

$ wc -l set | cut -d' ' -f1    # outputs number of elements in set

$ wc -l < set

$ awk 'END { print NR }' set


Subset Test
-----------

$ comm -23 <(sort subset | uniq) <(sort set | uniq) | head -1
# outputs something if subset is not a subset of set
# does not putput anything if subset is a subset of set

$ awk 'NR==FNR { a[$0]; next } { if !($0 in a) exit 1 }' set subset
# returns 0 if subset is a subset of set
# returns 1 if subset is not a subset of set


Set Union
---------

$ cat set1 set2     # outputs union of set1 and set2
                    # assumes they are disjoint

$ awk 1 set1 set2   # ditto

$ cat set1 set2 ... setn   # union over n sets

$ cat set1 set2 | sort -u  # same, but assumes they are not disjoint

$ sort set1 set2 | uniq

$ sort -u set1 set2

$ awk '!a[$0]++'           # ditto


Set Intersection
----------------

$ comm -12 <(sort set1) <(sort set2)  # outputs insersect of set1 and set2

$ grep -xF -f set1 set2

$ sort set1 set2 | uniq -d

$ join <(sort -n A) <(sort -n B)

$ awk 'NR==FNR { a[$0]; next } $0 in a' set1 set2


Set Complement
--------------

$ comm -23 <(sort set1) <(sort set2)
# outputs elements in set1 that are not in set2

$ grep -vxF -f set2 set1           # ditto

$ sort set2 set2 set1 | uniq -u    # ditto

$ awk 'NR==FNR { a[$0]; next } !($0 in a)' set2 set1


Set Symmetric Difference
------------------------

$ comm -3 <(sort set1) <(sort set2) | sed 's/\t//g'
# outputs elements that are in set1 or in set2 but not both

$ comm -3 <(sort set1) <(sort set2) | tr -d '\t'

$ sort set1 set2 | uniq -u

$ cat <(grep -vxF -f set1 set2) <(grep -vxF -f set2 set1)

$ grep -vxF -f set1 set2; grep -vxF -f set2 set1

$ awk 'NR==FNR { a[$0]; next } $0 in a { delete a[$0]; next } 1;
       END { for (b in a) print b }' set1 set2


Power Set
---------

$ p() { [ $# -eq 0 ] && echo || (shift; p "$@") |
        while read r ; do echo -e "$1 $r\n$r"; done }
$ p `cat set`

# no nice awk solution, you are welcome to email me or put the comment.


Set Cartesian Product
---------------------

$ while read a; do while read b; do echo "$a, $b"; done < set1; done < set2

$ awk 'NR==FNR { a[$0]; next } { for (i in a) print i, $0 }' set1 set2


Disjoint Set Test
-----------------

$ comm -12 <(sort set1) <(sort set2)  # does not output anything if disjoint

$ awk '++seen[$0] == 2 { exit 1 }' set1 set2 # returns 0 if disjoint
                                             # returns 1 if not


Empty Set Test
--------------

$ wc -l set | cut -d' ' -f1 # outputs 0  if the set is empty
                            # outputs >0 if the set is not empty

$ wc -l < set           

$ awk '{ exit 1 }' set   # returns 0 if set is empty, 1 otherwise


Minimum
-------

$ head -1 <(sort set)    # outputs the minimum element in the set

$ awk 'NR == 1 { min = $0 } $0 < min { min = $0 } END { print min }'


Maximum
-------

$ tail -1 <(sort set)    # outputs the maximum element in the set

$ awk 'NR == 1 { max = $0 } $0 > max { max = $0 } END { print max }'



Unusual things I didn’t know about Steve Jobs.

Unusual things I didn’t know about Steve Jobs.

 1) Nature versus Nurture. His sister is Mona Simpson but he didn’t know it until he was an adult. Mona Simpson was one of my favorite novelists from the late 80s. Her first novel, Anywhere but Here, was about her relationship with her parents. Which, ironically, was Steve Jobs parents. But since Steve Jobs was adopted they didn’t know they were brother-sister until the '90s when he tracked her down. It’s proof (to an extent) of the nature versus nurture argument. Two kids, without knowing they were brother and sister, both having a unique sensibility of life on this planet to become among the best artists in the world in completely different endeavors. And, to me it was great that I was a fan of both without realizing (even before they realized) that they were related.

 2) His father’s name is Abdulfattah Jandali. If you had to ask me what Steve Job’s father’s name was I never in one zillion years would’ve guessed that, and that Steve Jobs biologically was half Syrian Muslim. For some reason I thought he was Jewish. Maybe it's because I wanted to be him so I projected my own background onto him. His parents were two graduate students who I guess weren’t sure if they were ready for a kid so put him up for adoption and then a few years later had another kid. So I didn’t know he was adopted. The one requirement his biological parents had was that he be adopted by two college educated people. But the couple that adopted him lied at first and turned out not to be college educated (the mom was not a high school graduate) so the deal almost fell through until they promised to send Steve to college. A promise they couldn’t keep. So despite many layers of lies and promises broken, it all worked out in the end. People can save a lot of hassle by not having such high expectations and overly ambitious worries in the first place.

3) He made the game “Breakout”. If there was one thing I loved almost as much as the games on the Apple II+ it was playing Breakout on my first-generation Atari (I can’t remember, was that the Atari 2600?), and then Breakout on every version of my Blackberry since 2000. If he had never done anything else in life and I had met him and he said, “I’m the guy who made Breakout”, I would’ve said, “you are the greatest genius of the past 100 years.” Funny how things turn out. He went on from Atari to form Apple. Nolan Bushnell, founder of Atari, went on to form the greatest restaurant chain in the history of mankind: Chuck E. Cheese.

4) He denied paternity on his first child, claiming he was sterile. The mother had to initially raise the kid using welfare checks. I have no judgment on this at all. Raising kids is hard. And when you have a kid you feel like this enormous energy and creativity you have for the world is going to get misdirected into a… little baby (Jobs’ parents must’ve felt that way as well. Like father, like son). Heck, I originally wanted my first kid to be aborted. But people change, mature, grow up. Eventually Jobs became a good father. And that’s what counts in the end. Much worse if it was the reverse. I didn’t know this either: that the Lisa computer (the “Apple III”) was named after this first child.

5) He’s a pescetarian. In other words, he eats fish but no other meat. And he eats anything else a vegetarian eats (including eggs and dairy). Turns out if you compare pescetarians with regular meat-eaters they have a 34% less chance of dying of heart disease. And if you compare vegetarians with meat eaters, they only have a 20% less chance of dying of heart disease. I think from now on I’m going to be a pescetarian, just because Steve Jobs is one. Except when I’m in Argentina. In Argentina you have to eat steak. Ted Danson and Mary Tyler Moore consider themselves pescetarians. Somehow, even the word “pescetarian” seems like it was invented in California.

 6) He doesn’t give any money to charity. And when he became Apple’s CEO he stopped all of their philanthropic programs. He said, “wait until we are profitable”. Now they are profitable, and sitting on $40bb cash, and still no corporate philanthropy. I actually think Jobs is probably the most charitable guy on the planet. Rather than focus on which mosquitoes to kill in Africa (Bill Gates is already focusing on that), Jobs has put his energy into massively improving quality of life with all of his inventions. People think that entrepreneurs have to some day “give back.” This is not true. They already gave at the office. Look at the entire iPod/Mac/iPhone/Disney ecosystem and ask how many lives have benefited directly (because they’ve been hired) or indirectly (because they use the products to improve their quality of life). As far as I know, Jobs has never even commented about his thoughts on charity. Good for him. As one CEO of a (currently) Fortune 10 company once told me when I had my hand out for a charitable website, “Screw charity!”

 7) He lied to Steve Wozniak. When they made Breakout for Atari, Wozniak and Jobs were going to split the pay 50-50. Atari gave Jobs $5000 to do the job. He told Wozniak he got $700 so Wozniak took home $350. Again, no judgment. Young people do things. Show me someone who says he’s been honest from the day he was born and I’ll show you a liar. It's by making mistakes, having fights, finding out where your real boundaries in life are, that allow you to truly know where the boundaries are.

 8) He’s a Zen Buddhist. He even thought about joining a monastery and becoming a monk. His guru, a Zen monk, married him and his wife. When I was going through some of my hardest times my only relief was sitting with a Zen group. Trying to quiet the mind to deal with the onrush of non-stop pain that was trying to invade there. The interesting thing about Jobs being a Zen Buddhist is that most people would think that serious Buddhism and being one of the wealthiest people in the world come into conflict with each other. Isn’t Buddhism about non-attachment? Didn’t Buddha himself leave his riches and family behind? But the answer is “no." It's normal to pursue passions and outcomes, but just not to become overly attached to those outcomes. Being happy regardless of the outcome. A great story is the Zen master and his student walking by a river. A prostitute was there and needed to be carried over the river. The Zen master picked her up and carried her across the river and then put her down. Then the master and student kept walking. A few hours later the student was so agitated he finally had to ask, “Master, how could you touch and help that prostitute! That’s against what we believe in!” And the Master said, “I left her by the river. Why are you still carrying her?”

 9) He didn’t go to college. I actually didn’t know this initially. Bill Gates and Mark Zuckerberg are the famous college graduates that I knew about. But apparently Steve Jobs went to Reed College for one semester and then dropped out. Guess you don’t need college to program computers, make computers, build businesses, make movies, manage people, etc.

10) Psychedelics. Steve Jobs used LSD at least once when he was younger. In fact, he said about the experience, it was “one of the two or three most important things I have done in my life.” Apple’s slogan for many years was “Think Different.” Maybe using a drug which tore him from the normal frame of reference taught him how to look at problems from such a unique perspective. I don’t think LSD is for everyone, but when you combine it with the innate genius the man had, plus the many ups and downs that he experienced, plus the Zen Buddhism and all of the other things above, it's quite possible it all adds up to the many inventions he’s been able to produce. Steve Jobs’ story is filled with nuance and ambiguity.

People study Steve Jobs by looking at his straightforward business successes. Yes, he started Apple in a garage. Yes, he started Pixar and almost went broke with it. Yes, he started and sold NeXT and he was fired as CEO of Apple, and blah blah blah. But none of that will ever explain the man behind the genius. None of that will explain all the products he invented that we use today. None of that will tell us about the iPad, Toy Story, the Mac Air, the Apple II+, etc. A man’s successes can be truly understood only if we can count his tears. And unfortunately in the case of Steve Jobs, that is one task that’s impossible.