Fwd: Mathematics !!!!

1 x 8 + 1 = 9
12 x 8 + 2 = 98
123 x 8 + 3 = 987
1234 x 8 + 4 = 9876
12345 x 8 + 5 = 98765
123456 x 8 + 6 = 987654
1234567 x 8 + 7 = 9876543
12345678 x 8 + 8 = 98765432
123456789 x 8 + 9 = 987654321

1 x 9 + 2 = 11
12 x 9 + 3 = 111
123 x 9 + 4 = 1111
1234 x 9 + 5 = 11111
12345 x 9 + 6 = 111111
123456 x 9 + 7 = 1111111
1234567 x 9 + 8 = 11111111
12345678 x 9 + 9 = 111111111
123456789 x 9 +10= 1111111111

9 x 9 + 7 = 88
98 x 9 + 6 = 888
987 x 9 + 5 = 8888
9876 x 9 + 4 = 88888
98765 x 9 + 3 = 888888
987654 x 9 + 2 = 8888888
9876543 x 9 + 1 = 88888888
98765432 x 9 + 0 = 888888888

Brilliant, isn't it?

And look at this symmetry:

1 x 1 = 1
11 x 11 = 121
111 x 111 = 12321
1111 x 1111 = 1234321
11111 x 11111 = 123454321
111111 x 111111 = 12345654321
1111111 x 1111111 = 1234567654321
11111111 x 11111111 = 123456787654321
111111111 x 111111111 = 12345678987654321



Now, take a look at this...


101%



From a strictly mathematical viewpoint:



What Equals 100%?
What does it mean to give MORE than 100%?

Ever wonder about those people who say they are giving more than 100%?

We have all been in situations where someone wants you to
GIVE OVER 100%.

How about ACHIEVING 101%?


What equals 100% in life?


Here's a little mathematical formula that might help
answer these questions:


If:

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Is represented as:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26.


If:


H-A-R-D-W-O- R- K

8+1+18+4+23+ 15+18+11 = 98%


And:

K-N-O-W-L-E- D-G-E

11+14+15+23+ 12+5+4+7+ 5 = 96%


But:

A-T-T-I-T-U- D-E

1+20+20+9+20+ 21+4+5 = 100%



THEN, look how far the love of God will take you:



L-O-V-E-O-F- G-O-D

12+15+22+5+15+ 6+7+15+4 = 101%


Therefore, one can conclude with mathematical certainty that:

While Hard Work and Knowledge will get you close, and Attitude will
get you there, It's the Love of God that will put you over the top!

Have a nice day

Posted at at 11:42 PM on Tuesday, April 6, 2010 by Posted by Ravindra Nikam | 0 comments   | Filed under:

Hello,

I'm trying to use the @Test(expected = RuntimeException.class) annotation in order to test for an expected exception. My code is as follows:


@Test(expected = RuntimeException.class)
public void testSaveThrowsRuntimeException(){

User user = domain.save(null);

}

and my save method simple like this :


public User save(User newUser) {
if(newUser == null) {
throw new RuntimeException();
}
//saving code goes here
}

after debugging the code I found that code throwing the exception as expected but its getting eaten somewhere in between in spring framework classes.

I tried the same with old way (try catch block) but still I am not able to catch that exception in test and test keeps throwing errors in runafter method of Junit :

org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1031)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.test.context.transaction.TransactionalTestExecutionListener$TransactionContext.endTransaction(TransactionalTestExecutionListener.java:504)
at org.springframework.test.context.transaction.TransactionalTestExecutionListener.endTransaction(TransactionalTestExecutionListener.java:277)
at org.springframework.test.context.transaction.TransactionalTestExecutionListener.afterTestMethod(TransactionalTestExecutionListener.java:170)
at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:344)
at org.springframework.test.context.junit4.SpringMethodRoadie.runAfters(SpringMethodRoadie.java:307)
at org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:338)
at org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
at org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
at org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:142)
at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: javax.transaction.RollbackException
at org.objectweb.jotm.TransactionImpl.commit(TransactionImpl.java:245)
at org.objectweb.jotm.Current.commit(Current.java:488)
at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1028)
... 23 more

And I am sure this is because of that RuntimeException I am throwing in save but not able catch it or pass the test with expected clause.

anybody have any idea whats going wrong?

Thanks in advance,

Posted at at 5:54 AM on Thursday, July 23, 2009 by Posted by Ravindra Nikam | 0 comments   | Filed under:

Love & Marriage

A student asks a teacher, "What is love?"
The teacher said, "in order to answer your question, go to the wheat field and choose the biggest wheat and come back.
But the rule is: you can go through them only once and cannot turn back to pick."
The student went to the field, go thru first row, he saw one big wheat, but he wonders....may be there is a bigger one later.
Then he saw another bigger one... but may be there is an even bigger one waiting for him.
Later, when he finished more than half of the wheat field, he start to realize that the wheat is not as big as the previous one he saw, he know he has missed the biggest one, and he regretted.
So, he ended up went back to the teacher with empty hand.
The teacher told him, "...this is love... you keep looking for a better one, but when later you realise, you have already miss the person....
What is marriage then?"
the student asked.The teacher said, "in order to answer your question, go to the corn field and choose the biggest corn and come back.But the rule is: you can go through them only once and cannot turn back to pick.The student went to the corn field, this time he is careful not to repeat the previous mistake, when he reach the middle of the field, he has picked one medium corn that he feel satisfy, and come back to the teacher.
The teacher told him, "this time you bring back a corn.... you look for one that is just nice, and you have faith and believe this is the best one you get.... this is marriage.

Posted at at 2:15 AM on Wednesday, April 22, 2009 by Posted by Ravindra Nikam | 0 comments   | Filed under: