Monday, May 26, 2008

Amazing work of Art

See how amazing is this .......................................
Only pencils
Man's mind of art can make a such a difference to a pencil.......... Amazing isn't it........










Poor Dogs...........

The latest in puppy fashion.

At some point, as a dog owner you're not happy with your pet's look anymore, so having gone through all the hip hairstyles, there's nowhere to go, that fur die. So you go and turn the poor animal into a walking traffic light or even a rainbow. Well I guess nobody said being "beautiful" and popular was easy. Poor dogs…










Tuesday, May 13, 2008

Empty String

Original Post from http://hanuska.blogspot.com/


How many times have you coded a check for String being null or empty? Countless times, right? I have. We use some ready-to-use classes from open source frameworks or we write our own StringUtils class. More or less they all implement the same thing and it always looks similar to the following code snippet:

String s = ...
if (s == null || s.equals(""))...

or similar to the following, which trims leading and ending whitespaces

String s = ...
if (s == null || s.trim().equals(""))...

Of course you could also do this:

"".equals(s)

which is a case when you do not care if String s is null and you don't have to worry about NPE as if won't happen ("" is never null, whereas s could be). But that's another story.

I have had "extra" warnings turned on in my IDE for couple of days. But today my IDE suprised me when it highlighted

[1] s.equals("")

and suggested that I could optimize it by making it to

[2] s.length() == 0

And guess what?! The IDE was right! I looked at the suggested code briefly, gave it a bit of thought and agreed that it would probably be faster. Method [1] creates a new instance of the String (an empty String, yes I know that all instances of "" would be caught during compilation and optimized and that they all would refer to the same instance). Just to be on the safe side I looked at the source of the String class.

And here is what I found. The length() method returns and integer primitive, which is not calculated with each method call to length(). It is rather a member variable (or constant, as Strings are invariants) of String class that is calculated when new String instance is created. So this method would be super fast.

536   public int length()
537 {
538 return count;
539 }

On the other side, there is the equals() method, which is fast as well, but not as fast as length method. It has to do a check for class, class casting and comparison of count members (that's what length method returns).

684   public boolean equals(Object anObject)
685 {
686 if (! (anObject instanceof String))
687 return false;
688 String str2 = (String) anObject;
689 if (count != str2.count)
690 return false;
691 if (value == str2.value && offset == str2.offset)
692 return true;
693 int i = count;
694 int x = offset;
695 int y = str2.offset;
696 while (--i >= 0)
697 if (value[x++] != str2.value[y++])
698 return false;
699 return true;
700 }

And remember the few important points when it comes to Strings:

  • Do not compare Strings with == operator. Unless you want to compare the object references. Use equals() method.

  • Do not construct new instances like new String("abc"). Simple "abc" will do, unless you really mean that you need a new instance of String with same value. Read more about How useful is String(String) constructor

  • Do not concatenate Strings in loops using + operator. It's faster to use StringBuffer (or StringBuilder, which is in Tiger and is not synchronized) append() and then toString() methods instead. The plus (+) operator constructs new String object each time.

Nice Philosophy

A professor stood before his Philosophy class and had some items in front of him.

When the class began, wordlessly, he picked up a very large and empty mayonnaise jar and proceeded to fill it with golf balls.

He then asked the students if the jar was full.

They agreed that it was.

The professor then picked up a box of pebbles and poured them into the jar.

He shook the jar lightly. The pebbles rolled into the open areas between the golf balls.

He then asked the students again if the jar was full.

They agreed it was.

The professor next picked up a box of sand and poured it into the jar.

Of course, the sand filled up everything else.

He asked once more if the jar was full.

The students responded with a unanimous "yes."

The professor then produced two cups of coffee from under the table and poured the entire contents into the jar, effectively filling the empty space between the sand.

The students laughed.

"Now," said the professor, as the laughter subsided, "I want you to recognize that this jar represents your life.

"The golf balls are the important things - your God, family, your children, your health, your friends, and your favorite passions - things that if everything else was lost and only they remained, your life would still be full.

"The pebbles are the other things that matter like your job, your house, and your car.

"The sand is everything else--the small stuff.

"If you put the sand into the jar first," he continued, "there is no room for the pebbles or the golf balls.

"The same goes for life.

"If you spend all your time and energy on the small stuff, you will never have room for the things that are important to you.

"Pay attention to the things that are critical to your happiness.

Play with your children.

"Take time to get medical checkups.

"Take your partner out to dinner.

"Play another 18.

"There will always be time to clean the house and fix the disposal.

"Take care of the golf balls first, the things that really matter.

"Set your priorities.

"The rest is just sand."

One of the students raised her hand and inquired what the coffee represented.

The professor smiled. "I'm glad you asked.

"It just goes to show you that no matter how full your life may seem, there's always room for a cup of coffee with a friend."

Monday, May 12, 2008

Raids against ‘software pirates’ in Colombo


Officers of the Colombo Crime Division, Sri Lanka, with the assistance of representatives of the Business Software Alliance (BSA) conducted criminal raids against distributors of illegal business software in Colombo marking the beginning of greater focus and crackdown on business software piracy distribution and business software under-licensing in Sri Lanka, lawyers involved in the crackdown said.

Three outlets at Majestic City were raided and 412 illegal software CD’s were seized by the Police during the raid. Police searched the premises of Advance Digital Zone, Marriot CD Land and Star Shop. These targets are primarily dealing in illegal computer software containing trademarks and copyright owned by business software companies such as Adobe, Autodesk, Corel, Microsoft, Symantec and McAfee to name a few, all members of the BSA.

Most of the suspected pirated software found involved business software commonly used for photo editing, animation rendering, web and computer-aided designing, anti-virus protection and productivity suites (word processing, spreadsheets, presentation, personal time and information management tools), the law firm Sudath Perera Associates said.

On May 6, Additional Magistrate of Mount Lavinia, Ms. Darshika Wimalasiri sentenced the offenders to Rs.450, 000 and 6 months imprisonment suspended for 5 years after they pleaded guilty to committing offenses under the Intellectual Property Act No. 36 of 2003.

Sri Lanka is no longer a stranger to the issue of piracy, being ranked as the country with the sixth highest piracy rate in the world at 90%, and the second-highest in the Asia-Pacific region - bringing notoriety and unwanted global attention on the island, the law firm said. In a global software piracy study conducted independently for the BSA by IDC, the information technology (IT) industry’s leading global market research and forecasting firm, the high software piracy rate has resulted in US$86 million in retail revenue losses to the local Sri Lankan software economy.

According to BSA’s legal counsel, Sudath Perera of Sudath Perera Associates“Sri Lanka has demonstrated commitment to greater protection of IP rights for software in the recent past.

This is manifested through enhanced protection measures introduced through the Intellectual Property Act No. 36 of 2003. Enforcement measures have been further strengthened through the establishment of the Commercial High Court of Colombo, with jurisdiction to determine IPR infringement cases.

In addition, the Computer Crimes Bill has been enacted during the last year which contains provisions relevant to security etc. Company directors and owners will be held personally liable and face similar penalties.”


Source Sunday Times

Thursday, May 8, 2008

Health - Important Tips

Answer the phone by LEFT ear


Do not drink coffee TWICE a day

Do not take pills with COOL water

Do not have HUGE meals after 5pm

Reduce the amount of TEA you consume

Reduce the amount of OILY food you consume

Drink more WATER in the morning, less at night

Keep your distance from hand phone CHARGERS

Do not use headphones/earphone for LONG period of time

Best sleeping time is from 10pm at night to 6am in the morning

Do not lie down immediately after taking medicine before sleeping

When battery is down to the LAST grid/bar,
do not answer the phone as the radiation is 1000 times

Forward this to those whom you
CARE about

Describe how to determine the height of a skyscraper with a barometer

The following concerns a question on a physics degree exam at the University of Copenhagen:

"Describe how to determine the height of a skyscraper with a barometer."

One student replied: "You tie a long piece of string to the neck of the barometer, then lower the barometer from the roof of the skyscraper to the ground. The length of the string plus the length of the barometer will equal the height of the building."

This highly original answer so incensed the examiner that the student was failed immediately. The student appealed on the grounds that his answer was indisputably correct, and the university appointed an independent arbiter to decide the case.

The arbiter judged that the answer was indeed correct, but did not display any noticeable knowledge of physics. To resolve the problem it was decided to call the student in and allow him six minutes in which to provide a verbal answer, which showed at least a minimal familiarity with the basic principles of physics.

For five minutes the student sat in silence, forehead creased in thought.

The arbiter reminded him that time was running out, to which the student replied that he had several extremely relevant answers, but couldn't make up his mind which to use.

On being advised to hurry up the student replied as follows:

"Firstly, you could take the barometer up to the roof of the skyscraper, drop it over the edge, and measure the time it takes to reach the ground. The height of the building can then be worked out from the formula H =0.5g x t squared. But bad luck on the barometer."

"Or if the sun is shining you could measure the height of the barometer, then set it on end and measure the length of its shadow. Then you measure the length of the skyscraper's shadow, and thereafter it is a simple matter of proportional arithmetic to work out the height of the skyscraper."

"But if you wanted to be highly scientific about it, you could tie a short piece of string to the barometer and swing it like a pendulum, first at ground level and then on the roof of the skyscraper. The height is worked out by the difference in the gravitational restoring force T = 2 pi sq. root (l/g)."

"Or if the skyscraper has an outside emergency staircase, it would be easier to walk up it and mark off the height of the skyscraper in barometer lengths, then add them up."

"If you merely wanted to be boring and orthodox about it, of course, you could use the barometer to measure the air pressure on the roof of the skyscraper and on the ground, and convert the difference in millibars into feet to give the height of the building."

"But since we are constantly being exhorted to exercise independence of mind and apply scientific methods, undoubtedly the best way would be to knock on the janitor's door and say to him 'If you would like a nice new barometer, I will give you this one if you tell me the height of this skyscraper'."

The student was Niels Bohr, the only Dane ever to win the Nobel Prize for Physics.


**************************************************************************************


I liked your little story.
Though, being a Dane, I was quite annoyed by the fact, that you in the end state that Niels Bohr is the only Dane ever to receive a Nobel prize in physics.
We have had many Nobel prize winners, and also more than Niels Bohr in physics. In 1975 Niels Bohr's son, Aage Bohr, and Ben Mottelson (an immigrant who became a Danish citizen in 1971) won the Nobel prize in physics.
Just to set the record straight :)
http://nobelprize.org/physics/laureates/1975/index.html
Morten Barklund

