data readrtf_a;
infile "E:\sas_study\programs\test.rtf" missover length = l end = lastobs lrecl = 2000;
input string $varying2000. l;
rownum = _n_;
string=tranwrd(string, '{\field{\*\fldinst SYMBOL 179 \\f "Symbol" }}', '>=');
string=tranwrd(string, '{\super a} ' , '');
retain c1-c99 dropme indent;
length c1-c2 $200 c3-c99 $50;
if _n_ = 1 then dropme = 1;
array c{99} $;
if index(string, '\trowd') then do;
count = 0;
indent = 0;
do i=1 to dim(c);
c{i} = '';
end;
end;
if index(string, '{') and index(string, '\cell') then do;
count + 1;
prep = substr(string, 1, index(string, '\cell')-1);
prep = scan(prep, 2, '{');
c{count} = compress(prep, byte(13));
if count = 1 then do;
sst = substr(string, index(string, '\li') + 3);
if verify(sst, '-0123456789') > 1 then
indent=input(substr(sst, 1, verify(sst, '-0123456789') - 1), best.);
end;
if index(c{count}, '\li') then do;
c{count} = substr(c{count}, index(c{count}, '\li'));
c{count} = substr(c{count}, index(c{count}, ' ')+1);
end;
end;
if dropme = 4 then dropme = 0;
if index(string, '\sect') or
(index(compress(lowcase(string)), 'page') and
index( lowcase(string) , ' of ')) then dropme = 1;
else if index(string, '\trowd' ) and dropme = 1 then dropme = 2;
else if index(string, '\clbrdrb') and dropme = 2 then dropme = 3;
else if index(string, '\row' ) and dropme = 3 then dropme = 4;
if not dropme and index(string, '\row') then do;
allblank = 1;
do i=1 to dim(c);
if compress(c{i}, ' \') ne '' then allblank = 0;
end;
if not allblank then output;
end;
run;
Thursday, August 12, 2010
SAS
Monday, July 6, 2009
Difference between lateral and logical thinking
Many years ago in a small Indian village,
A farmer had the misfortune Of owing a large sum of money to a village moneylender.
The Moneylender , who was old and ugly, fancied the farmer's beautiful Daughter. So he proposed a bargain.
He said he would forgo the farmer's debt if he could marry his Daughter. Both the farmer and his daughter were horrified by the Proposal.
So the cunning money-lender suggested that they let Providence decide the matter.
He told them that he would put a black Pebble and a white pebble into an empty money bag. Then the girl would Have to pick one pebble from the bag.
1) If she picked the black pebble, she would become his wife and her father's debt would be forgiven.
2) If she picked the white pebble she need not marry him and her father's debt would still be forgiven.
3) But if she refused to pick a pebble, her father would be thrown into Jail.
They were standing on a pebble strewn path in the farmer's field. As They talked, the moneylender bent over to pick up two pebbles. As he Picked them up, the sharp-eyed girl noticed that he had picked up two Black pebbles and put them into the bag.
He then asked the girl to pick A pebble from the bag.
Careful analysis would produce three possibilities:
1. The girl should refuse to take a pebble.
2. The girl should show that there were two black pebbles in the bag And expose the money-lender as a cheat.
3. The girl should pick a black pebble and sacrifice herself in order To save her father from his debt and imprisonment.
Take a moment to ponder over the story. The above story is used with The hope that it will make us appreciate the difference between lateral And logical thinking.
The girl's dilemma cannot be solved with Traditional logical thinking. Think of the consequences if she chooses
The above logical answers.
What would you recommend to the Girl to do?
Well, here is what she did ....
The girl put her hand into the moneybag and drew out a pebble. Without Looking at it, she fumbled and let it fall onto the pebble-strewn path Where it immediately became lost among all the other pebbles.
"Oh, how clumsy of me," she said. "But never mind, if you look into the Bag for the one that is left, you will be able to tell which pebble I Picked."
Since the remaining pebble is black, it must be assumed that she had Picked the white one. And since the money-lender dared not admit his Dishonesty, the girl changed what seemed an impossible situation into An extremely advantageous one.
Friday, June 5, 2009
My fav quotes
[1] Regular naps prevent old age, especially if you take them while
driving.
[2] Having one child makes you a parent; having two makes you are a
referee.
[3] Marriage is a relationship in which one person is always right and
the other is the husband!
[4] I believe we should all pay our tax with a smile. I tried - but
they wanted cash.
[5] A child's greatest period of growth is the month after you've
purchased new school uniforms.
[6] Don't feel bad. A lot of people have no talent.
[7] Don't marry the person you want to live with, marry the one you
cannot live without, but whatever you do, you'll regret it later.
[8] You can't buy love, but you pay heavily for it.
[9] Bad officials are elected by good citizens who do not vote.
[10] Laziness is nothing more than the habit of resting before you get
tired.
[11] Marriage is give and take. You'd better give it to her or she'll
take it anyway.
[12] My wife and I always compromise. I admit I'm wrong and she agrees
with me.
[13] Those who can't laugh at themselves leave the job to others.
[14] Ladies first. Pretty ladies sooner.
[15] A successful marriage requires falling in love many times, always
with the same person.
[16] You're getting old when you enjoy remembering things more than
doing them.
[17] It doesn't matter how often a married man changes his job, he
still ends up with the same boss.
[18] Real friends are the ones who survive transitions between address
books.
[19] Saving is the best thing. Especially when your parents have done
it for you.
[20] Wise men talk because they have something to say; fools talk
because they have to say something
[21] They call our language the mother tongue because the father
seldom gets to speak!
[22]Why do couples hold hands during their wedding? It's a formality
just like two boxers shaking hands before the fight begins!
[23]It's funny when people discuss Love Marriage vs Arranged. It's
like asking someone, if suicide is better or being murdered.
[24]There is only one perfect child in the world and every mother has
Monday, February 16, 2009
Here i am sitting in my office @ night.
Think about it : )
Here i am sitting in my office @ night
Thinking hard about life
How it changed from a collage life to strict professional life...
How tiny pocket money changed to huge monthly paychecks
but then why it gives less happiness.
How a few local denim jeans changed to new branded wardrobe
but then why there are less people to use them
How a single plate of samosa changed to a full Pizza or burger
But then why there is less hunger..
Here i am sitting in my office @ night
Thinking hard about life
How it changed..
How a bike always in reserve changed to bike always on
but then why there are less places to go on
How a small coffee shop changed to cafe coffee day
but then why its feels like shop is far away..
How a limited prepaid card changed to postpaid package
but then why there are less calls & more messages
Here i am sitting in my office @ night
Thinking hard about life
How it changed...
How a general class journey changed to Flight journey
But then why there are less vacations for enjoyment.
How a old assembled desktop changed to new branded laptop
but then why there is less time to put it on.
How a small bunch of friends changed to office mate
But then why we always feel lonely n miss those college frnz..
Here i am sitting in my office @ night
Thinking hard about life
How it changed.. How it changed..
Thursday, February 5, 2009
India as seen by Slumgdog Millionaire
Is it a masala film ? Yes
It depicts India in a poor shape? Yes
Is life really hard in this country? Yes
Do poor really have hard life like this? Yes even harder than it showed
Don't we have rich people? Yes we have, in fact, few of the richest in the world
How come they become so rich? Few by greedy business and others by outsourcing US money
Are all rich people like this? Not all but many are. Other rich are not richest
So, Are we a poor nation? Yes
Are we a corrupt nation? Yes
Are we divided in caste and creed? Yes
Will we ever rise? May be
Will we ALL rise? No
Is our society responsible for it? BIG YES
Are we pseudo patriotic? Yes
Will this ever end? Never
Why? Don't we have intelligent people? Yes we have
Where are they? In US and UK
Why are they there? Because no one likes to be ruled by dumb asses
Who are dumb asses? We all are.. you, I and rest
Tuesday, January 13, 2009
The mantra to win any award
The mantra to win any award :
01. Take any famous British or Hollywood director.
02. Production house doesn't matter. A rich or famous house would be better.
03. Take renown Indian actors and give them supporting roles only.
04. The hero ideally should be a new comer but a small unseen actor would also do.
Now next two points are important -
05. Show India in a pathetic sense - a real pathetic world. Show slums, dirty people, baggers, the evils in the society and hey! don't forget to show violence done by Hindu extremists. Hindu-Muslim violence is a spicy item number. Showcasing small kids being used for heinous crimes, the drug mafia will add to the 'realism' but it is director's choice only.
06. Publicize a film based on India, played by Indians but for US/UK audience only. Releasing it in overseas than India first would be a great idea.
And here you go .... nominations, laurels, awards, applauds.. may be a nomination for the academy awards and everything else you can imagine. Isn't it the simple formula??
Thursday, January 8, 2009
Microsoft Releases Windows 7 Beta as a Free Download
LAS VEGAS -- Microsoft's excitable CEO Steve Ballmer showed off Windows 7 -- the slick, fast, user-friendly successor to the much-maligned Windows Vista -- and said it will be available as a public beta on Friday.
Unveiled by an intense Ballmer during his keynote address on the eve of CES 2009, Windows 7 will offer better performance on underpowered machines such as netbooks, support for multitouch interfaces, and simplified home networking.
Ballmer said that this would be the "best version of Windows ever" and pointed out features that implicitly acknowledged the problems with Windows Vista.
"We are putting in all the right ingredients -- simplicity, reliability and speed -- and working hard to get it right and to get it ready," said Ballmer.
Ballmer's keynote is his first at the big, prestigious CES show since the departure of Microsoft founder Bill Gates a year ago. He showed no signs of stage fright, bounding onstage in a maroon pullover, rubbing his hands together and grinning eagerly.
Microsoft is also eager to get Windows 7 into people's hands given the negative reaction to Windows Vista, which was widely panned. Released in 2007, Vista annoyed many customers with its hunger for computing resources and its seemingly incessant security notifications. Those notifications were such a defining characteristic of Vista that they were even satirized in Apple commercials. Despite the criticisms, Microsoft sold 20 million copies of Vista in the first month, and there are now an estimated 300 million users of Vista worldwide.
According to Ballmer, Windows 7 will be available to developers immediately, and to the general public on Friday, January 9. It will be a free download from Microsoft's site.
Windows 7 has been widely anticipated since developers got the first glimpse of it at a Microsoft conference earlier this year. Microsoft promises that the new OS will have faster startup and shutdown times, fewer security alerts, and will provide better power management leading to improved battery life on laptops.
Microsoft showed off Windows 7's support for multitouch interfaces, simplified home networking, and easier management of peripheral devices such as cell phones and digital cameras.
In addition, the OS will have an updated Taskbar, new animated desktop effects, context-sensitive menus and a smarter desktop search tool. And it will be svelte enough to run on a netbook with as little as 1GB of RAM and a 1GHz processor, Microsoft has promised.
This is the only public beta of Windows 7, a company spokesperson confirmed. The company did not announce the exact date of Windows 7's commercial release.
Windows 7 is only one part of Microsoft's three-pronged strategy to provide software for what Ballmer called the "three screens" -- PCs, phones and TVs.
"I believe windows will remain at the center of people's technological solar system," Ballmer said, touting the company's efforts in the mobile, online, and home entertainment markets.
For instance, Ballmer announced that its online software suite, Windows Live Essentials, will be coming out of beta as of tomorrow.
The company announced several Windows Live partnerships, including one with Facebook, which will allow Facebook users to share content that they've uploaded into their Facebook accounts with their Windows Live accounts. Similar interconnectivity already exists between Windows Live and Flickr.
Also, Dell will be preloading Windows Live Essentials on its computers, replacing the Google Toolbar.
Ballmer promised a new version of Microsoft's OS for smartphones, Windows Mobile, to come in the first quarter of 2009. This OS will include support for Adobe Flash-based apps, including the video players used on many sites, such as YouTube.
After Ballmer, Microsoft's Robbie Bach took the stage to tout the company's Xbox 360 and Xbox Live products. According to Bach, 28 million Xbox consoles have been sold to date, and there are 17 million active users of the Xbox Live service.
The company will also be releasing two new Halo games in 2009, including Halo Wars, a strategy game that will ship on March 3, and Halo 3: Orbital Drop Shock Trooper.
Wrapping up the keynote, Ballmer and another Microsoft executive gave a demo of a futuristic multitouch application for students that made use of many technologies from the company's R&D labs, including automatic document summarizing and highlighting of key points, organizing notes along topical timelines, and collaborating with other students on a Microsoft Surface-type touch-sensitive table. They also showed what they said was a prototype flexible display, although the image shown on the bendable plastic did not seem particularly dynamic.
- wired.com
Saturday, January 3, 2009
New year resolution
Ah!! Its new year again and so is the time to make new resolutions. Many do so but i don't like making resolutions on specific days. There should not be any particular day when one can make resolutions for good, instead it should be an ongoing and lifetime journey for good.
Also, i don't like the concept of new year. For me and theoretically too, every day is a new year as the same day would come only after an year. So for those who believe in making resolutions at the start of year they can make it any day ~~
Even then, I would like to wish the citizens of the world a 'happy new year' and i wish this year we see less crime, terror and there is peace, harmony and joy in everyone's life
Ameen !
Thursday, December 25, 2008
Ambitions , Life and a journey of ten minutes
“Ambition” – Probably one of the mightiest words of the English language. A single word which characterizes the nature of a human being and the very reason of human existence. It is this world which shapes our behavioral and emotional aspects. Every thing, good or bad, is driven by this single word. For some their ambition is to be rich, for few it is love, for few it is God and for others it is power, the list is countless. This ‘ambition’ controls the taste and rationale behind many things. The greed, the anger, the love, the peace whatever we see in our life is the result of this ambition. The more materialistic our ambitions are the more we are dragged to sadness, agony and pain while the lesser they are the more we feel happiness, joy and peace.
So what are my ambitions? Or do i want to end my ambitions? Honestly, I never thought about it until Dec 24, 08.
Dec24, 08
It is just another shining day of Indian winter. Most of my colleagues and friends are/or planning for the year end vacation, but ‘ambitious’ me have different plans. It is the time to put things into action which I always dreamt or rather aspired for. My ambitions, mostly if not all, are driven by money. No I am not greedy but I need it badly to pay off the liabilities and the family needs. Though nobody ever demanded it from me but intelligent and responsible I feel that there is huge responsibility on my shoulders which I must carry out in order to justify my existence here. I must meet the expectation that many have put on me unspoken. So this is the day when I’d put the very first step on this path. God only knows what’ll happen next but I must do my karma. The day is going fine and the first step is placed as per expectations.
I am joyous and now feel more ambitious (now the greed starts coming in). I draw plans of future and how the things should stand on. I make many ideas and recap how people have deceived me and how I can repay them back! I take the quilt on me while drawing my jealously and hated plans. At the same time I am watching a clip of a goat being slaughtered in Punjab. I feel uneasiness and giddy ….
Dhakkkkk…. I open my eyes. Who am I? Where am i? What is this world and where is earth. I recall I am a boy and why can’t I remember anything. I feel something and touch my cheek. My anti-glare glasses are hanging on my right ear with the left glass half broken. Holy shit.. how I landed on the floor ? Why am I not breathing normally? I saw my laptop, it got smashed onto floor and is now laying flat. I feel more uneasiness as I regain consciousness… ah something is hurting… I touch my lip, oh my tooth smashed into my upper lip and I saw the blood on my finger. All this happen in seconds. My nerves activate my defensive system. I must get water. I get up and rush to kitchen.. gulp.. gulp one glass down, now second.. dhakkkkk.. once again I fell and the glass trembles and the sound resonates with few other utensils. Why the hell I don’t call my friend who is sitting in the next room watching tv? No, I am a man and am brave enough to tackle. Hell the man ego is so bad…. My defensive system replies hey what the fuck? Do you want to die? I get up and call my friend as he turns up I again fell on the bed.
Now I have control over my mind and can take logical decisions. Awwwwwkk.. the food is in my food pipe from down my belly. I must spew. I rush towards the balcony and get the job done… now I am feeling better while I open the tap to fill bucket with water to clean the mess. Why should I bother my friend? Oh no ego again. He is more than supportive and takes good care of me while making lemonade at the same time.
I am back to normal and relaxed.
Is it?
I am left behind with so many things. Where are my plans? Where is my greed… I just experienced something which I have never before. What is life? We always run after so many things while we are not sure about it. Life can deceive us at any time without any information or hint !
I am thinking and I just learned a new truth of life. A truth that I can not explain or put in words but something which I just discovered!
I don’t know how will this impact on my life but yes I have learned and experienced a moment which I can not distinguish – good or bad.
And the ambitions? Well they continue but with a vengeance !
Wednesday, November 26, 2008
Population bomb ticking in America
Those of us who deal with population issues all the time are frequently confronted by people who believe the population problem belongs to someone else. It traces, in their view, to poor Indians who do not understand how to use condoms, or to Mexican peasants who invade our country to steal our jobs, or to the Catholic hierarchy which persists in its irrational opposition to the use of effective birth control methods. But Indian peasants mostly want the children they have – they know how to use condoms. And at the moment Mexican immigration is probably a net benefit for the United States – although in the middle term it could become a disaster. And crazy as the Vatican's position is, relatively few Catholics pay any attention to it. After all, Italy has the smallest family size in the world!
But it just does not wash. Yes, poor nations have serious population problems, but in many respects rich nations have worse ones. Nothing recently has made the degree of overpopulation in the United States more obvious than George Bush’s confrontation with Iraq. If the United States had stabilized its population in 1943, when it was in the process of winning the largest land war in history, today it would just have 135 million people. Assume that per-capita energy consumption nevertheless had grown to today’s level – that is, our smaller population was still using sloppy technologies: gas guzzling automobiles, inefficient light bulbs and pumps, poorly insulated buildings, and so on. Even if its citizens were just as profligate users of energy as we are, the 135 million United States citizens could satisfy their energy appetite without burning one drop of imported oil or one ounce of coal.1
Of course, if we had been smart, we also would have become energy efficient and would have made a transition to some form of solar-hydrogen economy. It has been estimated that an energy efficient America could have the goods now supplied by energy use at an expenditure of about one-third the energy now employed. And it is crystal clear that for the environmental health of the globe as a whole, and the United States itself, a drastic reduction in the use of energy technologies that place greenhouse-enhancing carbon dioxide into the atmosphere is mandatory.
I = P A T
The impact of a population on the environment can be roughly viewed as the product of three factors: the size of the population (P), the level of per-capita consumption or affluence (A), and the measure of the impact of the technology (T) used to supply each unit of consumption. This provides the short-hand equation I=PxAxT which, although oversimplified (because the three factors P, A, and T are not independent), provides a basis for comparing the responsibility of different nations or groups for environmental deterioration.
Using the I = P A T equation, one can see that the population problem in the United States is the most serious in the world. First of all, the P factor is huge – with 250 million people, the United States is the fourth largest nation in the world. And compared with other large nations, the A and T factors (which when multiplied together yield per capita environmental impact) is also huge – on the order of twice that of Britain, Sweden, France, or Australia, fourteen times that of China, forty times that of India, and almost 300 times that of a Laotian or Ugandan. In per-capita energy use, only a few oil producing nations in the Middle East such as Qatar and Bahrain, plus Luxembourg and Canada, are in our league, and those nations have comparatively tiny populations. When the population multiplier is considered, the total impact of the United States becomes gigantic, several hundred times that of Bangladesh.
Those multipliers are based on per-capita commercial energy consumption, which is the best surrogate for A x T that is readily found in government statistics. The contributions of very poor countries to environmental deterioration are underestimated by these statistics, since they don’t include the impacts of use of “traditional” energy sources (fuelwood, dung, crop wastes) that comprise 12 percent of energy use globally, but a much larger component in poor countries. Considering them would not change the U.S. position as the planet’s primary environmental destroyer, though.
That preeminence makes sense intuitively, too. Few Laotians drive air-conditioned cars, read newspapers that transform large tracts of forest into overflowing landfills, fly in jet aircraft, eat fast-food hamburgers, or own refrigerators, several TV’s, a VCR, or piles of plastic junk. But millions upon millions of Americans do. And in the process they burn roughly a quarter of the world's fossil fuels, contributing carbon dioxide and many other undesirable combustion products to the atmosphere, and are major users of chlorofluorocarbons, chemicals that also add to the greenhouse effect and attack Earth’s vital ozone shield.
We have destroyed most of America’s forest cover (replacing a small fraction of it with biologically impoverished tree farms) and are busily struggling to log the last of the old growth forests in the Northwest, threatening the long-term prosperity of the timber industry, in part to service the junk bonds of rich easterners. The western United States is one of the largest desertified areas on the planet from overgrazing by cattle and sheep – not because we need the meat (only a small portion of our beef comes from the arid West), but because of the political power of ranchers in the western states and a nostalgic view of western history. And Americans have contributed mightily to the destruction of tropical forests by purchasing products ranging from beef to tropical hardwoods derived from forests.
Furthermore, each additional American adds disproportionately to the nation’s environmental impact. The metals used to support his or her life must be smelted from poorer ores at higher energy cost, or transported from further away. The petroleum and water he or she consumes, on average, must come from more distant sources or from wells driven deeper. The wastes he or she produces must be carried further away, and so on. Activities that created little or no environmental burden when the United States had a small population – such as putting CO2 into the atmosphere by burning fossil fuels – increase that burden with every additional individual when the population is large.
Courtesy - www.npg.org