www.generationterrorists.com

Monday, May 5, 2008

Amy Bruce Chain Letter



Netlore Archive: The sad, untrue story of 7-year-old lung cancer victim Amy Bruce - another 'dying child' who doesn't really exist

Description: Email hoax
Circulating since: 1999
Status: False


Hi, my name is Amy Bruce. I am 7 years old, and I have severe lung cancer from second hand smoke. I also have a large tumor in my brain, from repeated beatings The doctors say I will die soon if this isn't fixed, and my family can't pay the bills. The Make A Wish Foundation, has agreed to donate 7 cents for every name on this list. For those of you who send this along, I thank you so much, but for those who don't send it, what goes around comes around. Have a Heart, please send this.


Comments: You know, you take one look at this absurd chain letter -- purportedly written by a 7-year-old who not only has severe lung cancer but is dying because of a brain tumor "from repeated beatings" -- and you naturally think: no one could possibly fall for this!

But as I review this text again in January 2007, the evidence to the contrary is all too plain -- people have been forwarding this message uncritically for eight years. Eight years! Appalling, but true.

The message claims that the Make-A-Wish Foundation will donate 7 cents for every time it's forwarded. But how would anyone know how many times it's been forwarded, or to whom? Has the foundation employed psychics? Has it gone back on its longstanding policy of not participating in chain letter campaigns?

For the benefit of those unfamiliar with how widespread this type of hoax is, here are a few previous examples from which the format for the "Amy Bruce" letter was cribbed:


Update: Variants of the Amy Bruce chain letter circulating since March 2006 include the photograph reproduced at right. It is not a picture of Amy Bruce, who doesn't exist. The actual identity of the child in the photo is unknown.

The key to Success...

This is a very good story
Hope somebody will get something out this

Once upon a time a very strong woodcutter asked for a job in a timber merchant, and he got it. His salary was really good and so were the working conditions. For that reason, the woodcutter was determined to do his best.

His boss gave him an axe and showed him the area where he was supposed to fell the trees.

The first day, the woodcutter brought 15 trees.

"Congratulations, " the boss said. "Carry on with your work!"

Highly motivated by the words of his boss, the woodcutter tried harder the next day, but he only could bring 10 trees. The third day he tried even harder, but he was only able to bring 7 trees. Day after day he was bringing less and less trees.

"I must be losing my strength", the woodcutter thought. He went to the boss and apologized, saying that he could not understand what was going on.

"When was the last time you sharpened your axe?" the boss asked.

"Sharpen? I had no time to sharpen my axe. I have been very busy trying to cut trees..."

Most of us NEVER update our skills. We think that whatever we have learned is very much enough. But good is not good when better is expected. Sharpening our skills from time to time is the key to success.

The key to Success...

Well this is a chain mail. i got this several times and but it has something really interesting
so I thought it is better to put this to blog..............

The Guide for all Men

WOMEN'S LANGUAGE TRANSLATED





Yes = No

No = Yes

Maybe = No

I'm sorry. = You'll be sorry.

We need... = I want

It's your decision = The correct decision should be obvious by now.

Do what you want... = You'll pay for this later.

We need to talk... = I need to complain.



Sure...go ahead = I don't want you to.

I'm not upset = Of course I'm upset, you moron!

You're so manly = You need a shave and you sweat a lot.

This kitchen is so inconvenient = I want a new house.

I want new curtains = ...and carpeting, and furniture, and wallpaper... ..

Hang the picture there = NO, I mean hang it there!

I heard a noise = I noticed you were almost asleep.

Do you love me? = I'm going to ask for something expensive.

How much do you love me? = I did something today you're really not
going to like.

I'll be ready in a minute = Kick off your shoes and find a good game on TV.

Am I fat? = Tell me I'm beautiful.

You have to learn to communicate. = Just agree with me.

Are you listening to me!? = Too late, you're dead.



Was that the baby? = Why don't you get out of bed and walk him until
he goes to sleep.

I'm not yelling! = Yes I am yelling because I think this is important.

Nothing = Everything

Nothing, really = It's just that you're such an idiot!

Help Burned Baby Alexandra Email - Charity Hoax

Summary:
Email claims that recipients can help pay the medical bills of 14 month old Alexandra, who received horrific burns in a house fire, simply by forwarding the message (Full commentary below.)


Status:
Alexandra is a real child and she was badly burned. However, the claim that money will be donated when the email is forwarded is completely false.



Dear All,

Alexandra came out of a rigging fire alive, but now has to fight for her life and a normal future.

She is 14 months old and she has burnt skin all over her body, damage facial bones (as a result of very high temperature). She does not have half of her face. She is in hospital in Cracow - Poland and one of the best specialist is looking after her. However she still has to go through many surgeries and then long rehab. Unfortunately her parents do not have any more money. Therefore we are asking for your help.

For each forwarded email her parents will get 3 cents. Please help them and forward that email to as many people as you can.



Commentary:
The core information in this email forward is true. According to information from a Polish news source, in June 2005 14-month-old Ola Kuczma of Poland was seriously injured in a fire in her parent's wooden house. The baby's bed was engulfed in flames and her hair began to burn. Thankfully, her parents were able to rescue the child at the last minute and doctors in Cracow managed to save her life. At the time of writing (October 2005) Ola is apparently making progress, but will need further medical treatment. Full recovery and rehabilitation is likely to be a long process.

The email identifies the child as "Alexandra". "Ola" is simply a Polish diminutive form of the first name "Aleksandra".

While the case is real, the claim that "3 cents" will be donated each time the email is forwarded is pure nonsense. In other words, some heartless individual has turned a genuine tragedy into a pointless hoax email that will most probably continue to circulate for months or years to come. Forwarding the email will do nothing to help little Ola or her family.

According to Filip Gralinski of Galeria Listow-Lancuszkow, the original version of the email was quite legitimate and included a bank account number that recipients could use in order to donate money to Ola's parents. He explains that in subsequent versions of the email, the legitimate bank account information was deleted and replaced with the absurd claim that Ola's parents will get 3 grosz (about 1 US cent) for each copy of the e-mail forwarded. Some versions of the message claim that scripts included in the email allow the donation system to work. This is completely untrue.

The legitimate bank account number was also given on Polish television and is still available on the TV station's website. Those with a genuine interest in helping Ola's parents may still be able to offer assistance via the information on the television website. However, forwarding the email in its current form will not help Ola's parents.

Most news references to Ola's situation are in Polish. However, Filip Gralinski has included some information about Ola in English on his website. Filip Gralinski greatly assisted me during the research of this article by translating information about Ola into English so that I could understand it.

Rachel Arlington Charity Hoax

Summary:
Email claims that AOL and Zdnet will donate money to help a child with brain cancer every time the email is forwarded (Full commentary below).


*****************************************************************************************


Subject: To My Child (dont delete ~ its being tracked)

Be sure and read to the bottom portion.....

Just for this morning, I am going to smile when I see your face and laugh when I feel like crying. Just for this morning, I will let you choose what you want to wear, and smile and say how perfect it is. Just for this morning, I am going to step over the laundry, and pick you up and take you to the park to play.

Just for this morning, I will leave the dishes in the sink, and let you teach me how to put that puzzle of yours together. Just for this afternoon, I will unplug the telephone and keep the computer off, and sit with you in the backyard and blow bubbles.

Just for this afternoon, I will not yell once, not even a tiny grumble when you scream and whine for the ice cream truck, and I will buy you one if he comes by. Just for this afternoon, I won't worry about what you are going to be when you grow up, or second guess every decision I have made where you are concerned. Just for this afternoon, I will let you help me bake cookies, and I won't stand over you trying to fix them.

Just for this afternoon, I will take us to McDonald's and buy us both a Happy Meal so you can have both toys. Just for this evening, I will hold you in my arms and tell you a story about how you were born and how much I love you. Just for this evening, I will let you splash in the tub and not get angry. Just for this evening, I will let you stay up late while we sit on he porch and count all the stars. Just for this evening, I will snuggle beside you for hours, and miss my favorite TV shows.

Just for this evening when I run my finger through your hair as you pray, I will simply be grateful that God has given me the greatest gift ever given. I will think about the mothers and fathers who are searching for their missing children, the mothers and fathers who are visiting their children's graves instead of their bedrooms, and mothers and fathers who are in hospital rooms watching their children suffer senselessly, and screaming inside that they can't handle it anymore. And when I kiss you good night I will hold you a little tighter, a little longer. It is then, that I will thank God for you, and ask him for nothing, except one more day.............

Hi.. I am a 29 year old father. Me and my wife have had a wonderful life together. God blessed us with a child too. Our daughter's name is Rachel, and she is 10 years old. Not long ago did the doctors detect brain cancer in her little body. There is only one way to save her and that isan operation. Sadly we don't have the money for the operation. AOL and Zdnet have agreed to help us. The only way they can help is this:

If you send this email to other people, AOL will track this email and count how many people get it.. Every person that opens this email and sends it to at least 3 people will give us 32c. Please help us.

George
Arlington.

**************************************************************************************



Commentary:
The Rachel Arlington hoax is just one of several malicious prank emails that claim a child or family will be helped financially if an email is forwarded. Versions of the hoax have been circulating since at least the year 2000. As with all emails that try to convince recipients that an email is being tracked, the claims in the message are nonsense. Even if a large company like AOL did agree to help the alleged "Rachel Arlington" it is absurd to suggest that this help would depend on the pointless, haphazard and erratic forwarding of an email. If a given company agreed to help, it would simply donate money directly or perhaps cover medical or other expenses. It certainly would not participate in some ridiculous scheme in which the final amount to be donated hinged upon how many times a particular message was forwarded.

The concept of individual emails being "tracked" as they journey through cyberspace is a common theme among hoax emails. In reality, there is simply no reliable method of tracking the progress of an individual email message and therefore no accurate method of calculating the final amount to be donated. The logistics of tracking an email that could ultimately be forwarded thousands of times are clearly problematical at best.

Moreover, tracking an email in the way described would raise important privacy issues and it is vastly unlikely that any ethical company would knowingly participate in such an activity.

There have been several variations of the Rachel Arlington hoax. The version included above tacks on a poem written by Sally Meyer. The poem was added to the hoax message without the permission of the author. The poem, titled "Just for this day" is available in its original context on Sally Meyer's website along with many other examples of her poetry.

In another version of the hoax, "Rachel" has been transformed into a ten-month-old baby instead of a ten year old. This version arrives as an image file complete with a picture of a baby wrapped in a blue ribbon.


Any message that claims that money will be donated just for forwarded an email is virtually assured to be a hoax. Forwarding such emails helps no one and serves only to waste bandwidth and clutter inboxes.












*************************************************************************************

An older version:

Hi I am a 29 year old father. Me and my wife have had a wonderful life together. God blessed us with a child too. Our daughter's name is Rachel, and she is 10 years old. Not long ago did the doctors detect brain cancer in her little body. There is only one way to save her: An operation. Sadly, we don't have enough money to pay the price. AOL and Zdnet have agreed to help us. The only way they can help us is this way: I send this email to you and you send it to other people. AOL will track this email and count how many people get it. EVERY PERSON THAT OPENS THIS EMAIL AND SENDS IT TO AT LEAST 3 PEOPLE will give us 32 cents. PLEASE HELP US.

George Arlington.

Thursday, May 1, 2008

New Optional Benchmarking Feature Available in Google Analytics

We are writing to let you know about a change in our service offerings. If you have logged into your account recently, you may have noticed that you can now choose to share your Google Analytics data. By providing data sharing options, we hope to provide you with transparency, control, and new services based on your preferences.

To learn more about data sharing settings, visit our FAQs: http://www.google.com/support/googleanalytics/bin/answer.py?answer=87515

We're also happy to announce industry benchmarking as the first new feature available to those who opt to share their data. Benchmarking lets you compare your metrics against industry verticals.

To enable this optional new feature, an administrator on your account will need to make the following selections on the Google Analytics data sharing settings page:

1. Log into your account. You'll see the yellow data sharing settings box on the Analytics Settings page.

2. Click the "More data sharing options" link within the yellow box.

3. Select the second checkbox to specify that you want to share your data "Anonymously with Google products and the benchmarking service". You can also choose to share your data "With Google products only" to take advantage of advanced Google advertising products and services as they become available.

The industry benchmarking feature is currently in beta. Once you have enabled benchmarking, it may take up to two weeks before the categorized, aggregated and anonymized benchmarking data shows up in your reports.

For more information on the benchmarking service, visit our FAQs: http://www.google.com/support/googleanalytics/bin/topic.py?topic=13909

In addition to the new benchmarking service, opting to share your data will also enable you to take advantage of new advanced Google products and services as they become available. We think these services will offer greater insight and sophistication to users who have opted to share their data. However, if you would prefer not to use these services, simply specify on the settings page that you don't want to share your data.


Sincerely,

The Google Analytics Team

Philosophy of the Stock Market

Once upon a time in a village, a man appeared who announced to the
villagers that he would buy monkeys for $10 each. The villagers seeing that
there were many monkeys went out in the forest and started catching them.

The man bought thousands at $10 and as supply started to diminish and the
villagers started to stop their efforts he announced that now he would buy
at $20. This renewed the efforts of the villagers and they started catching

monkeys again. Soon the supply diminished even further and people
started going back to their farms.

The offer rate increased to $25 and the supply of monkeys became so that
it was an effort to even see a monkey let alone catch it.

The man now announced that he would buy monkeys at $50! However,

since he had to go to the city on some business his assistant would now buy

on his behalf.

In the absence of the man, the assistant told the villagers. Look at all
these monkeys in the big cage that the man has collected. I will sell them
to you at $35 and when the man comes back, you can sell it to him for
$50.

The villager used up with all their savings to buy the monkeys.

Then they never saw the man nor his assistant, only monkeys everywhere!


PLEASE BE CAREFULL, BE KNOWLEDGFUL OF SHARE MONKEY BUYERS AND SELLERS.