<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7353270</id><updated>2012-01-17T17:01:27.845+05:30</updated><category term='others'/><category term='java'/><category term='personal'/><category term='web'/><category term='security'/><category term='puzzles'/><category term='performance'/><category term='physics'/><category term='social'/><category term='india'/><category term='j2ee'/><category term='architecture'/><category term='general'/><category term='oracle'/><title type='text'>Misc</title><subtitle type='html'>On Software and Science</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>95</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7353270.post-1906061348286034178</id><published>2011-08-11T16:56:00.004+05:30</published><updated>2011-08-11T17:05:36.531+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Ranking of Engineering branches in Kerala</title><content type='html'>Please refer previous post. This is also based on the 'lastRank'.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1. Aeronautical Engineering&lt;br /&gt;2. Mechanical Engineering&lt;br /&gt;3. Electronics and Communication&lt;br /&gt;4. Civil Engineering&lt;br /&gt;5. Electrical Engineering&lt;br /&gt;6. Computer Science&lt;br /&gt;7. Automobile Engineering&lt;br /&gt;8. Architecture Engineering&lt;br /&gt;9. Instrumentation&lt;br /&gt;10. Chemical&lt;br /&gt;11. Food Technology&lt;br /&gt;12. Bio Medical&lt;br /&gt;13. Printing Technology&lt;br /&gt;14. Production&lt;br /&gt;15. Bio Technology&lt;br /&gt;16. Information Technology&lt;br /&gt;17. Polymer Technology&lt;br /&gt;18. Industrial Engineering&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1906061348286034178?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1906061348286034178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1906061348286034178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1906061348286034178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1906061348286034178'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/08/ranking-of-engineering-branches-in.html' title='Ranking of Engineering branches in Kerala'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8353714581751864492</id><published>2011-08-10T23:02:00.003+05:30</published><updated>2011-08-11T10:47:33.168+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Ranking of Engineering Colleges in Kerala</title><content type='html'>This is an attempt to rank the Engineering colleges in Kerala. This is based on the demand for admission to various branches in 2010. This is calculated using the data of 'LastRank' (last rank who got admission to a specific branch in a specific college). Only Computer Science, Electronics and Electrical branches are considered for rank calculation (mainly as these are the most common branch across all colleges). Only the 'lastRank' for General category has been considered (assuming the demand pattern is similar in all categories).&lt;br /&gt;Note 1: Last rank data is available at &lt;a href="http://www.cee-kerala.org/docs/keam2010/allot/lastrank2010.pdf"&gt;http://www.cee-kerala.org/docs/keam2010/allot/lastrank2010.pdf&lt;/a&gt; .&lt;br /&gt;Note 2: List of Engineering colleges is available at &lt;a href="http://cee.kerala.gov.in/collegelist/main/frame.html"&gt;http://cee.kerala.gov.in/collegelist/main/frame.html&lt;/a&gt; (click on 'Engineering' ).&lt;br /&gt;Note 3: NIT Calicut is not included in this list as the admission is not based on the Kerala entrance and hence a rank calculation based on 'last rank' is not possible.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;1. COLLEGE OF ENGINEERING TRIVANDRUM ( TVE )&lt;br /&gt;2. GOVT. ENGINEERING COLLEGE,THRISSUR ( TCR )&lt;br /&gt;3. T K M COLLEGE OF ENGINEERING, KOLLAM ( TKM )&lt;br /&gt;4. MODEL ENGINEERING COLLEGE, THRIKKAKKARA, ERNAKULAM ( MDL ) [Govt Self Finance]&lt;br /&gt;5. M A COLLEGE OF ENGINEERING, KOTHAMANGALAM ( MAC )&lt;br /&gt;6. GOVT. RAJIV GANDHI INSTITUTE OF TECH., KOTTAYAM ( KTE )&lt;br /&gt;7. GOVT. ENGINEERING COLLEGE BARTON HILL, TVM ( TRV )&lt;br /&gt;8. S C T COLLEGE OF ENGINEERING, PAPPANAMCODE, TVM ( SCT ) [Govt Self Finance]&lt;br /&gt;9. ENGINEERING COLLEGE, IDUKKI ( IDK )&lt;br /&gt;10. GOVT. ENGINEERING COLLEGE, WAYANAD ( WYD )&lt;br /&gt;11. N S S COLLEGE OF ENGINEERING, PALAKKAD ( NSS )&lt;br /&gt;12. GOVT. COLLEGE OF ENGINEERING, KANNUR ( KNR )&lt;br /&gt;13. SCMS SCHOOL OF ENGINEERING AND TECHNOLOGY ( SCM ) [Private]&lt;br /&gt;14. GOVT. ENGINEERING COLLEGE, SREEKRISHNAPURAM, PALAKKAD ( PKD )&lt;br /&gt;15. COLLEGE OF ENGINEERING, CHENGANNUR, ALAPPUZHA. ( CHN )&lt;br /&gt;16. FEDERAL INSTITUTE OF SCIENCE AND TECHNOLOGY ( FIT ) [Private]&lt;br /&gt;17. LBS INSTITUTE OF TECH. FOR WOMEN, POOJAPURA, TVM ( LBT ) [Govt Self Finance]&lt;br /&gt;18. VIDYA ACADEMY OF SCIENCE AND TECHNOLOGY ( VAS )&lt;br /&gt;19. SAINTGITS COLLEGE OF ENGINEERING, PATHAMUTTOM, KOTTAYAM ( MGP )&lt;br /&gt;20. ADI SHANKARA INSTITUTE OF ENGINEERING AND TECH ( ASI )&lt;br /&gt;21. MOHANDAS COLLEGE OF ENGINEERING AND TECHNOLOGY ( MCT )&lt;br /&gt;22. M E S COLLEGE OF ENGINEERING, KUTTIPPURAM. ( MES )&lt;br /&gt;23. TOC H INSTITUTE OF SCIENCE AND TECHNOLOGY ( TOC )&lt;br /&gt;24. UNIVERSITY COLLEGE OF ENGINEERING, KARIAVATTOM, TVM ( UCK )&lt;br /&gt;25. COLLEGE OF ENGINEERING, KIDANGOOR ( KGR )&lt;br /&gt;26. COLLEGE OF ENGINEERING, ADOOR ( ADR )&lt;br /&gt;27. COLLEGE OF ENGINEERING, THALASSERY, KANNUR. ( TLY )&lt;br /&gt;28. COLLEGE OF ENGINEERING PERUMON, KOLLAM ( PRN )&lt;br /&gt;29. COLLEGE OF ENGINEERING, THRIKARIPPUR, KASARAGOD. ( TKR )&lt;br /&gt;30. UNIVERSITY COLLEGE OF ENGINEERING,THODUPUZHA ( UCE )&lt;br /&gt;31. I E S COLLEGE OF ENGINEERING, CHITTILAPPILLY, THRISSUR. ( IES )&lt;br /&gt;32. NEHRU COLLEGE OF ENGINEERING AND RESEARCH CENTRE ( NCE )&lt;br /&gt;33. SREE NARAYANA GURUKULAM COLLEGE OF ENGINEERING, KOLENCHERRY, KADAYIRUPPU P O, ERNAKULAM. ( SNG )&lt;br /&gt;34. COLLEGE OF ENGINEERING, CHERTHALA, PALLIPPURAM, ALAPPUZHA. ( CEC )&lt;br /&gt;35. CALICUT UNIVERSITY INSTITUTE OF ENGG AND TECH ( UCC )&lt;br /&gt;36. COLLEGE OF ENGINEERING, KALLOOPPARA, PATHANAMTHITTA. ( PTA )&lt;br /&gt;37. LBS COLLEGE OF ENGINEERING, KASARAGOD ( KSD )&lt;br /&gt;38. K M E A ENGINEERING COLLEGE, EDATHALA, ALWAYE. ( KME )&lt;br /&gt;39. P.A.AZIZ COLLEGE OF ENGINEERING AND TECHNOLGY ( PAA )&lt;br /&gt;40. ILAHIA COLLEGE OF ENGINEERING TECH., MULAVOOR, MOOVATTUPUZHA, ERNAKULAM. ( ICE )&lt;br /&gt;41. CO-OPERATIVE INSTITUTE OF TECH.,VADAKARA, KOZHIKODE. ( VDA )&lt;br /&gt;42. AWH ENGINEERING COLLEGE, KOZHIKKODE ( AWH )&lt;br /&gt;43. COLLEGE OF ENGINEERING, ATTINGAL, THIRUVANANTHAPURAM. ( CEA )&lt;br /&gt;44. SNM INSTITUTE OF MANAGEMENT AND TECHNOLOGY ( SNM )&lt;br /&gt;45. SREE BUDDHA COLLEGE OF ENGINEERING, PATTOOR, PATTOOR. P O, PADANILAM, NOORANAD, ALAPPUZHA. ( SBC )&lt;br /&gt;46. JAWAHARLAL COLLEGE OF ENGINEERING AND TECHNOLOGY ( JCE )&lt;br /&gt;47. COLLEGE OF ENGINEERING, KARUNAGAPPALLY, KOLLAM. ( KNP )&lt;br /&gt;48. YOUNUS COLLEGE OF ENGINEERING AND TECHNOLOGY ( YCE )&lt;br /&gt;49. METS SCHOOL OF ENGINEERING, MALA ( MET )&lt;br /&gt;50. COLLEGE OF ENGINEERING, MUNNAR ( MNR )&lt;br /&gt;51. COLLEGE OF ENGINEERING, POONJAR, KOTTAYAM. ( PJR )&lt;br /&gt;52. THEJUS ENGINEERING COLLEGE ( TJE )&lt;br /&gt;53. ROYAL COLLEGE OF ENGINEERING AND TECHNOLOGY ( RCE )&lt;br /&gt;54. SREE NARAYANA GURU COLLEGE OF ENGINEERING AND TECH ( SNC )&lt;br /&gt;55. CAARMEL ENGINEERING COLLEGE ( CML )&lt;br /&gt;56. M E A ENGINEERING COLLEGE, PERINTHALMANNA, VENGOOR ( MEA )&lt;br /&gt;57. MAR BASELIOS INSTITUTE OF TECHNOLOGY AND SCIENCE ( MBI )&lt;br /&gt;58. SARABHAI INSTITUTE OF SCIENCE AND TECHNOLOGY ( SIT )&lt;br /&gt;59. T K M INSTITUTE OF TECHNOLOGY, EZHUKONE, KOLLAM ( TKI )&lt;br /&gt;60. KMCT COLLEGE OF ENGINEERING, MUKKOM, MANASSERY, K ( KMC )&lt;br /&gt;61. MAR BASELIOS CHRISTIAN COLLEGE OF ENGG AND TECH ( MBC )&lt;br /&gt;62. MANGALAM COLLEGE OF ENGINEERING, ETTUMANOOR, KOTTAYAM ( MLM )&lt;br /&gt;63. MALABAR COLLEGE OF ENGINEERING AND TECHNOLOGY ( MEC )&lt;br /&gt;64. MATHA COLLEGE OF TECHNOLOGY, MANAKAPPADI, NORTH PRAVUR, ERNAKULAM ( MTA )&lt;br /&gt;65. RAJADHANI INSTITUTE OF ENGINEERING AND TECHNOLOGY ( RIE )&lt;br /&gt;66. SRI VELLAPPALLY NATESAN COLLEGE OF ENGINEERING ( VPE )&lt;br /&gt;67. MARY MATHA COLLEGE OF ENGINEERING AND TECHNOLOGY ( MMO )&lt;br /&gt;68. SREEPATHY INSTITUTE OF MANAGEMENT AND TECHNOLOGY ( SPT )&lt;br /&gt;69. PANKAJAKASTURI COLLEGE OF ENGINEERING AND TECHNOLOGY ( PKE )&lt;br /&gt;70. AL-AMEEN ENGINEERING COLLEGE ( AAP )&lt;br /&gt;71. JAI BHARATH COLLEGE OF MANAGEMENT AND ENGINEERING ( JBT )&lt;br /&gt;72. MUSALIAR COLLEGE OF ENGINEERING AND TECHNOLOGY ( MCK )&lt;br /&gt;73. BASELIOS MATHEWS II COLLEGE OF ENGG., SASTHAMCOTTA, KOLLAM ( BMC )&lt;br /&gt;74. COLLEGE OF ENGINEERING AND MANAGEMENT PUNNNAPRA ( PRP )&lt;br /&gt;75. MES INSTITUTE OF TECHNOLOGY AND MANAGEMENT ( MEK )&lt;br /&gt;76. JOHN COX MEMORIAL C S I INSTITUTE OF TECHNOLOGY ( JIT )&lt;br /&gt;77. MUSLIM ASSOCIATION COLLEGE OF ENGINEERING, VENJARAMOODU, THIRUVANANTHAPURAM. ( MUS )&lt;br /&gt;78. M G COLLEGE OF ENGINEERING, THIRUVALLM, THIRUVANANTHAPURAM. ( MGC )&lt;br /&gt;79. INDIRA GANDHI INSTITUTE OF ENGINEERING AND TECHNOLOGY ( IGW )&lt;br /&gt;80. KMCT COLLEGE OF ENGINEERING FOR WOMEN ( KMW )&lt;br /&gt;81. COLLEGE OF ENGINEERING, KOTTARAKKARA, KOLLAM. ( CEK )&lt;br /&gt;82. VALIA KOONAMBAIKULATHAMMA COLLEGE OF ENGG AND TECH ( VKE )&lt;br /&gt;83. PALAKKAD INSTITUTE OF SCIENCE AND TECHNOLOGY ( PIT )&lt;br /&gt;84. ARCHANA COLLEGE OF ENGINEERING ( ACE )&lt;br /&gt;85. VEDA VYASA INSTITUTE OF TECHNOLOGY, PONNEMPADAM P O, KARADPARAMBA, MALAPPURAM. ( VVT )&lt;br /&gt;86. TRAVANCORE ENGINEERING COLLEGE, OYOOR, KOLLAM ( TEC )&lt;br /&gt;87. K R GOURI AMMA COLLEGE OF ENGINEERING FOR WOMEN ( GWE )&lt;br /&gt;88. UKF COLLEGE OF ENGINEERING AND TECHNOLOGY ( UKP )&lt;br /&gt;89. MOUNT ZION COLLEGE OF ENGG., PATHANAMTHITTA ( MZC )&lt;br /&gt;90. HINDUSTAN COLLEGE OF ENGINEERING, ARIPPA, CHOZHIYAKODE P.O., KULATHUPUZHA ( HKE )&lt;br /&gt;91. SHAHUL HAMEED MEMORIAL ENGINEERING COLLEGE, KADAKKAL, KOLLAM ( SHM )&lt;br /&gt;92. SREE BUDDHA COLLEGE OF ENGINEERING FOR WOMEN, AYATHIL, ELAVUMTHITTA, PATHANAMTHITTA ( SBW )&lt;br /&gt;93. PRIME COLLEGE OF ENGINEERING FOR WOMEN ( PCE )&lt;br /&gt;94. AXIS COLLEGE OF ENGINEERING AND TECHNOLOGY ( AXE )&lt;br /&gt;95. MOUNT ZION COLLEGE OF ENGINEERING FOR WOMEN ( MZW )&lt;br /&gt;96. YOUNUS COLLEGE OF ENGINEERING FOR WOMEN, THALACHIRA P O, KOTTARAKKARA, KOLLAM. ( YCW )&lt;br /&gt;97. HEERA COLLEGE OF ENGINEERING AND TECHNOLOGY ( HCE )&lt;br /&gt;98. AMMINI COLLEGE OF ENGINEERING ( AME )&lt;br /&gt;99. ST. THOMAS INSTITUTE FOR SCIENCE AND TECHNOLOGY ( STI )&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8353714581751864492?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8353714581751864492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8353714581751864492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8353714581751864492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8353714581751864492'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/08/ranking-of-engineering-colleges-in.html' title='Ranking of Engineering Colleges in Kerala'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7823193267073987345</id><published>2011-05-02T19:28:00.010+05:30</published><updated>2011-05-03T20:10:07.113+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>JDB - Debugging Concurrency issues in Java</title><content type='html'>Typically debugging concurrency issues using debugger is very difficult as it manifests only when multiple requests are processed concurrently. Also in a debugger tracking multiple threads is further difficult.&lt;br /&gt;JDB is a free command line tool for Java. Please refer to my previous post for details about JDB ( &lt;a href="http://rejeev.blogspot.com/2011/04/jdb-command-line-debugger-for-java.html"&gt;http://rejeev.blogspot.com/2011/04/jdb-command-line-debugger-for-java.html&lt;/a&gt; ). We can debug concurrency issues much easily using JDB.&lt;br /&gt;Typically concurrency issues are due to updation (or updaton and read) of a shared variable from two threads. Typically the challenge will be to identify which thread update the variable at which code segment. We can use JDB to identify that.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;run the application with debug enabled&lt;/li&gt;&lt;br /&gt;&lt;li&gt;attach JDB to the application.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;set 'watch' on the variable at the suspect variable.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;set a 'monitor where all' to print the stack trace whenever the variable is accessed.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;'run' the application.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;'run' each time the application pauses at modification of the watch point.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Now whenever the application is modifying the variable, thread dump shall be printed. From the thread dump we will be able to identify which thread modifies the variable and at code segment.&lt;br /&gt;&lt;h3&gt;Let us see an example now&lt;/h3&gt;&lt;br /&gt;Given below is a very simple example where a variable is shared between two threads and by the time, the thread 'main' prints out the value of the shared variable, the value has been modified by the other thread.&lt;br /&gt;As this program is only few lines of code it is very trivial to go through the code and understand that the second thread is updating the variable at code Main2 (line:11). In a real application the shared variable may be updated from too many places with too many code paths to that. Eventhough you know that some thread updates the shared variable, it is very difficult to identify which thread updates from which code. JDB will help us to identify that.&lt;br /&gt;&lt;h3&gt;Let us see how do we identify that&lt;/h3&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Main2 extends Thread {&lt;br /&gt; public static int count;&lt;br /&gt; public static void main(String[] args) throws Exception {&lt;br /&gt;  new Main2().start();&lt;br /&gt;  count = 5;&lt;br /&gt;  Thread.sleep(10);&lt;br /&gt;  System.out.println("value: " + count);&lt;br /&gt; }&lt;br /&gt; public void run(){&lt;br /&gt;  try{ Thread.sleep(5); }catch(Exception e){}&lt;br /&gt;  count = 10;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now compile the code&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;javac -g Main2.java&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now run the program with debug enabled&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;java -cp . -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=y Main2&lt;br /&gt;Listening for transport dt_socket at address: 8000&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now attach the debugger&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;jdb -sourcepath . -attach 8000&lt;br /&gt;Set uncaught java.lang.Throwable&lt;br /&gt;Set deferred uncaught java.lang.Throwable&lt;br /&gt;Initializing jdb ...&lt;br /&gt;&lt;br /&gt;VM Started: No frames on the current call stack&lt;br /&gt;main[1]&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now set 'watch' on the shared variable count. This means whenever the variable 'count' is modified, program will stop execution (as if there is a break point).&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;watch Main2.count&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now set 'monitor where all'. This means that whenever the program stops (due to a breakpoint or watch) 'where all' command (thread dump) shall be executed.&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;monitor where all&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now let us start execution by giving the command 'run'. We will get the first thread dump when the varible count is modified first time.&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;run&lt;br /&gt;&gt; Set deferred watch modification of Main2.count&lt;br /&gt;&lt;br /&gt;Field (Main2.count) is 0, will be 5: "thread=main", Main2.main(), line=5 bci=11&lt;br /&gt;&lt;br /&gt;Signal Dispatcher:&lt;br /&gt;Finalizer:&lt;br /&gt;  [1] java.lang.Object.wait (native method)&lt;br /&gt;  [2] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:118)&lt;br /&gt;  [3] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:134)&lt;br /&gt;  [4] java.lang.ref.Finalizer$FinalizerThread.run (Finalizer.java:159)&lt;br /&gt;Reference Handler:&lt;br /&gt;  [1] java.lang.Object.wait (native method)&lt;br /&gt;  [2] java.lang.Object.wait (Object.java:485)&lt;br /&gt;  [3] java.lang.ref.Reference$ReferenceHandler.run (Reference.java:116)&lt;br /&gt;main:&lt;br /&gt;  [1] Main2.main (Main2.java:5)&lt;br /&gt;Thread-2:&lt;br /&gt;  [1] Main2.run (Main2.java:10)&lt;br /&gt;main[1]&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;'main[1]' as the command prompt indicates that current thread is 'main[1]'. First line of the thread 'main[1]' is Main2.java:5. That means the current line of code is at Main2.java:5.&lt;br /&gt;run 'list' to see the current see the code at line number Main2.java:5&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;list&lt;br /&gt;1    public class Main2 extends Thread {&lt;br /&gt;2     public static int count;&lt;br /&gt;3     public static void main(String[] args) throws Exception {&lt;br /&gt;4      new Main2().start();&lt;br /&gt;5 =&gt;   count = 5;&lt;br /&gt;6      Thread.sleep(10);&lt;br /&gt;7      System.out.println("value: " + count);&lt;br /&gt;8     }&lt;br /&gt;9     public void run(){&lt;br /&gt;10      try{ Thread.sleep(5); }catch(Exception e){}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Now resume execution again from there using 'run'. Now we get the thread dump again when the variable 'count' is modified.&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;run&lt;br /&gt;Field (Main2.count) is 5, will be 10: "thread=Thread-2", Main2.run(), line=11 bci=12&lt;br /&gt;11      count = 10;&lt;br /&gt;&lt;br /&gt;Signal Dispatcher:&lt;br /&gt;Finalizer:&lt;br /&gt;  [1] java.lang.Object.wait (native method)&lt;br /&gt;  [2] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:118)&lt;br /&gt;  [3] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:134)&lt;br /&gt;  [4] java.lang.ref.Finalizer$FinalizerThread.run (Finalizer.java:159)&lt;br /&gt;Reference Handler:&lt;br /&gt;  [1] java.lang.Object.wait (native method)&lt;br /&gt;  [2] java.lang.Object.wait (Object.java:485)&lt;br /&gt;  [3] java.lang.ref.Reference$ReferenceHandler.run (Reference.java:116)&lt;br /&gt;main:&lt;br /&gt;  [1] java.lang.Thread.sleep (native method)&lt;br /&gt;  [2] Main2.main (Main2.java:6)&lt;br /&gt;Thread-2:&lt;br /&gt;  [1] Main2.run (Main2.java:11)&lt;br /&gt;Thread-2[1]&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Now current thread of execution is Thread-2 and current line of code is Main2.java:11.&lt;br /&gt;To see the line of code at Main2.java:11&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt; list&lt;br /&gt;7      System.out.println("value: " + count);&lt;br /&gt;8     }&lt;br /&gt;9     public void run(){&lt;br /&gt;10      try{ Thread.sleep(5); }catch(Exception e){}&lt;br /&gt;11 =&gt;   count = 10;&lt;br /&gt;12     }&lt;br /&gt;13    }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;This time 'count' is modified by the second thread. From this it can identified that 'Thread 2' is modifying the variable 'count' at Main2(line:11). Also the code path to this operation also can be infered from the thread dump.&lt;br /&gt;Hence the culprit here is 'Thread-2' and code segment 'Main2.java:11' and the execution path as explained in the stack of Thread-2 in the thread dump.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7823193267073987345?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7823193267073987345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7823193267073987345' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7823193267073987345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7823193267073987345'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/05/jdb-debugging-concurrency-issues-in.html' title='JDB - Debugging Concurrency issues in Java'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1216938996547158189</id><published>2011-04-19T09:43:00.009+05:30</published><updated>2011-04-19T11:23:38.234+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>JDB - Command line debugger for Java</title><content type='html'>&lt;h3&gt;Introduction&lt;/h3&gt;&lt;br /&gt;Debugger is an unavoidable tool in any Java developer’s toolkit. A Debugger helps when the application/module/function behaviors different than that of developers expectation. Typically developer will first try to understand difference in behavior by glancing through the code quickly. If he still not able to understand the reason for the unexpected behavior; next step would be step through the program execution using a debugger. I assume readers are familiar with the normal debugging procedures. If not please go through the appendix.&lt;br /&gt;Most of the current debuggers are GUI based (either integrated with IDEs (IntelliJ, Eclipse) or stand alone debuggers (Yourkit).&lt;br /&gt;However GUI based debuggers are not very useful when the application is running on a remote machine, especially when the connectivity between the machine where appication is running and the machine where debugger is running is poor.&lt;br /&gt;In such scenarios a command line debugger which is also running on the same box as the application is running would be useful.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;h3&gt;&lt;span&gt;JDB – a free command line debugger&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;JDB is a free command line debugger. JDB is part of JDK and is supported by Sun JDK on various Operating systems like Windows, Linux, Solaris and Mac OS x.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to use&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;We need to run the application with ‘debug enabled’. You need to provide the following JVM arguments ‘-Xdebug –Xrunjdwp:transport=st_socket,server=y,address=8000,suspend=y’ to start the application in debug mode. Please refer to http://download.oracle.com/javase/1.5.0/docs/guide/jpda/conninv.html#Invocation for further details.&lt;/li&gt;&lt;li&gt;Application should be compiled with –g option.&lt;/li&gt;&lt;li&gt;Attach JDB to the application ‘jdb –attach 8000’&lt;/li&gt;&lt;li&gt;You can see the list commands by typing ‘help’&lt;/li&gt;&lt;li&gt;Set breakpoint at some significant point using ‘stop at &lt;classname&gt;:&lt;line no=""&gt;’&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;Navigate through the code step by step using ‘step’ and ‘next’ and other commands.&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;/ol&gt;&lt;classname&gt;&lt;line no=""&gt;Given below are a list of important commands&lt;br /&gt;&lt;/line&gt;&lt;/classname&gt;&lt;ol style="font-family: times new roman;"&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;stop at&lt;/span&gt; &lt;classname&gt;:&lt;line no=""&gt; - to set breakpoint&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;run&lt;/span&gt; – to start execution or resume from a breakpoint&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;locals&lt;/span&gt; – list values of local variables&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;dump this&lt;/span&gt; – list variables of the instance ‘this’&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;where all&lt;/span&gt; – to see the thread dump&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;list&lt;/span&gt; – to see current code&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;step&lt;/span&gt; – execute one line (if it is function step into the function)&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;next&lt;/span&gt; – execute one line (if it is a function step over the function)&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;li&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;span style="font-family: courier new;"&gt;help&lt;/span&gt; – print list of available commands with description&lt;/line&gt;&lt;/classname&gt;&lt;/line&gt;&lt;/classname&gt;&lt;/li&gt;&lt;/ol&gt;&lt;classname&gt;&lt;line no=""&gt;&lt;classname&gt;&lt;line no=""&gt;To see the complete list of commands type ‘help’ command.&lt;br /&gt;Let us see an example to illustrate this further.&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;h3&gt;&lt;span&gt;Example – Debugging Jackson (JSON processing tool)&lt;/span&gt;&lt;/h3&gt;&lt;br /&gt;Jackson is tool for parsing JSON (from JSON to object and Object to JSON parsing).&lt;br /&gt;You can download Jackson source from http://jackson.codehaus.org/1.7.6/jackson-src-1.7.6.zip&lt;br /&gt;Unzip the contents to any convenient location (&lt;jackson_dir&gt;. Build the source using ‘ant’.&lt;br /&gt;ant jars&lt;br /&gt;All packages shall be generated as &lt;jackson_dir&gt;/build. We need jackson-mapper-asl-1.7.6.jar and jackson-core-asl-1.7.6.jar&lt;br /&gt;Given below is a small code which converts a Java object to JSON string.&lt;br /&gt;We will navigate through the Jackson processing using debugger.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import org.codehaus.jackson.map.ObjectMapper;&lt;br /&gt;public class Main {&lt;br /&gt;  public static void main(String[] args) throws Exception {&lt;br /&gt;      System.out.println("entering the program....");&lt;br /&gt;      MyEntity obj = new MyEntity();&lt;br /&gt;      obj.setId(1);&lt;br /&gt;      obj.setName("rejeev");&lt;br /&gt;      obj.setAddress("c-48, sree nagar");&lt;br /&gt;      ObjectMapper mapper = new ObjectMapper();&lt;br /&gt;      String json = mapper.writeValueAsString(obj);&lt;br /&gt;      System.out.println("json: " + json);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class MyEntity {&lt;br /&gt;  private int id;&lt;br /&gt;  private String name;&lt;br /&gt;  private int age;&lt;br /&gt;  private String address;&lt;br /&gt;  public int getId() {&lt;br /&gt;      return id;&lt;br /&gt;  }&lt;br /&gt;  public void setId(int id) {&lt;br /&gt;      this.id = id;&lt;br /&gt;  }&lt;br /&gt;  public String getName() {&lt;br /&gt;      return name;&lt;br /&gt;  }&lt;br /&gt;  public void setName(String name) {&lt;br /&gt;      this.name = name;&lt;br /&gt;  }&lt;br /&gt;  public int getAge() {&lt;br /&gt;      return age;&lt;br /&gt;  }&lt;br /&gt;  public void setAge(int age) {&lt;br /&gt;      this.age = age;&lt;br /&gt;  }&lt;br /&gt;  public String getAddress() {&lt;br /&gt;      return address;&lt;br /&gt;  }&lt;br /&gt;  public void setAddress(String address) {&lt;br /&gt;      this.address = address;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Save this code at &lt;jackson_dir&gt;&lt;br /&gt;Compile the classes:&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;javac –g –cp ./build/jackson-mapper-asl-1.7.6.jar:./build/jackson-core-asl-1.7.6.jar:. –d . MyEntity.java Main.java&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Run the application in debug mode.&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;java –Xbebug –Xrunjdwp:transport =st_socket,server=y,address=8000,suspend=y –cp ./build/Jackson-mapper-asl-1.7.6.jar:./build/Jackson-core-asl-1.7.6.jar:. Main&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You will get the following output:&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;Listening for transport dt_socket at address: 8000&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;As the option ‘suspend=y’ is specified, the JVM is just started. Method exectution is not yet started. When we trigger ‘run’ command from debugger exectution will start.&lt;br /&gt;&lt;br /&gt;Attach debugger to the application&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;jdb –sourcepath &lt;jackson_dir&gt;:&lt;jackson_dir&gt;/src/mapper/java –attach 8000&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You will get the following output:&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;Set uncaught java.lang.Throwable&lt;br /&gt;Set deferred uncaught java.lang.Throwable&lt;br /&gt;Initializing jdb ...&lt;br /&gt;&amp;gt;&lt;br /&gt;VM Started: No frames on the current call stack&lt;br /&gt;main[1]&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To start the execution run the command ‘step’&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;main[1] step&lt;br /&gt;&amp;gt;&lt;br /&gt;Step completed: "thread=main", Main.main(), line=4 bci=0&lt;br /&gt;4            System.out.println("entering the program....");&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now program is at the first line of the function ‘main’&lt;br /&gt;Let us see the code around the current line of execution.&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] list&lt;br /&gt;1    import org.codehaus.jackson.map.ObjectMapper;&lt;br /&gt;2    public class Main {&lt;br /&gt;3        public static void main(String[] args) throws Exception {&lt;br /&gt;4 =&amp;gt;         System.out.println("entering the program....");&lt;br /&gt;5            MyEntity obj = new MyEntity();&lt;br /&gt;6            obj.setId(1);&lt;br /&gt;7            obj.setName("rejeev");&lt;br /&gt;8            obj.setAddress("c-48, sree nagar");&lt;br /&gt;9            ObjectMapper mapper = new ObjectMapper();&lt;br /&gt;10            String json = mapper.writeValueAsString(obj);&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The arrow indicates the current line of execution.&lt;br /&gt;Open the java source files (Main, MyEntity and Jackson source files) in a TextEditor or IDE.&lt;br /&gt;Let us start from Main. Main:10 is the line which parse object to JSON string.&lt;br /&gt;Let us set breakpoint at Main:10&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;main[1] stop at Main:10&lt;br /&gt;Set breakpoint Main:10&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To move the execution from the current line to next breakpoint (line 10)&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;main[1]&lt;br /&gt;main[1] run&lt;br /&gt;Breakpoint hit: "thread=main", Main.main(), line=10 bci=41&lt;br /&gt;10            String json = mapper.writeValueAsString(obj);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To see the code around current line&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] list&lt;br /&gt;6            obj.setId(1);&lt;br /&gt;7            obj.setName("rejeev");&lt;br /&gt;8            obj.setAddress("c-48, sree nagar");&lt;br /&gt;9            ObjectMapper mapper = new ObjectMapper();&lt;br /&gt;10 =&amp;gt;         String json = mapper.writeValueAsString(obj);&lt;br /&gt;11            System.out.println("json: " + json);&lt;br /&gt;12        }&lt;br /&gt;13    }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;We can see all local variables using ‘locals’&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;main[1] locals&lt;br /&gt;Method arguments:&lt;br /&gt;args = instance of java.lang.String[0] (id=867)&lt;br /&gt;Local variables:&lt;br /&gt;obj = instance of MyEntity(id=868)&lt;br /&gt;mapper = instance of org.codehaus.jackson.map.ObjectMapper(id=869)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now we can inspect the content of any object. Let us inspect ‘obj’.&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] dump obj&lt;br /&gt;obj = {&lt;br /&gt;  id: 1&lt;br /&gt;  name: "rejeev"&lt;br /&gt;  age: 0&lt;br /&gt;  address: "c-48, sree nagar"&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Now let us step into ‘writeValueAsString’ using the command ‘step’&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;main[1] step&lt;br /&gt;&amp;gt;&lt;br /&gt;Step completed: "thread=main", org.codehaus.jackson.map.ObjectMapper.writeValueAsString(), line=1,595 bci=0&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now see the current code again using the command ‘list’&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] list&lt;br /&gt;1,591        public String writeValueAsString(Object value)&lt;br /&gt;1,592            throws IOException, JsonGenerationException, JsonMappingException&lt;br /&gt;1,593        {      &lt;br /&gt;1,594            // alas, we have to pull the recycler directly here...&lt;br /&gt;1,595 =&amp;gt;         SegmentedStringWriter sw = new SegmentedStringWriter(_jsonFactory._getBufferRecycler());&lt;br /&gt;1,596            _configAndWriteValue(_jsonFactory.createJsonGenerator(sw), value);&lt;br /&gt;1,597            return sw.getAndClear();&lt;br /&gt;1,598        }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Let us go to the next line using the command ‘next’ and from line 1596, let us step into the function ‘_configAndWriteValue’&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] step&lt;br /&gt;&amp;gt;&lt;br /&gt;Step completed: "thread=main", org.codehaus.jackson.JsonFactory.createJsonGenerator(), line=489 bci=0&lt;br /&gt;489            IOContext ctxt = _createContext(out, false);&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Instead of stepping into _configAndWriteValue, we are now in JsonFactory.createGenerator. This is because first method parameters are calculated. To get into _configAndWriteValue, let us get out of createJsonGenerator using step up.&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] step up&lt;br /&gt;&amp;gt;&lt;br /&gt;Step completed: "thread=main", org.codehaus.jackson.map.ObjectMapper.writeValueAsString(), line=1,596 bci=24&lt;br /&gt;1,596            _configAndWriteValue(_jsonFactory.createJsonGenerator(sw), value);&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Now we are back at line no: 1596. Let us invoke step again.&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] step&lt;br /&gt;&amp;gt;&lt;br /&gt;Step completed: "thread=main", org.codehaus.jackson.map.ObjectMapper._configAndWriteValue(), line=1,982 bci=0&lt;br /&gt;1,982            SerializationConfig cfg = copySerializationConfig();&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Let us see the code around this&lt;br /&gt;&lt;div class="shell"&gt;&lt;pre&gt;&lt;br /&gt;main[1] list&lt;br /&gt;1,978         */&lt;br /&gt;1,979        protected final void _configAndWriteValue(JsonGenerator jgen, Object value)&lt;br /&gt;1,980            throws IOException, JsonGenerationException, JsonMappingException&lt;br /&gt;1,981        {&lt;br /&gt;1,982 =&amp;gt;         SerializationConfig cfg = copySerializationConfig();&lt;br /&gt;1,983            // [JACKSON-96]: allow enabling pretty printing for ObjectMapper directly&lt;br /&gt;1,984            if (cfg.isEnabled(SerializationConfig.Feature.INDENT_OUTPUT)) {&lt;br /&gt;1,985                jgen.useDefaultPrettyPrinter();&lt;br /&gt;1,986            }&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Using this approach we can navigate around the code.&lt;br /&gt;At any point we can see the thread dump using ‘where all’&lt;br /&gt;&lt;div class="shell"&gt;&lt;br /&gt;main[1] where all&lt;br /&gt;Signal Dispatcher:&lt;br /&gt;Finalizer:&lt;br /&gt;[1] java.lang.Object.wait (native method)&lt;br /&gt;[2] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:118)&lt;br /&gt;[3] java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:134)&lt;br /&gt;[4] java.lang.ref.Finalizer$FinalizerThread.run (Finalizer.java:159)&lt;br /&gt;Reference Handler:&lt;br /&gt;[1] java.lang.Object.wait (native method)&lt;br /&gt;[2] java.lang.Object.wait (Object.java:485)&lt;br /&gt;[3] java.lang.ref.Reference$ReferenceHandler.run (Reference.java:116)&lt;br /&gt;main:&lt;br /&gt;[1] org.codehaus.jackson.map.ObjectMapper._configAndWriteValue (ObjectMapper.java:1,982)&lt;br /&gt;[2] org.codehaus.jackson.map.ObjectMapper.writeValueAsString (ObjectMapper.java:1,596)&lt;br /&gt;[3] Main.main (Main.java:10)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h3&gt;Appendices:&lt;/h3&gt;&lt;br /&gt;&lt;h4&gt;Basic concept of debugging&lt;/h4&gt;&lt;br /&gt;A Debugger helps when the application/module/function behaviors different than that of developers expectation. Typically developer will first try to understand difference in behavior by glancing through the code quickly. If he still not able to understand the reason for the unexpected behavior; next step would be step through the program execution using a debugger.&lt;br /&gt;Using a debugger one can put a mark (called breakpoint) on any line in the source code and the program will stop execution when the execution reaches that mark. Then we can do the following:&lt;br /&gt;1. Inspect the state of the program at that point. Typically following states are valuable – (a) Local variables, (b) Instance variables of the current object (this), (b) Execution stack of the request&lt;br /&gt;2. Execute the program from that point (breakpoint), step by step, one line at a time. The current line could be an invocation of a function. In that case we have two options – (a) execute the function as single step and process to next line in the current code segment (step over), (b) step into the function and go to the next line in the function (step in).&lt;br /&gt;3. Continue the execution of program (resume) from the breakpoint (typically to next breakpoint).&lt;br /&gt;Typically we put a breakpoint at a line where we think the beginning of the significant code. Then navigate through the code step by step using either step-over and step-in, also inspecting local variables and instance variables at relevant steps. Once we complete the analysis of one significant code segment, we will move to another significant code segment by putting a breakpoint at the beginning of that segment and using ‘rusume’ to move from old code segment to new code segment.&lt;br /&gt;By this method most of the issues can be explained. However analyzing concurrency issues requires different approach.&lt;br /&gt;Consider a scenario where your program execution is affected by the setting of a Boolean variable which is reset by some other thread which you don’t know.&lt;br /&gt;This can be analyzed by putting a ‘watch’ on that variable. Whenever that variable is modified, execution is stopped at that point, by inspecting the stacktrace, we will be able understand which thread at which code modifies the variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1216938996547158189?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1216938996547158189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1216938996547158189' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1216938996547158189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1216938996547158189'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/04/jdb-command-line-debugger-for-java.html' title='JDB - Command line debugger for Java'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7314128915802417646</id><published>2011-04-07T21:44:00.004+05:30</published><updated>2011-04-07T21:53:51.538+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='india'/><title type='text'>Anna Hazare anti corrupton movement</title><content type='html'>It is very heartening to see the kind of support Anna Hazare anti corruption movement ( &lt;a href="http://www.annahazare.org/anticorruption-movement.html"&gt;http://www.annahazare.org/anticorruption-movement.html&lt;/a&gt; ) is gaining. My full support to the movement. I have observed that lot of educated employed youth also participating in this movement very actively ( despite common lethargy toward politics ). Lot of poeple are participating in fast to show solidarity towards Anna Hazare movement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7314128915802417646?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7314128915802417646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7314128915802417646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7314128915802417646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7314128915802417646'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/04/anna-hazare-anti-corrupton-movement.html' title='Anna Hazare anti corrupton movement'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7207388799564398722</id><published>2011-03-05T12:47:00.007+05:30</published><updated>2011-03-05T20:35:23.148+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Temperature and Pressure Gradient in Ideal Gas</title><content type='html'>Introduction&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExtRfyNiXI/AAAAAAAADTI/SgsrYL6TTJI/s320/gas_tube_with_temperature_gradient.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 66px;" src="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExtRfyNiXI/AAAAAAAADTI/SgsrYL6TTJI/s320/gas_tube_with_temperature_gradient.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Consider a narrow horizontal tube. The curved surface made with perfect insulator. The flat faces made with perfect heat conductor. One end of the tube is maintained at 100 oC and the other end is maintained at 0 oC. Once the steady state is attained, heat continue to flow from hot end to cold end. A temperature gradient is attained in the gas as the heat flows through it.&lt;br /&gt;Q1. Is the pressure in the gas in tube uniform?&lt;br /&gt;Q2. Is the density in the gas in tube uniform? Else how does it vary?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Derivation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExuC19z_KI/AAAAAAAADTQ/cQ790Q-VzcU/s320/cross_section_of_tube.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 306px; height: 123px;" src="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExuC19z_KI/AAAAAAAADTQ/cQ790Q-VzcU/s320/cross_section_of_tube.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Consider a cross section of the tube a position z=z0.&lt;br /&gt;Assume at z = z0 mean free path of molecules is l&lt;br /&gt;&lt;br /&gt;At z = z(0-l):&lt;br /&gt;Density is ρ1 and&lt;br /&gt;Average molecular velocity is c1&lt;br /&gt;Temperature is T1&lt;br /&gt;&lt;br /&gt;At z = z(0+l):&lt;br /&gt;Density is ρ2 and&lt;br /&gt;Molecular velocity is c2&lt;br /&gt;Temperature is T2&lt;br /&gt;The number of molecules crossing a unit area in the cross section at z=z0 from left side is:&lt;br /&gt;1/4ρ1c1&lt;br /&gt;The number of molecules crossing from right side is:&lt;br /&gt;1/4ρ2c2&lt;br /&gt;The number molecules crossing from both side has to be equal to maintain the conservation of mass.&lt;br /&gt;Hence ρ1c1 = ρ2c2&lt;br /&gt;That is pressure * molecular velocity is constant&lt;br /&gt;ρc = A           &lt;br /&gt;T is proportional to the square of c. Hence:&lt;br /&gt;ρ1sqrt(T1) = ρ2sqrt(T2)       &lt;br /&gt;Above equation is equivalent to equation for Thermal transpiration. However from the above argument, it can found that this is equation is valid for any steady state system with temperature or pressure gradient.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Other derivations&lt;/span&gt;&lt;br /&gt;ρ1/ρ2 = sqrt(T2/T1)  OR&lt;br /&gt;ρ/ρ0 = sqrt(T0/T)                  &lt;br /&gt;pressure is proportional to ρc^2&lt;br /&gt;p ~ ρc^2&lt;br /&gt;Applying equation (ρc = A) in above equation:&lt;br /&gt;pressure is proportional to c&lt;br /&gt;p ~ c&lt;br /&gt;&lt;br /&gt;p1/p2 = c1/c2&lt;br /&gt;c is proportional to square root of temperature&lt;br /&gt;p1/p2 = sqrt(T1/T2)   OR&lt;br /&gt;p/p0 = sqrt(T/T0)                 &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Implications&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Hot air balloon&lt;/span&gt;&lt;br /&gt;Why a hot air balloon is stiff? (see the photograph; courtesy skywaltz)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.skywaltz.com/gallery_section/small/n5_s.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 225px; height: 150px;" src="http://www.skywaltz.com/gallery_section/small/n5_s.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;It is stiff not because of the low density inside. Had it been the case if we fill the balloon with hydrogen (with opening as for hot air balloon), it would have been stiff (Any verification on this?).&lt;br /&gt;My friend Prem suggested that the stiffness may be due to the buoyancy. The upper part of the balloon can be stiff due the buoyancy. However stiffness of all wiered shaped balloons ( http://www.xarj.net/wp-content/uploads/2009/03/crazy-hot-air-balloon14.jpg ) cannot be explained by buoyancy.&lt;br /&gt;It is stiff because of the high pressure inside. Pressure is high due to the high temperature inside.&lt;br /&gt;However is the pressure inside high enough according to the equation (4)? Not really!&lt;br /&gt;Assume the inside temperature is 100 oC (373 K). Then:&lt;br /&gt;Assume outside temperature is 20 oC (293 K) and pressure is 1 kg/cm^2&lt;br /&gt;Inside pressure p = sqrt(373/293) * 1&lt;br /&gt;p = 1.13 kg/cm^2&lt;br /&gt;That is a pressure difference of 0.13 kg/cm^2&lt;br /&gt;That means a force of 1300 kg per square meter of balloon cloth. No balloon cloth can withstand that kind of force considering the area of balloon is many square meters.&lt;br /&gt;Why the pressure inside lower than expected?&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I have two hypothesis&lt;/span&gt;&lt;br /&gt;(a) Heat convection - Our assumption was heat transfer is entirely through conduction. If heat transfer via convection instead of conduction, then the gas inside the balloon instead of having continuous steady state temperature gradient, there will be macro level big pieces of air cloud with different temperature and density. Heat transfer shall be through movement of such air clouds rather than through conduction. in such case there will not be any pressure build up. We can consider the air inside the balloon as a collection of air clouds (like pebbles in a bag).&lt;br /&gt;In really both conduction and convection contributes and hence there will be some pressure difference (which is much less than otherwise it would have been).&lt;br /&gt;(b) Quantum mechanical non local potential energy reduction - If you consider glass tube in our discussion, the pressure inside is only a local optimization. By re-ordering the molecules, another state with same temperature gradient but with no pressure gradient is possible. However there is no incremental ways to achieve that state. If we consider molecular distribution of molecules as a superimposition of all possible distributions, by a non local state reduction of  molecules, pressure reduction is possible. Hence the actual pressure difference shall be less than predicted one and it will be depends on the amount of quantum mechanical state reductions.&lt;br /&gt;Is both (a) and (b) are related? How is heat convection explained in kinetic theory?&lt;br /&gt;Also I think as the opening at the bottom of the balloon is narrow, the pressure difference shall be high (for the same temperature inside) (Needs verification). Narrow opening will prevent heat convection and non local state reductions.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Experimental verifications&lt;/span&gt;&lt;br /&gt;To be done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7207388799564398722?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7207388799564398722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7207388799564398722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7207388799564398722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7207388799564398722'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/03/temperature-and-pressure-gradient-in.html' title='Temperature and Pressure Gradient in Ideal Gas'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Hit9aXPuEPE/TExtRfyNiXI/AAAAAAAADTI/SgsrYL6TTJI/s72-c/gas_tube_with_temperature_gradient.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-9135172317438343722</id><published>2011-03-02T21:45:00.003+05:30</published><updated>2011-03-05T14:19:42.607+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Crookes Radiometer</title><content type='html'>Crookes Radiometer is device which generates mechanical energy from light. The instrument consists of a shaft with Blades (leaves). The blades are painted black at one side and silver at other side. When light is shown on the device the leaves rotates.&lt;br /&gt;Please refer to &lt;a href="http://en.wikipedia.org/wiki/Crookes_radiometer"&gt; http://en.wikipedia.org/wiki/Crookes_radiometer&lt;/a&gt; to know more about Crookes Radiometer.&lt;br /&gt;According to the current scientific knowledge base, the explanation of Crookes Radiometer revolves around 'Thermal Transpiration'. However the explanation is very convoluted. Please refer &lt;a href="http://math.ucr.edu/home/baez/physics/General/LightMill/light-mill.html"&gt;http://math.ucr.edu/home/baez/physics/General/LightMill/light-mill.html&lt;/a&gt; for details about the current explanation.&lt;br /&gt;I have better explanation.&lt;br /&gt;The main contention is about how temperature at both sides of the blade (leaf) causes rotation.&lt;br /&gt;First consider what happens at the boundary between the blade and gas around it. The molecules in the gas hit and bounces at the blade. Consider now the temperature of the blade is higher than that of gas. Now heat will flow from blade to gas. How is heat flow from blade to gas? When the molecules hit the blade. When the molecules hit and bounce, it will bounce with faster speed than it was traveling before bouncing*. The increase in speed means increase in energy (the energy transferred from the blade to gas). The increase in speed is depends on the temperature difference between the blade and gas.&lt;br /&gt;Similarly when the temperature of the blade is less than the gas, the molecules will bounce with a lower speed than it was traveling before touching the blade.&lt;br /&gt;In steady state, temperature difference between gas and black side is higher than the temperature difference between the gas and silver side. Hence the molecules at black side bounces faster than the silver side.&lt;br /&gt;As the molecules bounces faster at black side,  black side will experience more pressure than silver (note that the pressure = change is momentum; momentum = mass * velocity). This pressure difference causes the rotation of the blade.&lt;br /&gt;&lt;br /&gt;* How can a particle travel faster than it's initial speed? Well, actually the real story is not like that. According to quantum theory the particle when hit get absorbed in the surface of the blade and then it get emitted with a higher speed. However this is not important to us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-9135172317438343722?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/9135172317438343722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=9135172317438343722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9135172317438343722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9135172317438343722'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/03/crookes-radiometer.html' title='Crookes Radiometer'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1533913553842161320</id><published>2011-01-18T19:02:00.004+05:30</published><updated>2011-01-18T19:07:44.826+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>IntelliJ IDEA</title><content type='html'>I have been using IntelliJ IDEA community edition ( &lt;a href="http://www.jetbrains.com/idea/"&gt;http://www.jetbrains.com/idea/&lt;/a&gt; ) lately and found that it is much better than Eclipse and NetBeans.&lt;br /&gt;Addicted to IDEA!&lt;br /&gt;&lt;a href="http://www.jetbrains.com/idea/features/code_analysis.html" style="display:block; background:#0d3a9e url(http://www.jetbrains.com/idea/opensource/img/all/banners/idea468x60_blue.gif) no-repeat 10px 50%; border:solid 1px #0d3a9e; margin:0;padding:0;text-decoration:none;text-indent:0;letter-spacing:-0.001em; width:466px; height:58px" alt="Java IDE with unparalleled java code analyzer (600+ built-in inspections)" title="Java IDE with unparalleled java code analyzer (600+ built-in inspections)"&gt;&lt;span style="margin: 5px 0 0 52px;padding: 0;float: left;font-size: 12px;cursor:pointer;  background-image:none;border:0;color: #acc4f9; font-family: trebuchet ms,arial,sans-serif;font-weight: normal;text-align:left;"&gt;Addicted to&lt;/span&gt;&lt;span style="margin:0 0 0 205px;padding:18px 0 2px 0; line-height:13px;font-size:13px;cursor:pointer;  background-image:none;border:0;display:block; width:255px; color: #acc4f9; font-family: trebuchet ms,arial,sans-serif;font-weight: normal;text-align:left;"&gt;Java IDE with unparalleled java code &lt;br/&gt;analyzer (600+ built-in inspections)&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1533913553842161320?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1533913553842161320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1533913553842161320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1533913553842161320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1533913553842161320'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2011/01/intellij-idea.html' title='IntelliJ IDEA'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5443311715652270582</id><published>2010-07-25T22:27:00.004+05:30</published><updated>2010-12-19T16:10:30.141+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Pressure and temperature gradient in Ideal Gas</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExtRfyNiXI/AAAAAAAADTI/SgsrYL6TTJI/s1600/gas_tube_with_temperature_gradient.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 66px;" src="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExtRfyNiXI/AAAAAAAADTI/SgsrYL6TTJI/s320/gas_tube_with_temperature_gradient.png" alt="" id="BLOGGER_PHOTO_ID_5497889392469838194" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Consider a circular tube with one side is maintained at 100 degree Celsius and other side is maintained at 0 degree Celsius. Temperature at both ends is maintained at constant temperature using an infinite heat source at A and infinite heat sink at B.  Faces facing A and B (flat faces) is perfect conductor.  Circular face is perfect insulator. Tube is filled with ideal gas.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What will be the temperature and pressure gradients inside the tube?&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Will heat flow from A to B?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Will the Temperature at A higher than temperature that at B?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Will the Pressure at A higher than pressure that at B?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Will the Density at A higher than that at B?&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExuC19z_KI/AAAAAAAADTQ/cQ790Q-VzcU/s1600/cross_section_of_tube.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 306px; height: 123px;" src="http://1.bp.blogspot.com/_Hit9aXPuEPE/TExuC19z_KI/AAAAAAAADTQ/cQ790Q-VzcU/s320/cross_section_of_tube.png" alt="" id="BLOGGER_PHOTO_ID_5497890240237665442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Consider the cross section at an arbitrary point in the tube.  Consider the kinetic theory of gas. Assume the all particles of the gas are of same weight.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Temperature in the tube touching side A shall be 100 and temperature in the tube touching side B shall be 0. Hence there will be a temperature gradient.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Hence heat will flow from A to B.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Number of particles passing from A to B will be equal to number of particles passing from B to A.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Number of particles passing through the cross section is proportional to density of the particles (d) and velocity of the particles (ū). That means throughout the tube, the dū will be constant.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Temperature of ideal gas is proportional to the square of the velocity of the particles. Hence velocity of gas particles at side A shall be higher than velocity at side B.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;As dū is constant, then density at side A shall be less than density at side B.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;According to kinetic theory, Pressure of a ideal gas is due to the particles of the gas hitting the boundary of the container. Pressure will be equal to the rate of change of momentum at the boundary. Pressure is directly proportional to the number of particles hitting the boundary and momentum of individual particles. Number of particles hitting the boundary is proportional to dū and momentum is proportional to velocity of the particles. Hence pressure is proportional to dū and ū.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Since dū is constant across the tube, pressure is directly proportional to velocity of the particles (ū). As we have seen velocity is directly proportional to the square root of temperature.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Hence pressure inside tube shall be higher at side A and lower at side B.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;This is in fact analogous to Bernoulli’s principle (which states that there will be a pressure gradient along with a velocity gradient).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;From this we can conclude that:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;There will be pressure gradient along with a temperature gradient. The pressure gradient is directly proportional to the gradient of square root of temperature&lt;/li&gt;&lt;br /&gt;&lt;li&gt;There will be density gradient along with temperature gradient. The density gradient is inversely proportional to the square root of the temperature.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5443311715652270582?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5443311715652270582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5443311715652270582' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5443311715652270582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5443311715652270582'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/07/pressure-and-temperature-gradient-in.html' title='Pressure and temperature gradient in Ideal Gas'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Hit9aXPuEPE/TExtRfyNiXI/AAAAAAAADTI/SgsrYL6TTJI/s72-c/gas_tube_with_temperature_gradient.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-338749285278006493</id><published>2010-07-24T20:01:00.005+05:30</published><updated>2010-07-25T17:37:16.799+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Kinetic theory of gas paradox</title><content type='html'>Consider a long narrow tube with circular face with perfect insulator and one end (A) maintained at 100 degree and other end (B) maintained at 0 degree. Tube is filled with ideal gas. Temperature at A (100) and B(0) are maintained at respective temperatures by a infinite heat source at A and infinite heat sink at B.&lt;br /&gt;1) Will heat flow from A to B?&lt;br /&gt;2) Will the Temperature at A higher than that at B?&lt;br /&gt;3) Will the pressure at both end same?&lt;br /&gt;4) Will the density at both end same?&lt;br /&gt;If we consider the kinetic theory of gas, the pressure is proportional to the density of molecules (more molecules more hits to the boundary), velocity molecules (more velocity more number of hits to the boundary) and momentum of molecules (more momentum more force). Momentum = velocity * mass. Hence pressure is proportional to the mass, density and square of velocity.&lt;br /&gt;However energy transfer is proportional to density, velocity and kinetic energy of each molecules. Kinetic energy = m*square of velocity. Heat transfer is proportional to mass, density and cube of velocity (This is evident from the fact that thermal conductivity of ideal gas is proportional to temperature).&lt;br /&gt;Hence in equilibrium, density at A will  be lower. Average velocity of molecules at A will be higher such that density * square of velocity at both side is equal. However heat transfer is proportional to cube of velocity heat will flow from A to B. Mass transfer is proportional to square of velocity there will not be any mass transfer (which is a necessary constraint).&lt;br /&gt;However now heat flows from A to B where as there is no temperature difference.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What are alternatives?&lt;/span&gt;&lt;br /&gt;We need to re-define temperature to such that temperate is proportional to cube of velocity. We may need to redefine the measurements as well.&lt;br /&gt;Will further post on the impact of this on other equation of temperature.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to verify?&lt;/span&gt;&lt;br /&gt;Verify this by conducting an experiment with above set up and observing the temperature, pressure and density at both end.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Some other corollaries:&lt;/span&gt;&lt;br /&gt;1) T = pū Where ū is the average velocity of the molecules.&lt;br /&gt;2) Ideal gas equation instead of pV = mRT, it should be:&lt;br /&gt;p&lt;sup&gt;3&lt;/sup&gt;V = CT&lt;sup&gt;2&lt;/sup&gt; Where C is a constant.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Yet another explanation:&lt;/span&gt;&lt;br /&gt;There will be a pressure gradient between A and B.&lt;br /&gt;This is equivalent (or similar) to pressure gradient because of velocity gradient (bernoulli's principle).&lt;br /&gt;That means when there is a temperature between two points in gas, there will be a density gradient and pressure gradient between these points.&lt;br /&gt;Consider a cross section across the pipe, at any arbitrary point. velocity of particles at side A will be greater than velocity pf particles at the other side (side of B). Density of particles at Side A shall be less than that of side B.&lt;br /&gt;At any point the number of particles crossing the cross section shall be equal in number. Consider the circular surface adjacent to the cross section, at both sides the number of particles hitting the surface shall be same. However the velocity of the particles is higher at side A. Hence the pressure at side A shall be higher.&lt;br /&gt;That means there shall be pressure gradient across the tube.&lt;br /&gt;&lt;br /&gt;Will post the corresponding equations later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-338749285278006493?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/338749285278006493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=338749285278006493' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/338749285278006493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/338749285278006493'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/07/kinetic-theory-of-gas-paradox.html' title='Kinetic theory of gas paradox'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1633422721391917376</id><published>2010-07-19T00:20:00.002+05:30</published><updated>2010-12-19T16:10:45.389+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='physics'/><title type='text'>Thinking physics</title><content type='html'>&lt;a href="http://www.goodreads.com/book/show/611807.Thinking_Physics" style="float: left; padding-right: 20px"&gt;&lt;img alt="Thinking Physics: Practical Lessons in Critical Thinking" border="0" src="http://photo.goodreads.com/books/1176312148m/611807.jpg" /&gt;&lt;/a&gt;&lt;a href="http://www.goodreads.com/book/show/611807.Thinking_Physics"&gt;Thinking Physics: Practical Lessons in Critical Thinking&lt;/a&gt; by &lt;a href="http://www.goodreads.com/author/show/138404.Lewis_Carroll_Epstein"&gt;Lewis Carroll Epstein&lt;/a&gt;&lt;br/&gt;&lt;br /&gt;My rating: &lt;a href="http://www.goodreads.com/review/show/92738304"&gt;5 of 5 stars&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Fantastic Book! Must Read for bright high school students and all engineering and science graduates. It would be good aptitude test of scientific aptitude for anybody. It is a good brain teaser. It explains the practical physical phenomenons in a manner without any mathematical formulas.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.goodreads.com/review/list/2568910-rejeev-divakaran"&gt;View all my reviews &gt;&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1633422721391917376?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1633422721391917376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1633422721391917376' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1633422721391917376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1633422721391917376'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/07/thinking-physics.html' title='Thinking physics'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6243168643850792706</id><published>2010-06-08T10:30:00.002+05:30</published><updated>2010-06-08T10:34:24.734+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='social'/><title type='text'>Yahoo Pulse</title><content type='html'>Yahoo has release &lt;a href="http://pulse.yahoo.com/"&gt;Yahoo Pulse&lt;/a&gt;&lt;br /&gt;It is an improved version of &lt;a href="http://profiles.yahoo.com"&gt;Yahoo profiles&lt;/a&gt;&lt;br /&gt;It has all features facebook has and potentially more powerfull, you can liverage existing contacts in yahoo messenger and yahoo mail.&lt;br /&gt;It has integration with other social sites like facebook.&lt;br /&gt;Check it out.&lt;br /&gt;Find more information at &lt;a href="http://pulse.yahoo.com/_3SHZRE5ZB5GBICWXIPB4DJOPUY/blog/articles/183315"&gt;http://pulse.yahoo.com/_3SHZRE5ZB5GBICWXIPB4DJOPUY/blog/articles/183315&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6243168643850792706?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6243168643850792706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6243168643850792706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6243168643850792706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6243168643850792706'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/06/yahoo-pulse.html' title='Yahoo Pulse'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6964707205897053659</id><published>2010-06-08T10:15:00.003+05:30</published><updated>2010-06-08T10:25:11.527+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='social'/><title type='text'>Maintaining your contact list</title><content type='html'>With the proliferation of social networks social medias. Your contact list is distributed in different sites/applications like yahoo mail, gmail, facebook, orkut, linkedin etc. Many times you will have lot of duplicate entries in the contact list for the same person.&lt;br /&gt;You can consolidate all your contacts using &lt;a href="http://address.yahoo.com"&gt;address.yahoo.com&lt;/a&gt;&lt;br /&gt;In &lt;a href="http://address.yahoo.com"&gt;address.yahoo.com&lt;/a&gt; home page you can see two links.&lt;br /&gt;a) Fix duplicate entries. This will list all potential duplicate entries in your yahoo address book, you will be able review, edit and merge duplicate entries.&lt;br /&gt;b) Import contacts. This will help you to import contacts from other applications/sites to your yahoo address book.&lt;br /&gt;These are long awaited very useful feature.&lt;br /&gt;Wishlist: There should be a way to identify obsolete email addresses and delete these.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6964707205897053659?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6964707205897053659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6964707205897053659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6964707205897053659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6964707205897053659'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/06/maintaining-your-contact-list.html' title='Maintaining your contact list'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1862605360482639238</id><published>2010-03-28T13:54:00.004+05:30</published><updated>2010-12-19T16:03:15.869+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='others'/><title type='text'>Employee Performance evaluation and Statistics</title><content type='html'>HR Managers typically insist on 'normalizing' performance ratings such that 10% on band 1, 20% band 2, 40% band 3, 20% band 4 and 10% band 5 etc. This is typically applied recursively to the entire organization (team, dept, organization). This normalization is based on the claim that performance of people follows 'normal distribution'.&lt;div&gt;There are two flaws in this.&lt;/div&gt;&lt;div&gt;a) Performance of people need not follow 'normal distribution'.  Normal distribution occurs when the variation is due to randomness (or chance). Consider two scenarios - one person taking the same test (rather similar test with same pattern) multiple times, and different people takes the same test. One person takes same test multiple times follows normal distribution, as the variation is due to randomness. However different people taking same test may not follow normal distribution. When different people takes same test, the variations are due to randomness as well as difference in individual's skill. Variation in skill need not follow normal distribution. &lt;/div&gt;&lt;div&gt;b) According to statistics, when we take samples out of a population (eg:  depts of 100 people in an organization of 10000 people), the mean (average performance) of the samples (individual depts) should follow normal distribution. However current practice is to enforce individual depts normally distributed with same means. This is mainly because no dept head will be ready to admit that his dept performance mean is less than company mean. That simply means the performce ratings are force fit rather than actual performance.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1862605360482639238?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1862605360482639238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1862605360482639238' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1862605360482639238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1862605360482639238'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/03/employee-performance-evaluation-and.html' title='Employee Performance evaluation and Statistics'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3676801834789000289</id><published>2010-03-20T18:14:00.003+05:30</published><updated>2010-03-20T18:20:49.060+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Poor customer support from Panasonic</title><content type='html'>I have old Panasonic CRT TV (Sophia - Model TC-21S91N). I wanted the operation manual and visited the panasonic website (www.panasonic.co.in) and found that they don't even list Telivisions in the download manuals page (is panasonic stoped selling TVs?). I tried the international site also. I could not find this model. It is costs nothing for the company to keep the details about the product even if the product is retired. Lot of people may be still using it. I will think twice before buying any Panasonic product now.&lt;br /&gt;Tale story: after some internet search, i found a manual for similar model from &lt;a href="http://tv.manualsonline.com/manuals/mfg/panasonic/panasonic_product_list.html"&gt;http://tv.manualsonline.com/manuals/mfg/panasonic/panasonic_product_list.html&lt;/a&gt; . This is good site for finding out old manuals.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3676801834789000289?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3676801834789000289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3676801834789000289' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3676801834789000289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3676801834789000289'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/03/poor-customer-support-from-panasonic.html' title='Poor customer support from Panasonic'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8213496008352479624</id><published>2010-03-07T09:37:00.003+05:30</published><updated>2010-03-08T09:31:44.122+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Local SVN for personal software programming</title><content type='html'>If you do programming as a hobby at home, it may be worth using a local svn for version control. It is quite easy to setup.&lt;br /&gt;1) Install SVN server. If you are using Mac OS X and if you use macports, then 'port subversion' will do the magic&lt;br /&gt;&lt;span style="font-family:monospace"&gt;rejeev$port subversion&lt;/span&gt;&lt;br /&gt;2) Create a repository. &lt;br /&gt;&lt;span style="font-family:monospace"&gt;svnadmin create /Users/rejeev/svnrepositories/myproject1&lt;/span&gt;&lt;br /&gt;3) Checkout initial version.&lt;br /&gt;&lt;span style="font-family:monospace"&gt;&lt;br /&gt;cd /Users/rejeev/workspace&lt;br /&gt;&lt;br /&gt;svn co file:////Users/rejeev/svnrepositories/myproject1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;A directory 'myproject1' must be created this location.&lt;br /&gt;4) Put your source code at this location. If you are using a maven, you can create a maven project at this location. Your directory structure will look like below.&lt;br /&gt;&lt;span style="font-family:monospace"&gt;&lt;br /&gt;pom.xml&lt;br /&gt;&lt;br /&gt;src/main/java&lt;br /&gt;&lt;br /&gt;src/main/resources&lt;br /&gt;&lt;br /&gt;src/test/java&lt;br /&gt;&lt;br /&gt;src/main/resources&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;5) Make the initial checkin&lt;br /&gt;&lt;span style="font-family:monospace"&gt;&lt;br /&gt;svn add pom.xml&lt;br /&gt;&lt;br /&gt;svn add src&lt;br /&gt;&lt;br /&gt;svn ci -m "initial checkin"&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;That is all!&lt;br /&gt;&lt;br /&gt;Some advanced stuff&lt;br /&gt;If you are working from multiple machines (office and home?) or multiple people are working on same stuff you can run a SVN server and access do checkin/checkout from multiple boxes&lt;br /&gt;To start SVN server&lt;br /&gt;&lt;span style="font-family:monospace"&gt;&lt;br /&gt;svnserve -d -r /Users/rejeev/svnrepositories/myproject1&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;To checkout code from a different machine&lt;br /&gt;&lt;span style="font-family:monospace"&gt;&lt;br /&gt;cd /Users/rejeev/work&lt;br /&gt;&lt;br /&gt;svn co svn://mymachine-name myproject1&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8213496008352479624?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8213496008352479624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8213496008352479624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8213496008352479624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8213496008352479624'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/03/local-svn-for-personal-software.html' title='Local SVN for personal software programming'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5278716012292344324</id><published>2010-02-27T10:30:00.004+05:30</published><updated>2010-12-19T16:12:13.613+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='social'/><title type='text'>Podcasts for programmers</title><content type='html'>Recently I have been listening to podcasts for programmers. It is a good way of spending your time while commuting to and from office (especaially if you are working in bangalore). Following are two very good podcast sites&lt;br /&gt;se-radio.net ( http://se-radio.net/ ) - lot of good podcasts on architecture, design, interview with great programmers etc. The main anchor Markus himself is a very good programmer.&lt;br /&gt;stackoverflow podcasts ( http://itc.conversationsnetwork.org/series/stackoverflow.html ) - discussion between Jeff atwood and Joel spolky on various topics on programming and software development in general.&lt;br /&gt;this link list a long list of other podcasts on software development&lt;br /&gt;http://stackoverflow.com/questions/1644/what-good-technology-podcasts-are-out-there&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5278716012292344324?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5278716012292344324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5278716012292344324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5278716012292344324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5278716012292344324'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2010/02/podcasts-for-programmers.html' title='Podcasts for programmers'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6881384158809011785</id><published>2009-12-13T22:26:00.002+05:30</published><updated>2009-12-13T22:28:43.722+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Facebook application for Goodread</title><content type='html'>If you use Goodreads and Facebook, then this application will be useful. You can provide a box or tab for Goodreads and you can showcase your books in Facebook.&lt;br /&gt;&lt;a href="http://apps.facebook.com/good_reads/"&gt;http://apps.facebook.com/good_reads/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6881384158809011785?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://apps.facebook.com/good_reads/' title='Facebook application for Goodread'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6881384158809011785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6881384158809011785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6881384158809011785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6881384158809011785'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/12/facebook-application-for-goodread.html' title='Facebook application for Goodread'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-4683321639935446713</id><published>2009-12-13T18:42:00.001+05:30</published><updated>2010-12-19T16:10:14.638+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><title type='text'>My Goodread bookshelf</title><content type='html'>Check out my bookshelves on Goodreads - where you can see what your friends are reading.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.goodreads.com/friend/i?i=LTM2MDQ1MzAxNTI6MzY3"&gt;http://www.goodreads.com/friend/i?i=LTM2MDQ1MzAxNTI6MzY3&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-4683321639935446713?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/4683321639935446713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=4683321639935446713' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4683321639935446713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4683321639935446713'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/12/my-goodread-bookshelf.html' title='My Goodread bookshelf'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1066950069803818333</id><published>2009-11-29T23:37:00.002+05:30</published><updated>2009-11-29T23:41:02.287+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='architecture'/><title type='text'>Application Architecture guide Version 2 from Microsoft</title><content type='html'>Application Architecture guide v2 has been released by microsoft. I have not yet read it. Version 1 was good, table of content of v2 looks promising. this is guide is not specific to .net. it is very good discussion on enterprise application architecture in general.&lt;br /&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=ce40e4e1-9838-4c89-a197-a373b2a60df2&amp;displaylang=en&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1066950069803818333?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.microsoft.com/downloads/details.aspx?FamilyID=ce40e4e1-9838-4c89-a197-a373b2a60df2&amp;displaylang=en' title='Application Architecture guide Version 2 from Microsoft'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1066950069803818333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1066950069803818333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1066950069803818333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1066950069803818333'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/11/application-architecture-guide-version.html' title='Application Architecture guide Version 2 from Microsoft'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1298431139284636952</id><published>2009-11-29T17:09:00.003+05:30</published><updated>2010-12-19T16:07:03.856+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><category scheme='http://www.blogger.com/atom/ns#' term='others'/><title type='text'>Shuttle service from city to Bangalore airport</title><content type='html'>There are Volvo Bus (Vayu Vajra) shuttle service from city to Bangalore International Airport (BIAL). You can find the details at &lt;a href="http://www.bmtcinfo.com/site/BSBusServicesDetails.jsp?bsserviceid=1"&gt;http://www.bmtcinfo.com/site/BSBusServicesDetails.jsp?bsserviceid=1&lt;/a&gt;. Click on the route link you think relevant to you, details of the route is mentioned. On the rightside there is button (not very intuitive) clicking you can view a google map with stops marked.&lt;br /&gt;&lt;br /&gt;You can download a route list at &lt;a href="http://www.bmtcinfo.com/uploads/Files/Vayu_Vajra_route_List.pdf"&gt;http://www.bmtcinfo.com/uploads/Files/Vayu_Vajra_route_List.pdf&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;At the airport bus terminal (which is just in front of the main entrance), there is route map displayed which is very useful, different routs ard marked in different colour.&lt;br /&gt;&lt;br /&gt;Vayu Vajra buses are having ample space for keeping the luggage.&lt;br /&gt;&lt;br /&gt;On the whole it is very good service, even though it is expensive (about Rs 150 to the city)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1298431139284636952?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1298431139284636952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1298431139284636952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1298431139284636952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1298431139284636952'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/11/shuttle-service-from-city-to-bangalore.html' title='Shuttle service from city to Bangalore airport'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7292956012443246421</id><published>2009-11-28T18:16:00.004+05:30</published><updated>2010-12-19T16:05:49.581+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Glassbox</title><content type='html'>Glassbox is a good monitoring tool for Java web applications. It provides the response time statistics for key methods like servlets, database calls etc. You can extend methods you want to monitor by specifying the aspects (It uses Aspectj aop.xml for this). This is tool built using Aspectj AOP. This tool is particularly good monitoring performance of web applications in production.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7292956012443246421?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.glassbox.com/glassbox/Home.html' title='Glassbox'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7292956012443246421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7292956012443246421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7292956012443246421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7292956012443246421'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/11/glassbox.html' title='Glassbox'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-557506736164663830</id><published>2009-11-22T09:27:00.004+05:30</published><updated>2010-12-19T15:59:06.035+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='others'/><title type='text'>Some keyboard shortcuts for Apple Mac OS X</title><content type='html'>Here are some keyboard shortcuts for Apple Mac OS X. Very few now. Plan to build as I go (started using MacBook Pro now). May be useful for beginners. I have built this using Google doc and published as html. Is there any way I can publish it such that public can edit it?&lt;br /&gt;Link: &lt;a href="http://spreadsheets.google.com/pub?key=t_EbCAybhNOGuNpN3FVFzzQ&amp;single=true&amp;gid=0&amp;output=html"&gt;http://spreadsheets.google.com/pub?key=t_EbCAybhNOGuNpN3FVFzzQ&amp;single=true&amp;gid=0&amp;output=html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-557506736164663830?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://spreadsheets.google.com/pub?key=t_EbCAybhNOGuNpN3FVFzzQ&amp;single=true&amp;gid=0&amp;output=html' title='Some keyboard shortcuts for Apple Mac OS X'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/557506736164663830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=557506736164663830' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/557506736164663830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/557506736164663830'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/11/some-keyboard-shortcuts-for-apple-mac.html' title='Some keyboard shortcuts for Apple Mac OS X'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-9145147884433339982</id><published>2009-11-16T22:23:00.002+05:30</published><updated>2009-11-16T22:26:00.307+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><title type='text'>Joined Yahoo!</title><content type='html'>Joined Yahoo! today. Shall be working on the Yahoo Platforms team. Looking forward to lot of fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-9145147884433339982?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/9145147884433339982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=9145147884433339982' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9145147884433339982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9145147884433339982'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/11/joined-yahoo.html' title='Joined Yahoo!'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-843893221951121750</id><published>2009-09-16T22:39:00.003+05:30</published><updated>2009-09-16T22:51:08.180+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>Character encoding in Web Development</title><content type='html'>If you have static HTML page, use the following tag in &amp;lt;head&amp;gt; section.&lt;br /&gt;&lt;blockquote&gt;&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;&amp;gt;&lt;/blockquote&gt;&lt;br /&gt;If you have a dynamic page (JSP or Servlet), use the following code&lt;br /&gt;&lt;blockquote&gt;response.setCharacterEncoding(&amp;quot;UTF-8&amp;quot;); &lt;/blockquote&gt;&lt;br /&gt;If this method is called, web server will set the Content-Type HTTP header accordingly.&lt;br /&gt;&lt;blockquote&gt;Content-Type: text/html; charset=UTF-8&lt;/blockquote&gt;&lt;br /&gt;Assume you have a page which accepts Russian characters.&lt;br /&gt;Then according the standards you need to specify accept-charset=&amp;quot;UTF-8&amp;quot; in form tag&lt;br /&gt;&lt;blockquote&gt;&amp;lt;form accept-charset=&amp;quot;UTF-8&amp;quot; &amp;gt;&lt;/blockquote&gt;&lt;br /&gt;However Internet explorer does not supports accept-charset. Nevertheless it is better to specify this attribute, howeve that is not sufficient.&lt;br /&gt;However most of the browsers use the same encoding used for rendering the page (specified by Content-Type HTTP header), for encoding the forms submitted from the page. Hence specify the encoding for the page which contains the form (as mentioned above). This will force the browser to use the same encoding for form submission.&lt;br /&gt;Browsers are supposed to send the Content-Type HTTP header along with HTTP reqeust for the form submission. however most of the browsers including IE and Firefox don't do so. Hence server side there is no way to acertain the encoding used by client.&lt;br /&gt;Best work around is to use Content-Type (as mentined above) for the web pages containing forms and hence force the browser to use specific encoding scheme. Then specify the encoding at server while processing the reqeust by specifying&lt;br /&gt;&lt;blockquote&gt;if(request.getCharacterEncoding() == null) request.setCharacterEncoding(&amp;quot;UTF-8&amp;quot;);&lt;/blockquote&gt;&lt;br /&gt;However there is another catch. If you want to submit a form with some other encoding scheme (for whateve reason - typically this can happen when you want to submit form to another website). Then it will be difficult from IE.&lt;br /&gt;On the whole the best practice is to use always&lt;br /&gt;&lt;blockquote&gt;response.setCharacterEncoding(&amp;quot;UTF-8&amp;quot;); -- in JSP/Servlet&lt;br /&gt;if(request.getCharacterEncoding() == null) request.setCharacterEncoding(&amp;quot;UTF-8&amp;quot;); -- in JSP/Servlet&lt;br /&gt;&amp;lt;meta http-equiv=&amp;quot;Content-Type&amp;quot; content=&amp;quot;text/html; charset=utf-8&amp;quot;&amp;gt; -- in static pages&lt;br /&gt;&amp;lt;form accept-charset=&amp;quot;UTF-8&amp;quot; &amp;gt; -- all forms&lt;/blockquote&gt;&lt;br /&gt;Allways use &amp;quot;UTF-8&amp;quot; as the encoding which is much better scheme than all other available schemes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-843893221951121750?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/843893221951121750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=843893221951121750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/843893221951121750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/843893221951121750'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/09/character-encoding-in-web-development.html' title='Character encoding in Web Development'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3093783529507610785</id><published>2009-09-09T21:05:00.001+05:30</published><updated>2009-09-09T21:06:31.946+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>String literals and Garbage Collection in Java</title><content type='html'>String literals are loaded during class loading. String literal objects are created in heap and a reference to each String literal object is stored in String literal pool. String literals are never garbage collected. &lt;br /&gt;Can this cause OutOfMemory? Not really! The amount of memory required to load String laterals is not more than the size of the class it loaded from. You cannot dynamically create String literals. Unlike other memory leak issues where objects can be created dynamically. &lt;br /&gt;&lt;br /&gt;Here is a interesting article on String literals  &lt;a href="http://www.javaranch.com/journal/200409/ScjpTipLine-StringsLiterally.html"&gt;http://www.javaranch.com/journal/200409/ScjpTipLine-StringsLiterally.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3093783529507610785?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3093783529507610785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3093783529507610785' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3093783529507610785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3093783529507610785'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/09/string-literals-and-garbage-collection.html' title='String literals and Garbage Collection in Java'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5519380567333659808</id><published>2009-09-08T23:17:00.005+05:30</published><updated>2009-09-08T23:42:24.813+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Session Fixation in WebLogic and Tomcat</title><content type='html'>Session Fixation is a security vulnerability prevelant in Authentication framework available in most of the Web Servers (WebLogic Server 10.3, Tomcat 6.0.20, ASP.NET).&lt;br /&gt;Session Fixation works as follows:&lt;br /&gt;1) Alice (attacker) access a unprotected resource (http://vulnerableApp/unprotected.jsp). In most of the web servers a new session is created now, even if you are not logged in. A session cookie is set and sent with the response.&lt;br /&gt;2) Alice notes down the session cookie sent by the web server. She can do that using some HTTP monitoring tool like LiveHttpHeader for FireFox. copy that cookie string to a different computer. Alice change the browser page to something else (www.google.com). Keep the browser window open. Leaves the computer.&lt;br /&gt;3) Bob (victim) uses the computer to access a protected resource from the same web application (http://vulnerableApp/protected.jsp). He uses the same browser windows (which is kept open). He loges in using his username/password. WebServer now uses the same session cookie for logged in session. Bob continue using the application for next 30 minutes.&lt;br /&gt;4) Alice access the protected resource from the application (http://vulnerableApp/protected.jsp) using the saved cookie from another machine. He can use some Java client to do so. Now she is able to access the protected resource with Bob's credentials. Alice will be able to access all protected resources until Bob logs out. If Bob leaves the computer by closing the browser (without explicit logout), then alice will be able to use the resource forever (or untill next server re-start).&lt;br /&gt;This vulnerability is there if you are using most of the Web Servers (WebLogic, Tomcat not tested any other server heard ASP.NET is also having session fixation bug. )&lt;br /&gt;Solution:&lt;br /&gt;If you are using Form based authentication, call session.invalidate() in the login page. This will create new session cookie. See the sample login page below:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;        &amp;lt;%&lt;br /&gt;  session.invalidate();&lt;br /&gt; %&amp;gt;&lt;br /&gt; &amp;lt;form action=&amp;quot;j_security_check&amp;quot; method=&amp;quot;POST&amp;quot; name=&amp;quot;login&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;input type=&amp;quot;input&amp;quot; name=&amp;quot;j_username&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;input type=&amp;quot;password&amp;quot; name=&amp;quot;j_password&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;submit&amp;quot; value=&amp;quot;Log in&amp;quot; /&amp;gt;&lt;br /&gt; &amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;If you are BASIC authentication, you are at risk unless the web server handles it correctly (most web servers don't handle it). Ideally authentication framework in the web server should have called session.invalidate() before authentication.&lt;br /&gt;Don't use BASIC authentication in your application.&lt;br /&gt;Sample application to demonstrate the vulnerability&lt;br /&gt;1) Download the SimpleWebApp1 ( &lt;a href="http://rejeev.googlepages.com/SimpleWebApp1.war"&gt;http://rejeev.googlepages.com/SimpleWebApp1.war&lt;/a&gt; )&lt;br /&gt;2) Configure a WebLogic or Tomcat server&lt;br /&gt;3) Create a user called "user1" in weblogic&lt;br /&gt;4) Create a user called "user1" and role called "user1" in Tomcat&lt;br /&gt;5) Deploy the application in WebLogic or tomcat&lt;br /&gt;6) Access test2.jsp (http://localhost:7001/SimpleWebApp1/test2.jsp)&lt;br /&gt;7) Note the cookie (use LiveHttpHeaders with firefox)&lt;br /&gt;8) Access test1.jsp (http://localhost:7001/SimpleWebApp1/test1.jsp). You will be asked to log in, log in.&lt;br /&gt;9) Now try access the test1.jsp using the TestSessionFixation.java provide inside the war. Usage: java rejeev.sessionfixation.TestSessionFixation &lt;url&gt;&lt;cookie&gt;. You will be able to see test1.jsp without login.&lt;br /&gt;Oracle has supposed to fix this issue in WebLogic Server 10.3. However I have observed that latest version of WebLogic Server (10.3) has this issue. I think they have mistaken this issue as an issue in thier admin console (admin cosole being a web application that is also vulnerable). However fundemental vulnerability is in the authentication framework.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5519380567333659808?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5519380567333659808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5519380567333659808' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5519380567333659808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5519380567333659808'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/09/session-fixation_08.html' title='Session Fixation in WebLogic and Tomcat'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6660273293278317610</id><published>2009-09-06T21:49:00.003+05:30</published><updated>2009-09-06T22:18:54.266+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Session Fixation</title><content type='html'>Recently I come to know about a new security vulnerability (new to me) - Session Fixation ( &lt;a href="http://www.owasp.org/index.php/Session_Fixation"&gt;http://www.owasp.org/index.php/Session_Fixation&lt;/a&gt; ). Somebody could already start a session (may be by accessing a non-secure/less previleged resource) and trick you to login to the application and use it. Then you are vulnerable. He could have saved the sessionid before handing over to you and use it from another machine. If you close the browser after your usage (without loggint out - which many people do), he could use it infinitely long. If you logout after use he could use only as long as you are logged in.&lt;br /&gt;You could prevent this by calling session.invalidate before authentication, in the authentication method. If you are using your application server's authentication framework (that is what we are lold - not to write our own security code), then you need to verify that your application server does that. &lt;br /&gt;In ASP.NET platform it is very difficult to prevent as ASP.NET reuses the same sessionid even if you create new session by calling session.invalidate. There are some known solutions available ( &lt;a href="http://www.owasp.org/index.php/Session_Fixation_Protection"&gt;http://www.owasp.org/index.php/Session_Fixation_Protection&lt;/a&gt; )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6660273293278317610?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6660273293278317610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6660273293278317610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6660273293278317610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6660273293278317610'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/09/session-fixation.html' title='Session Fixation'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-352123624252132698</id><published>2009-09-04T22:35:00.002+05:30</published><updated>2009-09-04T22:50:22.672+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>OWASP Enterprise Security API (ESAPI)</title><content type='html'>OWASP has a Web Application Security framework called Enterprise Security API (ESAPI) ( &lt;a href="http://www.owasp.org/index.php/ESAPI"&gt;http://www.owasp.org/index.php/ESAPI&lt;/a&gt; ). It is a security framework cum security utilities library.&lt;br /&gt;You can do authentication, authorization, CSRF protection, XSS protection etc (besided many other things). A sample application and API doc is available at the site. However there is no other detailed documentation on the usage. I will write another blog on the usage in detail. &lt;br /&gt;Following is few Key classes and API&lt;br /&gt;&lt;blockquote&gt;package org.owasp.esapi &lt;br /&gt;For authentication&lt;br /&gt;class Authenticator &lt;br /&gt;    &amp;nbsp&amp;nbsp&amp;nbsplogin() &lt;br /&gt;    &amp;nbsp&amp;nbsp&amp;nbsplogout() &lt;br /&gt;For authorization&lt;br /&gt;class AccessController &lt;br /&gt;   &amp;nbsp&amp;nbsp&amp;nbspassertAuthorizedForURL(string url) &lt;br /&gt;For XSS protection&lt;br /&gt;class Validator &lt;br /&gt;     &amp;nbsp&amp;nbsp&amp;nbspassertValidHTTPRequestParameterSet(string context, Request request, Set requied, Set optional)&lt;br /&gt;     &amp;nbsp&amp;nbsp&amp;nbspisValidString(string input)&lt;br /&gt;class Encoder &lt;br /&gt;     &amp;nbsp&amp;nbsp&amp;nbspencodeForHTML(string input)&lt;br /&gt;For CSRF protection&lt;br /&gt;class HTTPUtilities &lt;br /&gt;     &amp;nbsp&amp;nbsp&amp;nbspaddCSRFToken(string href) &lt;br /&gt;     &amp;nbsp&amp;nbsp&amp;nbspverifyCSRFToken()&lt;/blockquote&gt;&lt;br /&gt;  &lt;br /&gt;I will write a detailed blog later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-352123624252132698?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/352123624252132698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=352123624252132698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/352123624252132698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/352123624252132698'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/09/owasp-enterprise-security-api-esapi.html' title='OWASP Enterprise Security API (ESAPI)'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8126718285054156921</id><published>2009-08-23T22:23:00.002+05:30</published><updated>2009-08-23T22:38:39.163+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Leaky Abstraction - Double Checked Locking</title><content type='html'>Some times our inferences based on the abstracted view fails due to the implementation dependencies. This is called leaky abstraction ( &lt;a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html"&gt;http://www.joelonsoftware.com/articles/LeakyAbstractions.html&lt;/a&gt; ).&lt;br /&gt;Double Checked Locking idiom was an widely sited design pattern where instead of synchronizing the whole method, synchronize only the initialization part. See the following code snippents&lt;br /&gt;  &lt;blockquote&gt;private Helper helper = null;&lt;br /&gt;  public synchronized Helper getHelper() {&lt;br /&gt;    if (helper == null) &lt;br /&gt;        helper = new Helper();&lt;br /&gt;    return helper;&lt;br /&gt;    }&lt;br /&gt;  // other functions and members...&lt;br /&gt;  }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Using double checked idiom same code would be implemented as:&lt;br /&gt;  &lt;blockquote&gt;private Helper helper = null;&lt;br /&gt;  public Helper getHelper() {&lt;br /&gt;    if (helper == null) &lt;br /&gt;      synchronized(this) {&lt;br /&gt;        if (helper == null) &lt;br /&gt;          helper = new Helper();&lt;br /&gt;      }    &lt;br /&gt;    return helper;&lt;br /&gt;    }&lt;br /&gt;  // other functions and members...&lt;br /&gt;  }&lt;/blockquote&gt;&lt;br /&gt;However it doesn't work. See the following link &lt;a href="http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html"&gt;http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html&lt;/a&gt;&lt;br /&gt;This is against our (or my) inuition based on the modern language threading model (that execution of method happens in the order of statements written in the code. However that is not correct. Language specifications provide lot of leniency on this part for sake of performance. Compiler optizers typically rewrite the code and final execution not necessarily  strict oder as it written in the source code)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8126718285054156921?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8126718285054156921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8126718285054156921' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8126718285054156921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8126718285054156921'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/08/leaky-abstraction-double-checked.html' title='Leaky Abstraction - Double Checked Locking'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2121594624671887033</id><published>2009-08-23T11:57:00.001+05:30</published><updated>2009-08-23T12:00:44.942+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>New BookShelf</title><content type='html'>I have created a account in GoodReads.com and moving my bookshelf there. GoodReads is a good initiative eventhough has some usability issue currently.&lt;br /&gt;My bookshelf: &lt;a href="http://www.goodreads.com/review/list/2568910?sort=rating"&gt;http://www.goodreads.com/review/list/2568910?sort=rating&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2121594624671887033?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2121594624671887033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2121594624671887033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2121594624671887033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2121594624671887033'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/08/new-bookshelf.html' title='New BookShelf'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3033787603168054733</id><published>2009-08-03T22:35:00.003+05:30</published><updated>2010-12-19T15:57:32.538+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='others'/><title type='text'>Extension Methods in C#</title><content type='html'>C# has a nice feature called Extension Methods - You can extend the APIs of an Interface or Class by Extesnsion class and methods.&lt;br /&gt;Please refer to the following link for details about usage ( &lt;a href="http://msdn.microsoft.com/en-us/library/bb311042.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb311042.aspx&lt;/a&gt; )&lt;br /&gt;This feature is purticularly useful for extending functionality of Interfaces/classes which are not instantiated by us (for example DataReader which typically goy by SqlCommand.ExecuteReader() )&lt;br /&gt;Assume we want to introduce a method for retrieving values from DataReader even if the value is null in database (by default it will throw exception if we try to read data which is null in database)&lt;br /&gt;We can write the following Class for that (Stolen shamelessly from this &lt;a href="http://stackoverflow.com/questions/1222116/sqldatareader-getstring-and-sqlnullvalueexception/1222166#1222166"&gt;Answer by Tommy Carlier on stackoverflow&lt;/a&gt; )&lt;br /&gt;&lt;br /&gt;static class DataReaderExtension&lt;br /&gt;{&lt;br /&gt;public static string GetStringOrNull(this IDataReader reader, int ordinal)&lt;br /&gt;{&lt;br /&gt;return reader.IsDBNull(ordinal) ? null : reader.GetString(ordinal);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;We can use this as follows:&lt;br /&gt;SqlDataReader reader = command.ExectureReader();&lt;br /&gt;string value = reader.GetStringOrNull(0); // this will not break even if value is null&lt;br /&gt;Without Extension methods to achieve this functionality we would have written wrapper class and implement all unnecessary methods also.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3033787603168054733?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3033787603168054733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3033787603168054733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3033787603168054733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3033787603168054733'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/08/extension-methods-in-c.html' title='Extension Methods in C#'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3734280847430363700</id><published>2009-05-05T20:16:00.002+05:30</published><updated>2009-05-05T20:20:58.664+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Javadoc tool with @exclude tag</title><content type='html'>The standard javadoc  utility shipped with JDK doesn't provide an option to exclude some public methods from public API documentation. Currently we can filter only at file level (either all methods from all classes in the file or none).&lt;br /&gt;Javadoc specification proposes a new tag called '@exclude' for this purpose - any method which @exclude tag shall be excluded from javadoc documentation. However this has not been implemented yet.&lt;br /&gt;Here is a modified javadoc utility which can implements @exclude tag - any method with @exclude tag will be excluded from javadoc.&lt;br /&gt;Usage:&lt;br /&gt;1) download the &lt;a href="http://rejeev.googlepages.com/javadoc.jar"&gt;javadoc.jar&lt;/a&gt;&lt;br /&gt;2) create a file with list of source files which contain the methods to be documented&lt;br /&gt;eg: inputs.txt&lt;br /&gt;---------------------------------------------&lt;br /&gt;c:\src\com\abc\spi\Abc.java&lt;br /&gt;c:\src\com\abc\util\Xyz.java&lt;br /&gt;----------------------------------------------&lt;br /&gt;3) invoke javadoc as follows&lt;br /&gt;javadoc -docletpath &lt;path to javadoc.jar&gt; -d &lt;path to output dir&gt; -doclet com.sun.tools.doclets.standard.Standard1 @&lt;path to inputs.txt&gt;&lt;br /&gt;Please note that name of the file has been renamed to Standard1.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3734280847430363700?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3734280847430363700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3734280847430363700' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3734280847430363700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3734280847430363700'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/05/javadoc-tool-with-exclude-tag.html' title='Javadoc tool with @exclude tag'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7966387215600253176</id><published>2009-04-19T07:56:00.005+05:30</published><updated>2009-04-19T08:09:08.033+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Method Tracing</title><content type='html'>Assume you have a complex application probably developed by somebody else. Sometime you have an application which runs on top of another platform like application server or portal. Sometime your application may be using some other third party component. &lt;br /&gt;You may want to know trace the execution of specific requests or transactions in the system probably for debugging. This is also helpful to understand the architecture/design of the system. &lt;br /&gt;You can do that using this tool. This tool traces the progress (execution) of each thread. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;br /&gt;0) Download and copy the following 3 jars to a convenient location. (all jars has to be in the same directory). (Click on the link to download files).&lt;br /&gt; &lt;a href="http://rejeev.googlepages.com/MethodTracer.jar"&gt;MethodTracer.jar&lt;/a&gt;&lt;br /&gt; &lt;a href="http://rejeev.googlepages.com/asm-3.1.jar"&gt;asm-3.1.jar&lt;/a&gt;&lt;br /&gt; &lt;a href="http://rejeev.googlepages.com/asm-commons-3.1.jar"&gt;asm-commons-3.1.jar&lt;/a&gt;&lt;br /&gt;1) Add the following JVM options during startup.&lt;br /&gt;-javaagent:[path_to_MethodTracer.jar]&lt;br /&gt;If you are using some startup script you may need to add it there. If you are using some exe to invoke java then there may be some file where you will be able to add this.&lt;br /&gt;&lt;br /&gt;2) Extract trace.properties from the jar and edit it to change the configurations. Put it back. You can use the following commands for extracting the property file and put it back into jar.&lt;br /&gt;   jar -xvf MethodTracer.jar tracer.properties&lt;br /&gt;   jar -uvf MethodTracer.jar tracer.properties&lt;br /&gt;Following are the options available.&lt;br /&gt;ExcludedPackages – classes from this coma separated list of packages shall be excluded from instrumentation and hence execution of such methods shall not be traced.&lt;br /&gt;IncludedPackages – If specified only classes from this packages shall be traced. You can use includePackages and excludePackages together to get fine control&lt;br /&gt;allThreadsLogged – if true, all requests by threads shall be traced. You can trace the requests by specific threads by turn this flag false and use threadList&lt;br /&gt;threadList – if allthreadsLogged is false, then only the threads specified in this list shall be traced.&lt;br /&gt;This is useful in the case of systems like application server where there shall be lot of threads running always. Different kinds of requests are typically processed by separate threads.&lt;br /&gt;loggingOnAtStartup – if true, tracing shall start from application startup. It may produce lot of verbose output. If you want to trace only certain specific transactions . You can turn it false and start/stop tracing from jconsole.&lt;br /&gt;File/console – turn true/false appropriately to send the trace output to file (method_trace.log in the current directory of the application) or console window.&lt;br /&gt;&lt;br /&gt;3) start the application. Name of all instrumented classes are printed out to the console. If classes from any of the packages of not interest are instrumented, you can modify the tracer.properties file (includePackages/excludePackages). (requires re-start of the application).&lt;br /&gt;&lt;br /&gt;4) start jconsole and connect to this application. Jconsole is tool comes along with JDK. You can start jconsole by executing the jconsole.exe in the JDK/bin directory. While start up it will display the list of all available JVMs in the machine and ask to choose the one to connect. Choose the JVM of your application. Goto the ‘MBeans’ tab. Expand tracer &gt;&gt; custom &gt;&gt; configuration &gt;&gt; operations. Use enableLogging method to start/stop logging (as Boolean as parameter). Use addThread and removeThread to trace one (or list of) thread (name of the thread as parameter. You can see the list of all threads and it’s name from the ‘Threads’ tab. Copy the name from that tab and paste it here.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Hit9aXPuEPE/SeqMmqR4meI/AAAAAAAACgQ/zeOo9l39b5k/s1600-h/jconsole.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://3.bp.blogspot.com/_Hit9aXPuEPE/SeqMmqR4meI/AAAAAAAACgQ/zeOo9l39b5k/s320/jconsole.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5326224105131252194" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;5) go to the jconsole &gt; MBean tab, go to tracer &gt;&gt; custom &gt;&gt; configuration &gt;&gt; operations&lt;br /&gt; a) select appropriate threads for tracing.&lt;br /&gt; b) start logging (enableLogging method)&lt;br /&gt;&lt;br /&gt;6) invoke the operation/transaction of your application, to be traced.&lt;br /&gt;&lt;br /&gt;7) stop the logging from jconsole (enableLogging method in jconsole)&lt;br /&gt;&lt;br /&gt;8) Open the method_trace.log file in the current directory.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How Method Tracing works?&lt;/strong&gt;&lt;br /&gt;It uses dynamic byte code instrumentation. It uses java.lang.instrument.* classes for bytecode instrumentation. It uses ASM Framework for modifying byte code. It modifies the byte code while loading the classes into JVM by Class Loader. The class files in the jar is not being modified.&lt;br /&gt;It inserts tracing code at the beginning and end of each method.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Is it modifies your application binary?&lt;/strong&gt;&lt;br /&gt;No. It modifies the byte code while loading the classes into JVM by Class Loader.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Is it recommended to use in production?&lt;/strong&gt;&lt;br /&gt;No. This is only beta quality and there shall be considerable overhead because of method tracing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7966387215600253176?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7966387215600253176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7966387215600253176' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7966387215600253176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7966387215600253176'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/04/method-tracing.html' title='Method Tracing'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Hit9aXPuEPE/SeqMmqR4meI/AAAAAAAACgQ/zeOo9l39b5k/s72-c/jconsole.JPG' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7662414516050438586</id><published>2009-04-04T23:29:00.009+05:30</published><updated>2009-04-05T12:27:36.798+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Analyzing Memory Leak in Java Applications using VisualVM</title><content type='html'>&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;Memory Leak is a decease and OutOfMemoryError (OOM) is the symptom for that. However all OOM doesn’t necessarily implies Memory Leak. OOM can happen due to the generation of large number of local variables – particularly with large number of concurrent requests (in the case of server applications). On the other hand all memory leaks not necessarily manifest into OOM – especially in the case of desktop applications or client applications (those are not run for long without restart).&lt;br /&gt;Memory leaks also can be in heap, perm space, or in native memory. &lt;br /&gt;Following section talks only about memory leak in heap. How to verify that memory leak is the reason for OOM in your case is also out of scope (probably will discuss some other day). How to attack memory leaks in perm space is also out of scope (again another day’s work). I have absolutely no clue about debugging memory leak in native memory (Google search with error messages).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Memory leak in heap&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1) Run the application with latest available JDK (JDK 1.6 as of now). New versions of java contain lot of improvements in debugging tools. Run the application with different operations repeatedly to identify the operation that causes memory leak. We don’t need to wait until OOM to identify memory leak. Monitoring the heap using any tool can identify memory leak. Run the application until it reaches a steady state. Monitor the heap size over a period of time. If the ‘heap size after full GC’ (full GC remember) increases each time, that implies a memory leak. We can use visualVM also for this purpose.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Hit9aXPuEPE/SdehiGyeDiI/AAAAAAAACfA/DPBW2k9Tidk/s1600-h/gc.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://4.bp.blogspot.com/_Hit9aXPuEPE/SdehiGyeDiI/AAAAAAAACfA/DPBW2k9Tidk/s320/gc.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320899092071452194" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Now we have identified the operation that causes memory leak – means if we invoke this operation repeatedly we will get OOM. (What if we could not identify the operation that causes memory leak?). Now onwards we assume that this operation runs continuously.&lt;br /&gt;&lt;br /&gt;2) Install VisualVM (https://visualvm.dev.java.net/download.html). You need to install VisualVM separately – unlike many other java debugging tools this one doesn’t come along with JDK [ Thanks to Jiri Sedlacek's comment! VisualVM is part of JDK from jdk1.6 update 7 onwards ]. Just unzip the file to any convenient location.&lt;br /&gt;&lt;br /&gt;3) Run visualVM - you can run visualvm by executing ‘visualvm.exe in the bin directory. (You should have jdk 1.6 in path?)&lt;br /&gt;&lt;br /&gt;4) Connect to the application – all the java processes running in the machine are listed in the left side pane (name of the main class shall be listed). You can double click the one you are interested. Right side there are four tabs – monitor and profiler are the ones we are interested in.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Hit9aXPuEPE/SdeidOj-HNI/AAAAAAAACfI/JfcUWxkREhc/s1600-h/application.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://4.bp.blogspot.com/_Hit9aXPuEPE/SdeidOj-HNI/AAAAAAAACfI/JfcUWxkREhc/s320/application.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320900107770404050" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;5) Go to the profiler tab. Check the settings checkbox it will display different options. Go to the memory settings tab. Check the ‘record allocations stack traces’. Uncheck the ‘settings’ checkbox; that will close the settings options display (all changes are automatically saved). &lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Hit9aXPuEPE/SdeiwMhMRhI/AAAAAAAACfQ/qKsaYHQot58/s1600-h/settings.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://2.bp.blogspot.com/_Hit9aXPuEPE/SdeiwMhMRhI/AAAAAAAACfQ/qKsaYHQot58/s320/settings.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320900433639392786" /&gt;&lt;/a&gt; &lt;br /&gt;6) Now click on the ‘memory’ button – this will start memory profiling. Wait for few seconds – it will take a while. A tabular display of different classes, its instance count, total byte size etc are displayed. &lt;br /&gt;7) Wait for a while to allow the application to be in stead state. &lt;br /&gt;8) Take a snapshot of the objects by clicking the button on top of the tabular view (see below screen shot). A snapshot is generated and labeled in the left side pane as well as opened in the right side pane.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Hit9aXPuEPE/SdejSsOWzcI/AAAAAAAACfY/QaQjLHNhk7w/s1600-h/settings.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://2.bp.blogspot.com/_Hit9aXPuEPE/SdejSsOWzcI/AAAAAAAACfY/QaQjLHNhk7w/s320/settings.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320901026265877954" /&gt;&lt;/a&gt; &lt;br /&gt;9) Wait for some more time to allow some memory leak. Take one more snapshot as explained in the previous step. Now we have two snapshots displayed at the left side pane (also opened in the right side pane).&lt;br /&gt;10) Select both of these snapshots (in the left side pane, by using ‘ctrl’ button we can select multiple items), right click and select ‘compare’. A comparison tab shall be opened in the right side pane. That tab will display items that have been increased during the interval of first and second snapshot. &lt;strong&gt;The top item is the suspect of memory leak&lt;/strong&gt;.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Hit9aXPuEPE/SdejlB84IPI/AAAAAAAACfg/k9bSRC5ccns/s1600-h/compare.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://2.bp.blogspot.com/_Hit9aXPuEPE/SdejlB84IPI/AAAAAAAACfg/k9bSRC5ccns/s320/compare.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320901341335789810" /&gt;&lt;/a&gt; &lt;br /&gt;11) Go to the profiler tab again. Select the identified item in the previous step. Right click and select ‘Take snapshot and show allocation stack traces’. One more snapshot is generated. This time in the right side pane, an allocation stack traces sub tab also visible. It lists different places where this particular item is instantiated and it’s percentage of total count.&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Hit9aXPuEPE/Sdej8Slg68I/AAAAAAAACfo/AWK0C15GY9U/s1600-h/allocation_stack.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://3.bp.blogspot.com/_Hit9aXPuEPE/Sdej8Slg68I/AAAAAAAACfo/AWK0C15GY9U/s320/allocation_stack.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320901740938193858" /&gt;&lt;/a&gt; &lt;br /&gt;12) Wait for some more time to have more memory leak. Take one more snapshot with allocation stack traces. &lt;br /&gt;13) Take a heap dump of the application. We can take heap dump by right clicking the application in the left side pane and select ‘heap dump’. Heap dump is also displayed in the left side pane as well as opened in the right side pane.&lt;br /&gt;13) Now come back to the tow snapshots with stack traces. Compare these two snapshots with allocation stack traces. Identify the methods where there is large difference in contribution to total count. &lt;strong&gt;These are the places where leaked objects are instantiated&lt;/strong&gt;.&lt;br /&gt;14) Go to the heap dump tab in the right side pane. Go to the Classes view. Double click on the item identified in step 10. Instances of that class are displayed. Choose one instance which you feel could one of the leaked objects (just intuition). Look at the right bottom pane. Expand the view. You will find the objects that is holding referenced to the leaked objects. &lt;strong&gt;This is the reason for memory leak&lt;/strong&gt;. &lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_Hit9aXPuEPE/SdekPODLOWI/AAAAAAAACfw/q0mgHcYsAKc/s1600-h/references.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 233px;" src="http://1.bp.blogspot.com/_Hit9aXPuEPE/SdekPODLOWI/AAAAAAAACfw/q0mgHcYsAKc/s320/references.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5320902066137938274" /&gt;&lt;/a&gt; &lt;br /&gt;15) From the items identified in step 10, and clue we got from step 13 and 14 we could resolve the memory leak issues. &lt;strong&gt;We get the object which leaked, the place of instantiation, and the objects that hold reference to it&lt;/strong&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7662414516050438586?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7662414516050438586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7662414516050438586' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7662414516050438586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7662414516050438586'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/04/analyzing-memory-leak-in-java.html' title='Analyzing Memory Leak in Java Applications using VisualVM'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Hit9aXPuEPE/SdehiGyeDiI/AAAAAAAACfA/DPBW2k9Tidk/s72-c/gc.JPG' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-94474531842981214</id><published>2009-04-01T22:51:00.002+05:30</published><updated>2009-04-01T23:14:35.723+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Thread wise CPU monitoring for Java process</title><content type='html'>We come across many occations where java application is hung or slow with high CPU usage. We want to analyze which thread is causing this high CPU usage.&lt;br /&gt;Java 1.5 provides a API "ThreadMXBean.getThreadCPUTime()"&lt;br /&gt;We can use the following code in anywhere in the JVM to get the thread wise CPU usage of that JVM.&lt;br /&gt;ThreadMXBean threads = ManagementFactory.getThreadMXBean();&lt;br /&gt;ThreadInfo[] threadInfos = threads.getThreadInfo( threads.getAllThreadIds() );&lt;br /&gt;for( int i=0; i &amp;lt threadInfos.length; i++ )&lt;br /&gt;{&lt;br /&gt;    long cpuTimeCumulative = threads.getThreadCpuTime( threadInfos[ i ].getThreadId() ); // in nano seconds&lt;br /&gt;}&lt;br /&gt;There is a utility called JTop available with JDK 1.6 (JDK_insall_dir/demo/management/JTop). This can be invoked as a JConsole plugin as well.&lt;br /&gt;You can invoke the JConsole with plugin as follows:&lt;br /&gt;&lt;jdk_install_dir&gt;/bin/jConsole.exe -pluginpath &lt;path_of_JTop.jar&gt;&lt;br /&gt;eg: c:/jdk160/bin/jConsole.exe -pluginpath c:/jdk160/demo/management/JTop/JTop.jar&lt;br /&gt;The default JTop shows only the cumulative CPU time (not the current CPU usage as if in Task manager).&lt;br /&gt;I have modified the JTop little bit to include the current CPU usage as well.&lt;br /&gt;You can download the modified JTop.jar from the following path.&lt;br /&gt;&lt;a href="http://rejeev.googlepages.com/JTop.jar"&gt;http://rejeev.googlepages.com/JTop.jar&lt;/a&gt;&lt;br /&gt;This will help us to identify the threads causing high CPU. Typically this will help us to resolve infinite loop issues.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-94474531842981214?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/94474531842981214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=94474531842981214' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/94474531842981214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/94474531842981214'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/04/thread-wise-cpu-monitoring-for-java.html' title='Thread wise CPU monitoring for Java process'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3101463492114138637</id><published>2009-02-08T15:43:00.003+05:30</published><updated>2009-02-08T16:02:21.061+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Emails with inline Images</title><content type='html'>If you want to send a Email with an image inline, you can do that from Outlook or many other mail clients supports that. However if you send the mail programatically how do you do that?&lt;br /&gt;1) Attach the image with the mail using MIME content type "multipart/related".&lt;br /&gt;2) Set "Content-Id" header (eg Content-Id="image1")&lt;br /&gt;3) In the HTML body of the email, include the image by &lt;img src="cid:image1"/&gt;&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://java.sun.com/developer/EJTechTips/2004/tt0625.html#1"&gt;http://java.sun.com/developer/EJTechTips/2004/tt0625.html#1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ietf.org/rfc/rfc2387.txt"&gt;http://www.ietf.org/rfc/rfc2387.txt&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3101463492114138637?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3101463492114138637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3101463492114138637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3101463492114138637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3101463492114138637'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2009/02/emails-with-inline-images.html' title='Emails with inline Images'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2841999757488611754</id><published>2008-11-18T08:46:00.001+05:30</published><updated>2008-11-18T08:46:28.423+05:30</updated><title type='text'>Heard of Tell-a-Friend from SocialTwist?</title><content type='html'>&lt;p&gt;I am posting this using a new service called Tell-a-Friend from &lt;a href="http://www.socialtwist.com"&gt;SocialTwist&lt;/a&gt;. This service lets me announce about a site or a blog to my friends using Email, IM, Blogs and Social Networks. It can be used to spread the word about search engines results or interesting product offers, blog posts, etc.&lt;/p&gt;&lt;p&gt;This is so different from other such services because:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Users can reach out to friends across social networks&lt;/li&gt;&lt;li&gt;Simpler and faster means to spread the word&lt;/li&gt;&lt;li&gt;Default context-rich message which can be personalized&lt;/li&gt;&lt;li&gt;Wide range of buttons and widget themes&lt;/li&gt;&lt;li&gt;No sign up, risk-free option&lt;/li&gt;&lt;li&gt;No need to copy-paste widget for every change of widget configuration&lt;/li&gt;&lt;li&gt;Incisive analytics to measure spread&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;You can add it to your site or blog for free at: &lt;a href="http://tellafriend.socialtwist.com:80/web/redirect.jsp?-294635142565790415911"&gt;tellafriend.socialtwist.com&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2841999757488611754?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2841999757488611754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2841999757488611754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2841999757488611754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2841999757488611754'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/11/heard-of-tell-friend-from-socialtwist.html' title='Heard of Tell-a-Friend from SocialTwist?'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6927440779506598930</id><published>2008-11-07T21:57:00.003+05:30</published><updated>2008-11-07T22:12:24.981+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>My Bookshelf</title><content type='html'>Recommended Books&lt;br /&gt;&lt;ul style="line-height:100%"&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Effective-Executive-Peter-F-Drucker/dp/0887306128"&gt;Effective Executive - Peter Drucker&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/How-Win-Friends-Influence-People/dp/0671723650"&gt;How to Win Friends and Influence People - Dale Carngie&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Joel-Software-Occasionally-Developers-Designers/dp/1590593898"&gt;Joel on Software - Joel Spolsky&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Applied-Cryptography-Protocols-Algorithms-Source/dp/0471117099"&gt;Applied Cryptography - Bruce Schneier&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Secrets-Lies-Digital-Security-Networked/dp/0471253111"&gt;Secrets &amp;amp; Lies - Bruce Schneier&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262032937"&gt;Introduction to Algorithms - Thomas H Cormen, Charles E Leiserson, Ronald L Rivest, Clifford Stein&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Computer-Organization-Carl-Hamacher/dp/0072320869"&gt;Computer Organization - Carl Hamacher, Zvonko Vranesic, Safwat Zaky&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/One-Two-Three-Infinity-Speculations/dp/0486256642"&gt;One, Two, Three Infinity - George Gamov&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Problems in Solid Geometry - ?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628"&gt;C Programming Language - Brian W. Kernighan, Dennis M. Ritchie&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.pearson.ch/Informatik/Softwareentwicklung/EntwurfsmusterPatterns/1471/9780321127426/Patterns-of-Enterprise-Application.aspx"&gt;Patterns of Enterprise Application Architecture - Martin Fowler&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.co.uk/Atkinson-Hilgards-Introduction-Psychology-Edward/dp/0155050699"&gt;Introduction to Psychology - Antkinson, Antkinson and Antkinson&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Rise-Third-Reich-William-Shirer/dp/0671728687"&gt;The Rise and Fall of the Third Reich - William L. Shirer&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Emperors-New-Mind-Roger-Penrose/dp/0140145346"&gt;The Emperor's New Mind - Roger Penrose&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.sun.com/books/catalog/gosling_JPL4.xml"&gt;Java Programming Language - James Gosling, Ken Arnold and David Holmes&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Inside-Java-Virtual-Machine-Venners/dp/0071350934"&gt;Inside the Java Virtual Machine - Bill Venners&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Habits-Highly-Effective-People/dp/0671708635"&gt;The 7 Habits of Highly Effective People - Stephen R. Covey&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://he-cda.wiley.com/WileyCDA/HigherEdTitle/productCd-0470128720.html"&gt;Operating System Concepts - Silberschatz, Galvin, Gagne&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;Wish List&lt;br /&gt;&lt;ul style="line-height:100%"&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/All-Marketers-Are-Liars-Authentic/dp/1591841003"&gt;All Marketers Are Liars - Seth Godin&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670"&gt;Code Complete - Steve McConnell&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Software-Estimation-Demystifying-Practices-Microsoft/dp/0735605351"&gt;Software Estimation - Steve McConnell&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Rapid-Development-Taming-Software-Schedules/dp/1556159005"&gt;Rapid Development - Steve McConnell&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/More-Joel-Software-Occasionally-Developers/dp/1430209879"&gt;More Joel on Software - Joel Spolsky&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Meatball-Sundae-Your-Marketing-Sync/dp/1591841747"&gt;Meatball Sundae - Seth Godin&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Tribes-We-Need-You-Lead/dp/1591842336"&gt;Tribes - Seth Godin&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Art-Computer-Programming-Volumes-Boxed/dp/0201485419"&gt;Art of Computer Programming, Volumes 1-3 - Donald E. Knuth&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Peopleware-Productive-Projects-Teams-Second/dp/0932633439"&gt;Peopleware - Tom DeMarco, Timothy Lister&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Mythical-Man-Month-Software-Engineering-Anniversary/dp/0201835959"&gt;The Mythical Man-Month - Frederick P. Brooks&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Writing-Effective-Cases-Software-Development/dp/0201702258"&gt;Writing Effective Use Cases - Alistair Cockburn&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Programming-Pearls-Press-Louis-Bentley/dp/0201103311"&gt;Programming Pearls - Jon Bentley&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/GUI-Bloopers-Developers-Interactive-Technologies/dp/1558605827"&gt;GUI Bloopers - Jeff Johnson&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Design-Everyday-Things-Donald-Norman/dp/0465067107"&gt;The Design of Everyday Things - Donald A. Norman&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Common-Approach-Usability-Circle-Com-Library/dp/0789723107"&gt;Don't Make Me Think: A Common Sense Approach to Web Usability - Steve Krug&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Software-Requirements-Second-Pro-Best-Practices/dp/0735618798"&gt;Software Requirements - Karl E. Wiegers&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Psychology-Computer-Programming-Silver-Anniversary/dp/0932633420"&gt;The Psychology of Computer Programming - Gerald M. Weinberg&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Refactoring-Improving-Existing-Addison-Wesley-Technology/dp/0201485672"&gt;Refactoring: Improving the Design of Existing Code - Martin Fowler, Kent Beck, John Brant, William Opdyke, Don Roberts&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering/dp/0262011530"&gt;Structure and Interpretation of Computer Programs - Harold Abelson, Gerald Jay Sussman, Julie Sussman&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/User-Interface-Design-Programmers-Spolsky/dp/1893115941"&gt;User Interface Design for Programmers - Joel Spolsky&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Release-Production-Ready-Software-Pragmatic-Programmers/dp/0978739213"&gt;Release It!: Design and Deploy Production-Ready Software - Michael Nygard&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Practical-Guide-Successful-Software-Projects/dp/0974514047"&gt;Ship it! A Practical Guide to Successful Software Projects - Jared Richardson, William Gwaltney&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Manage-Modern-Pragmatic-Project-Management/dp/0978739248"&gt;Manage It!: Your Guide to Modern, Pragmatic Project Management - Johanna Rothman&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Refactoring-Databases-Evolutionary-Addison-Wesley-Signature/dp/0321293533"&gt;Refactoring Databases: Evolutionary Database Design - Scott W. Ambler, Pramodkumar J. Sadalage&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.co.uk/Beyond-Software-Architecture-Sustaining-Addison-Wesley/dp/0201775948"&gt;Beyond Software Architecture: Creating and Sustaining Winning Solutions - Luke Hohmann&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.co.uk/Beautiful-Code-Leading-Programmers-Practice/dp/0596510047"&gt;Beautiful Code: Leading Programmers Explain How They Think - Andy Oram, Greg Wilson&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Software-Project-Survival-Guide-Practices/dp/1572316217"&gt;Software Project Survival Guide - Steve McConnell&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.co.uk/Crystal-Clear-Human-Powered-Methodology-Small/dp/0201699478"&gt;Crystal Clear: A Human-Powered Methodology for Small Teams - Alistair Cockburn&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Making-Things-Happen-Mastering-Management/dp/0596517718"&gt;Making Things Happen: Mastering Project Management - Scott Berkun&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/UML-Distilled-Standard-Modeling-Language/dp/020165783X"&gt;UML Distilled: A Brief Guide to the Standard Object Modeling Language - Martin Fowler&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Deadline-Novel-About-Project-Management/dp/0932633390"&gt;The Deadline: A Novel About Project Management - Tom DeMarco&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Enterprise-Integration-Patterns-Designing-Addison-Wesley/dp/0321200683"&gt;Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions - Gregor Hohpe, Bobby Woolf&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Software-Security-Building-Addison-Wesley/dp/0321356705"&gt;Software Security: Building Security In - Gary McGraw&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Agile-Software-Development-Cooperative-Game/dp/0321482751"&gt;Agile Software Development: The Cooperative Game - Alistair Cockburn&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Applying-UML-Patterns-Introduction-Object-Oriented/dp/0131489062"&gt;Applying UML and Patterns - Craig Larman&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Pragmatic-Programmer-Journeyman-Master/dp/020161622X"&gt;The Pragmatic Programmer: From Journeyman to Master - Andrew Hunt, David Thomas&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Mastering-Regular-Expressions-Second-Jeffrey/dp/0596002890"&gt;Mastering Regular Expressions - Jeffrey Friedl&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Getting-Yes-Negotiating-Agreement-Without/dp/0395631246"&gt;Getting to Yes: Negotiating Agreement Without Giving In - Roger Fisher; William L. Ury; Editor-Bruce Patton&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Influence-Psychology-Persuasion-Robert-Cialdini/dp/0688128165"&gt;Influence: The Psychology of Persuasion - Robert B. Cialdini&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Secrets-Consulting-Giving-Getting-Successfully/dp/0932633013"&gt;Secrets of Consulting: A Guide to Giving and Getting Advice Successfully - Gerald M. Weinberg&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Non-Designers-Design-Book-Typographic-Principles/dp/1566091594"&gt;Non-Designer's Design Book - Robin Williams&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/After-Gold-Rush-Profession-Engineering/dp/0735608776"&gt;After the Gold Rush: Creating a True Profession of Software Engineering - Steve McConnell&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6927440779506598930?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6927440779506598930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6927440779506598930' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6927440779506598930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6927440779506598930'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/11/my-bookshelf.html' title='My Bookshelf'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6906856899961569774</id><published>2008-11-02T16:50:00.002+05:30</published><updated>2010-12-19T16:03:31.581+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='others'/><title type='text'>Software Estimation - Overestimation Vs Underestimation</title><content type='html'>I was reading Steve McConnell's book - Software Estimation. He has discussed about the advantages and disadvantages of Over estimation and under estimation.&lt;br /&gt;Arguments against over estimation - (1) Parkinson's law - work will expand to fill the available time. (2) Goldratt's Student's Syndrome - developers will procrastinate until late in the project and then rush to complete the work.&lt;br /&gt;However I think He missed one important disadvantage of over estimation - Lost opportunity. When we overestimate we are forced to cut off some feature unnecessary or delay the shipping date unnecessary. In either way it is lost opportunity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6906856899961569774?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6906856899961569774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6906856899961569774' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6906856899961569774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6906856899961569774'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/11/software-estimation-overestimation-vs.html' title='Software Estimation - Overestimation Vs Underestimation'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-521430365375024902</id><published>2008-09-18T18:19:00.004+05:30</published><updated>2008-09-20T14:28:00.254+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>HttpOnly Cookies and Java EE Application servers (WebLogic, WebSphere etc)</title><content type='html'>Most of the application servers (WebLogic, WebSPhere) are not supporting HttpOnly Cookies&lt;br /&gt;If you are not familiar with HttpOnly Cookies please see the posting of Jef &lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.codinghorror.com/blog/archives/001167.html" target="_blank"&gt;http://www.codinghorror.com/blog/archives/001167.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Currenlty there is no way to specify the session cookie as HttpOnly in most of the application servers.&lt;br /&gt;However you can work aroud this weekness by implemeting a custome cookie which is HttpOnly and the same can be set and tracked by a Servlet Filter. First time when the session is established this (httpOnly) cookie also set and subsequent request will be rejected if it not submitted with this httpOnly cookie along with session cookie.&lt;br /&gt;A sample Filter is available here -  &lt;a href="http://rejeev.googlepages.com/HttpOnlyCookieFilter.java"&gt;http://rejeev.googlepages.com/HttpOnlyCookieFilter.java&lt;/a&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-521430365375024902?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/521430365375024902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=521430365375024902' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/521430365375024902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/521430365375024902'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/09/httponly-cookies-and-java-ee.html' title='HttpOnly Cookies and Java EE Application servers (WebLogic, WebSphere etc)'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1165693115662017163</id><published>2008-09-11T14:16:00.004+05:30</published><updated>2010-12-19T16:04:52.012+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Session Tracking with SSL in WebLogic</title><content type='html'>When we are using SSL, there are two session ids and they are put in two separate cookies. _wl_authcookie_ is a secure cookie.&lt;br /&gt;1) JSESSIONID&lt;br /&gt;2) _wl_authcookie_&lt;br /&gt;All SSL requests should contain both cookies otherwise the request will not be considered as authenticated. Non SSL (HTTP) requests needs to contain only the JSESSIONID cookie.&lt;br /&gt;The sad thing is that WebLogic's implementation of URLConnection's 'getHeaderField("Set-Cookie")' returns only one cookie (whichever comes first). If you want to get both cookies you need to use 'getHeaderFields()' and look for the entry with key "Set-Cookie". To set cookie we need to use URLConnection.setRequestProperty("cookies") and we need to pass both cookies with semi colon (;) as separator.&lt;br /&gt;If cookies are disabled then URL rewrite shall be used for session tracking. However you don't need to pass both cookies for SSL; only the JSESSIONID cookie will do. With SSL, URL rewrite will work only if either of the following is configured&lt;br /&gt;1) EnableCookie=false in weblogic.xml&lt;br /&gt;2) AuthCookieEnabled=false in config.xml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1165693115662017163?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1165693115662017163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1165693115662017163' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1165693115662017163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1165693115662017163'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/09/session-tracking-with-ssl-in-weblogic.html' title='Session Tracking with SSL in WebLogic'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5184385778930015020</id><published>2008-08-23T00:10:00.002+05:30</published><updated>2010-12-19T16:13:50.146+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>MemoryLeak Analysis using Java SE 6</title><content type='html'>If you are having a memory leak you will get OutOfMemoryError (OOM). You may get OOM even if you are not having memory leak if the following cases&lt;br /&gt;a) Huge amount of local variables (short living objects)&lt;br /&gt;b) Large number of concurrent threads running&lt;br /&gt;c) Complex application and insufficient amount of heap size (memory required for long living objects)&lt;br /&gt;You can conclude if there is a memory leak or not by analyzing the jstat report (jstat -gc &lt;pid&gt; 30s) or by analyzing the &lt;a href="http://rejeev.googlepages.com/jconsole.JPG"&gt;jConsole graph&lt;/a&gt;.&lt;br /&gt;If the bottom of the zig zag graph keep increasing there is a memory leak.&lt;br /&gt;If the bottom of the zig zag graph is greater than the available heap then it is condition (c)&lt;br /&gt;If the peak of zig zag graph is greater than the heap then it is condition (a)&lt;br /&gt;OOM could in heap area, permanent generation or in native memory area&lt;br /&gt;If OOM in heap then the message could be "OutOfMemoryError: Java heap space"&lt;br /&gt;If OOM in permanent generation then "OutOfMemoryError: PermGen space"&lt;br /&gt;If OOM in native area then "java.lang.OutOfMemoryError: request &lt;size&gt; bytes for &lt;reason&gt;. Out of swap space?"&lt;br /&gt;If you have memory leak in perm gen then verbose:class may help. You need to find out the class which is getting repeatedly loaded without getting unloaded.&lt;br /&gt;For native area, no specific tools available.&lt;br /&gt;If you have OOM in heap then you can use Jmap and jhat to analyze further.&lt;br /&gt;Use the application for a while. Repeat the operations which you suspect causing the memory leak.&lt;br /&gt;Take a heap dump of the JVM by jmap.exe -dump:live,format=b,file=heap1.dmp &lt;pid&gt;&lt;br /&gt;Repeat the suspecting operations further&lt;br /&gt;Take the heap dump again. Name the dump file heap2.dmp&lt;br /&gt;Run Jhat over both dumps jhat -J-Xmx512m -baseline heap1.dmp heap2.dmp&lt;br /&gt;In a browser type http://localhost:7000/histo/&lt;br /&gt;From the &lt;a href="http://rejeev.googlepages.com/histo1.JPG"&gt;histogram&lt;/a&gt;, find out the classes which is having highest total size. These are suspected classes for memory leak.&lt;br /&gt;Click one class, another page opens where you can see all instances of that class. New Instances are marked new.&lt;br /&gt;Click one instance which is new. Another page opens where you see reference chain from root (use exclude weak ref)&lt;br /&gt;Click that link, which displays the reference from root to that instance, Study the path carefully. You may need do this analysis for couple of classes in the histogram, you will find some references which is otherwise not necessary.&lt;br /&gt;Study the source code remove that references.&lt;br /&gt;References&lt;br /&gt;&lt;a href="http://java.sun.com/developer/technicalArticles/J2SE/monitoring/"&gt;http://java.sun.com/developer/technicalArticles/J2SE/monitoring/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html"&gt;http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5184385778930015020?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5184385778930015020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5184385778930015020' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5184385778930015020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5184385778930015020'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/08/memoryleak-analysis-using-java-se-6.html' title='MemoryLeak Analysis using Java SE 6'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8712568818323276375</id><published>2008-08-13T23:12:00.002+05:30</published><updated>2008-08-13T23:24:09.323+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Information Card</title><content type='html'>Probably the new Buzzword in Security realm is going to be Information Card (InfoCard, CardSpace etc), This time from Microsoft!&lt;br /&gt;Basically information Card is using Public key/private key for authentication (kind of Client_CERT authentication). Your key combination (is called card; you can have n number of cards) are stored in Identity Selector (Control Panel &gt; Windows CardSpace; You need to install it in Windows XP as part of .NET Framework 3.0). When you sign up a account in a website, you will send this card first time to the website. In subsequent sign in you need to send the card for authentication. You can use either self signed cards (personal card) or cards signed by CAs (managed cards). You can optionally secure your cards in the machine using a PIN.&lt;br /&gt;However roaming (using the card from some other machine) with Information Card is still not a viable option (you need to export and import)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8712568818323276375?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8712568818323276375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8712568818323276375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8712568818323276375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8712568818323276375'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/08/information-card.html' title='Information Card'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6595192542573555290</id><published>2008-08-13T23:00:00.004+05:30</published><updated>2010-12-19T16:06:05.993+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Thread dump for javaw and java as windows service</title><content type='html'>I have been looking for a way to take thread dump for java started using javaw.exe and java installed as windows service. I have come across a wonderful tool called AdaptJ (www.adaptj.com). It has a wonderful GUI.&lt;br /&gt;It lists all the running JVMs in the machine (including the ones inside browser, inbedded in other executables etc) with meaningful descriptions to identify the process&lt;br /&gt;You can select any JVM and take thread dump&lt;br /&gt;It also shows the system properties, and memory parameters&lt;br /&gt;There is beanshell and a number of commands are available to debug the running JVM.&lt;br /&gt;You can change the log level (java.util.logging, and log4j)&lt;br /&gt;You can trace AWT events&lt;br /&gt;You can monitor file sytem, network access by the JVM&lt;br /&gt;And much more!!!&lt;br /&gt;A cool tool&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6595192542573555290?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6595192542573555290/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6595192542573555290' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6595192542573555290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6595192542573555290'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/08/thread-dump-for-javaw-and-java-as.html' title='Thread dump for javaw and java as windows service'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5117608000462192263</id><published>2008-08-11T10:46:00.003+05:30</published><updated>2010-12-19T16:02:40.734+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Database modularity in Enterprise Application Architecture</title><content type='html'>One of the toughest challenges I have faced in Enterprise Application Architecture is on achieving modularity in Database design.&lt;br /&gt;Typically you need to retrieve data based on filter conditions depending on tables across the modules. You can write SQL queries joining tables from multiple modules.&lt;br /&gt;You have three options now; (a) allow this; you end up compromise modularity and finding out dependencies become difficult. (b) prohibit this; data retrieval will become less efficient. (c) Yet another approach could be duplicating frequently used static data in both modules.&lt;br /&gt;Probably combination (b) and (c) could be good approach! Allow some data duplication across the modules; Compromise some performance for the sake of modularity.&lt;br /&gt;Here it is very critical to decide the boundaries of the modules very wisely. If you have too fine grained modules performance impact and data duplication will too much. If decide too course grained modules the maintainability will be reduced (impact analysis of change will be difficult)&lt;br /&gt;In most of the applications you will have n number of functional modules and one master module (module which contain entities like users, departments, locations etc).  You need to access data from master module in all functional modules. The interaction between master data and functional module will be too large to consider as separate modules. All functional modules will have such dependency with master data. (a) One approach could be to consider master data as part of all modules (disadvantage of this will be that any change in master data design will have impact across the application); (b) another approach is to consider master data as an independent module (disadvantage of this shall be the performance loss and data duplication). I would prefer approach (a)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5117608000462192263?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5117608000462192263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5117608000462192263' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5117608000462192263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5117608000462192263'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/08/database-modularity-in-enterprise.html' title='Database modularity in Enterprise Application Architecture'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2300191417632615721</id><published>2008-08-06T09:39:00.002+05:30</published><updated>2008-08-06T09:46:51.955+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Enterprise Application Architecture - Is the OR framework worth?</title><content type='html'>Most of the Literature (&lt;a href="http://www.martinfowler.com/books.html#eaa"&gt;http://www.martinfowler.com/books.html#eaa&lt;/a&gt;) describes following as the main architecture patterns for Domain Logic&lt;br /&gt;Transaction Script&lt;br /&gt;Domain Model&lt;br /&gt;Table Module&lt;br /&gt;Domain Model is considered to be the pure Object Oriented Design pattern&lt;br /&gt;Most of the enterprise applications are data intensive and data retrieval (select query in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SQL&lt;/span&gt;) will be very ineffective unless we use appropriate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQL&lt;/span&gt; query joining multiple tables with appropriate filter conditions. This is the compelling reason or using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;RDBMS&lt;/span&gt; for persisting enterprise data (along with transactional capabilities and data recovery).&lt;br /&gt;If we use pure Object Oriented model (as described in most of the literature) we need to map one Entity per table (table in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;RDBMS&lt;/span&gt;). This will limit the usage of appropriate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;SQL&lt;/span&gt; queries for data retrieval.&lt;br /&gt;One strategy adopted in many cases are bypassing Entities for data retrieval and using Entities only for Create, Update and Delete. Data retrieval will be directly from Service Layer (&lt;a href="http://www.martinfowler.com/eaaCatalog/serviceLayer.html"&gt;http://www.martinfowler.com/eaaCatalog/serviceLayer.html&lt;/a&gt;) through Data Source Layer (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SQLDAO&lt;/span&gt;).&lt;br /&gt;If we decide to adopt this strategy then Is it really worth using the Entity Layer for create, modify and delete? What are the advantages of using Entity layer?&lt;br /&gt;In my option the main advantage of using Entity layer is elimination of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;SQL&lt;/span&gt; query writing for update by using some OR mapping frameworks. Writing &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;SQL&lt;/span&gt; for update is complex. You may have a table with 50 columns and you have a screen where all 49 (excluding primary key) columns are editable and user may be modifying only one or two. Hence you need to dynamically generate the update statement based on the columns modified. If you are using a OR framework, framework will do this for you!&lt;br /&gt;If you have small utility for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;SQL&lt;/span&gt; query generation based on the modified values (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;eg&lt;/span&gt;: &lt;a href="http://ws.apache.org/jaxme/js/sql.html#Creating+an+UPDATE+statement"&gt;http://ws.apache.org/jaxme/js/sql.html#Creating+an+UPDATE+statement&lt;/a&gt;) this problem can be easily solved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2300191417632615721?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2300191417632615721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2300191417632615721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2300191417632615721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2300191417632615721'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/08/enterprise-application-architecture-is.html' title='Enterprise Application Architecture - Is the OR framework worth?'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-4598413092613567837</id><published>2008-07-06T07:56:00.003+05:30</published><updated>2008-07-06T08:00:59.360+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Brand loyalty - Woodland</title><content type='html'>I typically don't display brand loyalty however there are two exceptions. Google and woodlands ( &lt;a href="http://www.woodlandworldwide.com"&gt;www.woodlandworldwide.com&lt;/a&gt; ) . Apparels and shoes from Woodland are excellent quality and of reasonably priced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-4598413092613567837?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.woodlandworldwide.com/' title='Brand loyalty - Woodland'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/4598413092613567837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=4598413092613567837' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4598413092613567837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4598413092613567837'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/07/brand-loyalty-woodland.html' title='Brand loyalty - Woodland'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6875024772323714207</id><published>2008-07-06T07:26:00.002+05:30</published><updated>2008-07-06T07:46:34.545+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Oracle and bind variable peeking</title><content type='html'>Oracle query optimizer considers the input values also while selecting the execution plan. Consider:&lt;br /&gt;Select * from order where date between ?1 and ?2&lt;br /&gt;the execution plan depends on the values of ?1 and ?2 while you execute the first time. It could be a index range scan if the dates are narrow or it could be a full table scan if the dates are wider. During subsequent executions even if the date range varies considerably the execution plan remain same. A side effect of execution plan re-use. This also implies that first execution has an impact on execution plan. Would it be a good practice to initialize the queries with sample values during application start up?&lt;br /&gt;What will you do if you have a query which will have varying cardinality? I would recommend two options&lt;br /&gt;1) if your requirement is two different scenarios one for displaying current orders (with narrow date range and smaller cardinality) and other for statistics processing program (with wider date range and larger cardinality). You may consider writing two separate SQLs&lt;br /&gt;Select * from order o_small where date between ?1 and ?2&lt;br /&gt;Select * from order o_large where date between ?1 and ?2&lt;br /&gt;2) If you cannot predict the cardinality, Don't use bind variable&lt;br /&gt;I think this feature is available from Oracle 9i&lt;br /&gt;However Oracle thin driver 9.x doesn't support bind variable peeking. You need to use thin driver 10g (refer &lt;a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:19398056075583"&gt;Ask Tom&lt;/a&gt; )&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6875024772323714207?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6875024772323714207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6875024772323714207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6875024772323714207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6875024772323714207'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/07/oracle-and-bind-variable-peeking.html' title='Oracle and bind variable peeking'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6264786197449497792</id><published>2008-07-06T07:12:00.003+05:30</published><updated>2008-07-06T07:22:54.692+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Java Obfuscator</title><content type='html'>We had a requirement to Obfuscate our client (We have Swing based think client) binaries. Most of the resources on Internet recommended that Java obfuscation is waste of time. I disagree with that. I would say that Obfuscation useful as security mechanism as well as it helps in protecting your Intellectual Property (IP). A determined skilled attacker may be able to overcome this hurdle, however lot of naive onlookers will be stopped at this blockade.&lt;br /&gt;We were also looking for a good Java Obfuscating tool and found that not many available in the market. Finally we have decided for &lt;a href="http://www.zelix.com/klassmaster/"&gt;Zelix KlassMaster&lt;/a&gt; ( http://www.zelix.com/klassmaster ). I found it very good and priced reasonably.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6264786197449497792?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6264786197449497792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6264786197449497792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6264786197449497792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6264786197449497792'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/07/java-obfuscator.html' title='Java Obfuscator'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2730181697879694599</id><published>2008-06-30T12:08:00.003+05:30</published><updated>2008-06-30T12:22:00.369+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Execution plan for the queries in the statspack report and queries in top sql</title><content type='html'>Most of the time when I go through statspack report, I also wanted to view the execution plan for queries listed in the report.&lt;br /&gt;Similarly many times I wanted to view the top N expensive queries and it's plan in report. It is possible to navigate to the plan from top sql in Oracle Enterprise Manager. However you have to do it one by one. also you may not get the result in report form.&lt;br /&gt;The following two scripts can be used for these purposes.&lt;br /&gt;&lt;a href="http://rejeev.googlepages.com/stats_plan.sql"&gt;stats_plan.sql&lt;/a&gt;&lt;br /&gt;&lt;a href="http://rejeev.googlepages.com/topsql_plan.sql"&gt;topsql_plan.sql&lt;/a&gt;&lt;br /&gt;Note: Report for stats_plan needs to be run immediately after taking the snap otherwise you may not get all queries listed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2730181697879694599?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2730181697879694599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2730181697879694599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2730181697879694599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2730181697879694599'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/06/execution-plan-for-queries-in-statspack.html' title='Execution plan for the queries in the statspack report and queries in top sql'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5297412798574417023</id><published>2008-04-29T10:07:00.002+05:30</published><updated>2008-04-29T10:12:54.135+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>J2EE Security and JAAS</title><content type='html'>What is the authentication technology used in J2EE?&lt;br /&gt;There is a widespread mis-understanding that JAAS is the underlying security mechanism used in J2EE.&lt;br /&gt;J2EE spec requires Form, basic and cert authentication for Web Applications. However it doesn't specify any particular authentication technique for Application client (EJB, JMS clients).&lt;br /&gt;JAAS is not a supported authentication technique for Application clients. JAAS is a J2SE feature. It's scope is limited to single JVM. JAAS is supported in J2EE as a J2SE feature.&lt;br /&gt;If  you have a Application client you need to use Vendor specific code for authentication. It is not going to change in Java EE 5 or Java EE 6.&lt;br /&gt;I am really puzzled why it (an API for authentication) is not included in J2EE spec.&lt;br /&gt;If you consider WebLogic, WebLogic authentication mechanism (UsenamePasswordLoginModule) is something similar to JAAS (but not JAAS).&lt;br /&gt;J2EE security talks only about&lt;br /&gt;a) declarative authorization(via security constraint tag in deployment descriptors)&lt;br /&gt;b) programmatic authorization(via API - isCallerInRole, getCallerPrincipal, isUserInRole, getUserPrincipal)&lt;br /&gt;c) Authentication for web applications (basic, form, SSL mutual authentication)&lt;br /&gt;d) transport security (SSL - via transport-guarantee tag).&lt;br /&gt;Given below are few quotes from J2EE and EJB spec&lt;br /&gt;J2EE.3.4.2 Required Login Mechanisms&lt;br /&gt;All J2EE products are required to support three login mechanisms: HTTP basic authentication, SSL mutual authentication, and form-based login.&lt;br /&gt;J2EE.3.4.4 Application Client User Authentication&lt;br /&gt;The application client container must provide authentication of application users to satisfy the authentication and authorization constraints enforced by the enterprise bean containers and web containers. The techniques used may vary with the implementation of the application client container, and are beyond the control of the application.&lt;br /&gt;21.6.3 Security Mechanisms (EJB 2.1 spec)&lt;br /&gt;The EJB Container Provider must provide the security mechanisms necessary to enforce the security policies set by the Deployer. The EJB specification does not specify the exact mechanisms that must be implemented and supported by the EJB server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5297412798574417023?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5297412798574417023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5297412798574417023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5297412798574417023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5297412798574417023'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/04/j2ee-security-and-jaas.html' title='J2EE Security and JAAS'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-4147108748045388492</id><published>2008-04-26T15:33:00.001+05:30</published><updated>2008-04-26T15:36:46.295+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Update Query with Join in Oracle Database</title><content type='html'>Consider the tables&lt;br /&gt;Employee(empid, empname, salary, location)&lt;br /&gt;and the table&lt;br /&gt;Address(addId, houseNo, Street, city, country, empId)&lt;br /&gt;We want to update the location column with city column wherever the location is null.&lt;br /&gt;&lt;br /&gt;Update Employee e&lt;br /&gt;SET location = (select city from Address a where e.empid = a.empId)&lt;br /&gt;where location is null&lt;br /&gt;&lt;br /&gt;However if you have one million record in Employee table the sub query will execute as many times. It is going to take long.&lt;br /&gt;&lt;br /&gt;You can re-write the query as follows:&lt;br /&gt;Update&lt;br /&gt;(Select location ll, city cc from Employee e, Address a where e.empid = A.empId and e.location is null)&lt;br /&gt;SET ll = cc&lt;br /&gt;&lt;br /&gt;There are two conditions for above query&lt;br /&gt;1) You can update only columns from one table&lt;br /&gt;2) The second table (that is not being modified) must be key preserved - that is, there can be at most one in second table for each record in first table - that is, there should be a unique constraint in second table for the columns used join condition&lt;br /&gt;&lt;br /&gt;Second query is much cheaper than the first one when we have large number of records in both table (or in first table)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-4147108748045388492?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/4147108748045388492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=4147108748045388492' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4147108748045388492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4147108748045388492'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/04/update-query-with-join-in-oracle.html' title='Update Query with Join in Oracle Database'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-9005213607983011055</id><published>2008-04-11T12:18:00.002+05:30</published><updated>2008-04-11T12:22:46.368+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Messaging based transactions and Weblogic JMS Distributed queues</title><content type='html'>Assume you have system where you have implement asynchronous processing as below&lt;br /&gt;The client send the request to Session bean, which after some processing sends a message (with some correlation id) to a queue for further asynchronous processing. Another MDB process the message and sends the result back to another queue (with same correlation id). The client listen on the second queue (with selector for this particular correlation id) and updates it's state.&lt;br /&gt;This will work on Normal single JMS Server. However it will break on WebLogic Distributed JMS queues. When you establish a connection with Distributed queue, you establish connection with a member JMS and you will receive messages only from that queue, similarly when you send a message, that will be sent to only the member JMS where you are connected.&lt;br /&gt;That means you will not receive messages reached into the other member JMS server. For some of your requests you will never get responses because that requests reached the other Server.&lt;br /&gt;Solution: User topic and ignore messages with other correlation ids.&lt;br /&gt;Problem with Distributed topic&lt;br /&gt;When u send message to distributed topic that will be forwarded to other member JMS servers (to deliver message to the subscribers connected to other JMS servers). If one JMS server is down messages will be persisted and will be forwarded when the server comes up. The Topic subscriber was originally connected to first JMS server and received the topic. and now he got reconnected to second JMS server. Now the client will receive the message again from the second JMS server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-9005213607983011055?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/9005213607983011055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=9005213607983011055' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9005213607983011055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9005213607983011055'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/04/messaging-based-transactions-and.html' title='Messaging based transactions and Weblogic JMS Distributed queues'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-4661237483218240709</id><published>2008-03-07T22:09:00.002+05:30</published><updated>2008-03-07T22:45:03.180+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>J2EE Application Security</title><content type='html'>Digital Certificate based SSL for network security and Authentication/Authorization based on the security-constraints tag in deployment descriptors for Access Control is quite standard for J2EE Application.However that is not the end of protecting your J2EE Application.If yours is a Web Application, there are a number of application vulnerabilities which a attacker can make use of and get into your application. Please refer to OWASP Top Ten (&lt;a href="http://www.owasp.org/index.php/OWASP_Top_Ten_Project)for"&gt;http://www.owasp.org/index.php/OWASP_Top_Ten_Project)for&lt;/a&gt; list of most important Web Application vulnerabilities.Following are 3 most important (according to me) vulnerabilities for J2EE Web Application.&lt;br /&gt;1) Cross Site Scripting (XSS) - Assume you a Web page where user can enter some text data and another page where these use entered data is displayed (Some thing like 'add comment' and 'moderate comments' pages). An attacker may enter a script instead of text data in the input text area (eg: '[script]echo 'this is a sample attack'[/script]). When the somebody else (say administrator) opens the second page instead of the text being displayed the script shall be executed. This is called XSS.The solution for this kind of attach is:a) Validate all user inputs - in this case we should not allow patterns like [script]b) Encode all output content (not formatting metadata). If output is encoded even if [script] is present in the text, that will be displayed as [script] instead of executing.For practical purpose you need to validate input as well as encode output content.&lt;br /&gt;2) SQL Injection - Assume you have a authentication servlet. You store the username password in database use the following SQL for authentication. "select 1 from user_table where username = '" + username + "' and password = '" + password + "'"; An attacker may enter the following text as username and passwords&lt;br /&gt;Username = "abc' OR 1 = 1; --&lt;br /&gt;Password = xyz&lt;br /&gt;NOw the SQL becomes "select 1 from user_table where username = 'abc' OR 1 = 1; -- password = 'zyz'; which is all ways trueSolution for this kind of attack is Using PreparedStatement instead of Statement.&lt;br /&gt;3) Cross Site Request Forgery (CSRF) - Assume you are using FireFox and in one tab you have opened your web application. Now get a email (from attacker) with some links to some fancy pictures. Actually the link is to your application with query string indicating to do some operation. Since  you  are already logged in to the application it will not ask for authentication again. It will silently execute the operation. Solution for this kind of attack is to use a unique string (other than session id) to identify each session/request (It identifier could be per session or per request; per session is sufficient for most purposes). You need to attach this identifier to each form and link in your application. Validate all request for a valid identifier.&lt;br /&gt; Vulnerabilities in Swing clients&lt;br /&gt;1) SQL injection is equally valid in Thick clients. Solution is same - using Prepared statements&lt;br /&gt;2) Un protected JNDI objects - There is no standard way for protecting JNDI objects in J2EE. If an attacker can get hold of a DataSource or JMS Queue or topic he could access the application. or invoke SQL queries directly. Solution is to protect all JNDI resources in App server vendor specific way&lt;br /&gt;3) Unprotected EJBs - Some times In swing client you first log in and then navigate other screens to do operations hence even if the subsequent EJBs are not protected you may not notice it. However a attacker can write  own EJB client which can directly  invoke the un protected EJB Solution is to protect all the EJBs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-4661237483218240709?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/4661237483218240709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=4661237483218240709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4661237483218240709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4661237483218240709'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/03/j2ee-application-security.html' title='J2EE Application Security'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5712809659599123366</id><published>2008-03-06T17:15:00.002+05:30</published><updated>2008-03-06T17:21:35.395+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Transaction Management with Spring and Hibernate</title><content type='html'>Spring and Hibernate have features supporting Transaction Management. However Neither of them has a Transaction Manager and hence it on it's own cannot support XA Transactions (Global Transactions). If you like to use XA Transactions you need to use JTA service along with Spring or Hibernate. That means you have to run your application on a J2EE Application Server. There are some stand alone JTA implementations are available though (eg: JOTM, Atomikos).Without JTA Spring and Hibernate can support only local transactions. That means you have only one resource manager. Even though it looks very reasonable that may not be the case. Most of the enterprise applications shall be using one database and JMS (JMS is a resource manager). If you are having database and JMS you require XA Transaction (of course if you are using JMS for transactional purpose)&lt;br /&gt;References:&lt;br /&gt;&lt;a href="http://www.hibernate.org/42.html"&gt;http://www.hibernate.org/42.html&lt;/a&gt;&lt;br /&gt;&lt;a href="http://static.springframework.org/spring/docs/2.5.x/reference/transaction.html"&gt;http://static.springframework.org/spring/docs/2.5.x/reference/transaction.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5712809659599123366?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5712809659599123366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5712809659599123366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5712809659599123366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5712809659599123366'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/03/transaction-management-with-spring-and.html' title='Transaction Management with Spring and Hibernate'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5086192647269000293</id><published>2008-01-18T16:07:00.001+05:30</published><updated>2010-12-19T16:14:52.018+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>ClassLoaders and class visibility</title><content type='html'>&lt;p&gt;Assume you have one interface and one implemenation class &lt;/p&gt;&lt;p&gt;/* package */ interface com.abc.Xyz{&lt;/p&gt;&lt;p&gt;         ... &lt;/p&gt;&lt;p&gt;} &lt;/p&gt;&lt;p&gt;public class com.abc.XyzImpl implements Xyz {&lt;/p&gt;&lt;p&gt;         ... &lt;/p&gt;&lt;p&gt;} &lt;/p&gt;&lt;p&gt;Now if you keep Xyz in one classpath and XYZImpl in another classpath which is a child of former one you will get the following exception. &lt;/p&gt;&lt;p&gt;"java.lang.IllegalAccessError: class com.abc.XyzImpl cannot access its superinterface com.abc.Xyz" This is because eventhough both are in package, they are loaded by different classloaders and hence in different name space. If you define the package also public no issue else both class have to be loaded by the same classloader.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5086192647269000293?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5086192647269000293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5086192647269000293' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5086192647269000293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5086192647269000293'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/01/classloaders-and-class-visibility.html' title='ClassLoaders and class visibility'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-4612329262951556783</id><published>2008-01-09T15:27:00.000+05:30</published><updated>2008-01-09T17:05:53.517+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Transaction Isolation level and Concurrency in Oracle</title><content type='html'>Transaction isolation level and concurrency is implemented quite differently (than ISO specification) in Oracle.&lt;br /&gt;ISO supports following isolation levels&lt;br /&gt;read uncommitted&lt;br /&gt;read committed&lt;br /&gt;repeatable read&lt;br /&gt;serializable&lt;br /&gt;Oracle supports following&lt;br /&gt;read committed&lt;br /&gt;serializable&lt;br /&gt;However oracle's serializable is neither repeatable, nor serializable according to ISO specifications.&lt;br /&gt;Oracle serializable provides the same data as of when the start of the transaction irrespective of any committed changes (yes oracle allows data modification even if you specify serializable) not even the read rows are locked. Only thing is the modifications are hide from you so that you think the access is serializable (cheating?)&lt;br /&gt;Consider the following two cases which require serializable and repeatable (according to ISO). Scenario 1 (requires Serializable)&lt;br /&gt;Table emp contain Columns empid and Role.&lt;br /&gt;There is one script which check if there is any employee with President, if none, they choose one employee randomly and set the role as President.&lt;br /&gt;Assume this script runs concurrently.&lt;br /&gt;&lt;TABLE style="COLOR: #000000" cellSpacing=0 cellPadding=1 width=400 border=1&gt;  &lt;COLGROUP&gt;  &lt;COL width=30&gt;  &lt;COLGROUP&gt;  &lt;COL width=185&gt;  &lt;COLGROUP&gt;  &lt;COL width=185&gt;  &lt;TBODY&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;time&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Operation of Thread    1&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Operation of Thread    2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;select empid from emp where role =      'President'&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;select empid from emp where role =      'President'&lt;/P&gt;&lt;/TD&gt;  &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Choose a emp    randomly&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Choose a emp    randomly&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;update emp set role = 'President' where      empid = 3&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;update emp set role = 'President' where      empid = 5&lt;/P&gt;&lt;/TD&gt;  &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;7&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Commit&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Commit&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;br /&gt;&lt;br /&gt;Now there are two employees with Role as President is was indented&lt;br /&gt;Scenario 2 (requires Repeatable Read)&lt;br /&gt;Emp contains empid, role and backup&lt;br /&gt;There are two scrips&lt;br /&gt;Script 1 - If there are no Vice Presidents, make the backup person as Vice President&lt;br /&gt;Script 2 - Change the backup person (and hence change the vice president also)&lt;br /&gt;If these two scripts run concurrently it will lead to existence of Vice presidents&lt;br /&gt;&lt;TABLE style="COLOR: #000000" cellSpacing=0 cellPadding=4 width=400  border=1&gt;  &lt;COLGROUP&gt;  &lt;COL width=30&gt;  &lt;COLGROUP&gt;  &lt;COL width=185&gt;  &lt;COLGROUP&gt;  &lt;COL width=185&gt;  &lt;TBODY&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;time&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;Operation of    thread1&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;Operation of    thread2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;    &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;select empid from emp where role = 'Vice      President'&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;backup, oldemp = select backup, empid from      emp where role ='President'&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;backup = select backup from emp where role      = 'President'&lt;/P&gt;&lt;/TD&gt;    &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;update emp set role = 'Vice President'      where empid = backup&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;update emp set role = null where empid =      backup&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;    &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;update emp set backup = 11 where empid =      oldemp&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;    &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;7&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;update emp set role = 'Vice President'      where empid = 11&lt;/P&gt;&lt;/TD&gt;  &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;commit&lt;/P&gt;&lt;/TD&gt;    &lt;/TR&gt;  &lt;TR vAlign=top&gt;    &lt;TD width=30&gt;      &lt;P&gt;9&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;Commit&lt;/P&gt;&lt;/TD&gt;        &lt;TD width=185&gt;      &lt;P&gt;  &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;br /&gt;Now we have old backup as well as new backup having Role as Vice President which was not indented&lt;br /&gt;References:&lt;br /&gt;1) &lt;a href="http://www.oracle.com/technology/oramag/oracle/05-nov/o65asktom.html"&gt;http://www.oracle.com/technology/oramag/oracle/05-nov/o65asktom.html&lt;/a&gt;&lt;br /&gt;2) &lt;a href="http://download.oracle.com/docs/cd/B10500_01/server.920/a96524/c21cnsis.htm"&gt;http://download.oracle.com/docs/cd/B10500_01/server.920/a96524/c21cnsis.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-4612329262951556783?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/4612329262951556783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=4612329262951556783' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4612329262951556783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4612329262951556783'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/01/transaction-isolation-level-and.html' title='Transaction Isolation level and Concurrency in Oracle'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-4986347445367704443</id><published>2008-01-01T15:35:00.000+05:30</published><updated>2008-01-01T15:49:46.306+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>javax.mail.MessagingException and compatibility issues?</title><content type='html'>javax.mail.MessagingException has a constructor with parameters String and Exception. However if you instantiate  do&lt;br /&gt;MessagingException me = new MessgingException("abc", e);&lt;br /&gt;and invoke me.getCause() and if you expect to get exception e which you imbedded in constructor you are wrong.&lt;br /&gt;Because MessagingException constructor use the embedded exception to set setNextException(). It does not call super("abc", e);&lt;br /&gt;Hence if you want to get root cause, use MessagingException.getNextException() instead of getCause()&lt;br /&gt;Why this wiered api design? Probably MessagingException API might have been designed before JDK 1.4 where we didn't have feature for embedding one exception into another.&lt;br /&gt;Now we are not in a position to change the API to ensure backward compatibility! Otherwise anybody who is using getNextException will fail.&lt;br /&gt;Probably MessagingException.getCause() could override to return nextException!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-4986347445367704443?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/4986347445367704443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=4986347445367704443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4986347445367704443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/4986347445367704443'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2008/01/javaxmailmessagingexception-and.html' title='javax.mail.MessagingException and compatibility issues?'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5438199748431424216</id><published>2007-10-26T11:44:00.000+05:30</published><updated>2007-10-26T11:50:55.285+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Windows /3GB switch and Sun JDK</title><content type='html'>In windows application process's memory space is limited to 2GB. That means no application can use more memory than 2GB.&lt;br /&gt;Windows has boot.ini parameter called /3GB switch using which we can increase the memory space for application processes to 3GB.&lt;br /&gt;However even after using /3GB switch maximum heap for Sun JDK cannot be more than 2GB (to be precise not more than 1.6GB). This is because Sun JDK requires continuous block of memory for the entire heap. Whereas in Windows with /3GB it is not possible.&lt;br /&gt;I have observed that JRockit JDK doesn't have this limitation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5438199748431424216?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5438199748431424216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5438199748431424216' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5438199748431424216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5438199748431424216'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/windows-3gb-switch-and-sun-jdk.html' title='Windows /3GB switch and Sun JDK'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5492136002606466844</id><published>2007-10-26T11:34:00.000+05:30</published><updated>2007-10-26T11:43:59.453+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Switching between HTTP and HTTPS protocols HTML</title><content type='html'>In HTML when we provide link to internal pages using href (same is valid for other tags like img, form etc) we use relative/absolute path in the form of 'abc.jsp' or '/abc.jsp'&lt;br /&gt;However we may want to switch the protocol (from HTTPS to HTTP for example) for the new link.&lt;br /&gt;This is not possible without using complete URL ('http://mydomain/abc.jsp'). Using complete URL is not a good thing to do as the domain mane may vary and presence of proxies.&lt;br /&gt;Now you have to generate the complete URL on the fly either at server side (if you are using Servlet/JSP) or at client side using javascript.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;It is strange that HTML doesn't have a syntax for specifying the protocol for relative paths&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5492136002606466844?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5492136002606466844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5492136002606466844' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5492136002606466844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5492136002606466844'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/switching-between-http-and-https.html' title='Switching between HTTP and HTTPS protocols HTML'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-389834014042384023</id><published>2007-10-25T17:30:00.000+05:30</published><updated>2007-10-25T17:40:05.143+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>LinkageError and some Class Loading issues</title><content type='html'>Consider the code:&lt;br /&gt;setAbc(Abc obj){&lt;br /&gt;     this.abc = obj;    //Abc abc;&lt;br /&gt;}&lt;br /&gt;Do we need the Class Abc in classpath while invoking this method? Not really! However when you invoke this method second time with an Object with a different ClassLoader (than the ClassLoader of the Object in the first invocation) you will get the following error:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;LinkageError: loader constraints violated when linking Abc class&lt;/span&gt;&lt;br /&gt;See the attached code for demonstration.&lt;br /&gt;&lt;a href="http://rejeev.googlepages.com/source_code_LinkageError.zip"&gt;http://rejeev.googlepages.com/source_code_LinkageError.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-389834014042384023?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/389834014042384023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=389834014042384023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/389834014042384023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/389834014042384023'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/linkageerror-and-some-class-loading.html' title='LinkageError and some Class Loading issues'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5820596189450324761</id><published>2007-10-25T15:10:00.000+05:30</published><updated>2007-10-25T16:30:16.905+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>ClassCastException</title><content type='html'>When do you get ClassCastExceptionn? When you try to cast an object to Class other than its class or its super class.&lt;br /&gt;However you may get ClassCastException when you try to cast an Object whose class's ClassLoader and the ClassLoader of the Class to whom you are trying to cast are neither same nor later ClassLoader an ancestor (parent or grant parent etc) of former ClassLoader.&lt;br /&gt;See the attached code demonstrating the same.&lt;br /&gt;&lt;a href="http://rejeev.googlepages.com/source_code_ClassCastExceptionExampl.zip"&gt;http://rejeev.googlepages.com/source_code_ClassCastExceptionExampl.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5820596189450324761?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5820596189450324761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5820596189450324761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5820596189450324761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5820596189450324761'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/classcastexception.html' title='ClassCastException'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2175219814894859693</id><published>2007-10-25T14:06:00.001+05:30</published><updated>2010-12-19T16:05:12.598+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Concurrency Levels - WebLogic and Oracle</title><content type='html'>Oracle supports only 'Read-Committed' and 'Serializable' Concurrency levels.&lt;br /&gt;Most of the applications require 'Repeatable-Read' concurrency level (consider the banking fund transfer transaction - you read the balance, reduce the balance and then update the reduced balance to database). (I don't know why Oracle doesn't support 'Repeatable-Read'!!!)&lt;br /&gt;WebLogic Server has the following isolation-level for Oracle to support 'Repeatable-Read' semantics - '&lt;code style="font-family: courier;"&gt;READ_COMMITTED_FOR_UPDATE'.&lt;br /&gt;However there is one issue; It supports only CMP entity beans (obviously - what WebLogic does it it uses 'select for update' for all select queries to get row lock which it can do only for container generated queries). Currently for direct SQLs and BMP entity beans has to hard code 'select for update' in its code.&lt;/code&gt;&lt;code style="font-family: courier;"&gt;&lt;/code&gt;&lt;br /&gt;&lt;code style="font-family: courier;"&gt;You may want one entity bean 'Repeatable-read' in one transaction and 'Read-Committed' in another transaction. How will you achieve this?&lt;br /&gt;You have to specify the isolation-level for session bean (where actual transaction starts) than for the entity bean.&lt;br /&gt;However in a business transaction there may be many entity beans involved however you may want only one entity bean to have 'Repeatable-Read', all other to use 'read-committed'. How to achieve this?&lt;br /&gt;You are asking too much! There is no way to achieve that currently. You have to either specify isolation level for entity bean and lock the bean whenever it participate in a transaction OR specify isolation level at session bean level and lock all the entity beans participated.&lt;br /&gt;You have a (better?) third choice! Not using entity beans (for that matter any OM mapping solutions)!!!&lt;br /&gt;&lt;/code&gt;'&lt;code style="font-family: courier;"&gt;READ_COMMITTED_FOR_UPDATE' is supposed to be supported only for CMP entity beans however I have observed that it works for session beans as well (if you specify this for session beans, then all the entity beans involved in that transaction will be using &lt;/code&gt;'&lt;code style="font-family: courier;"&gt;READ_COMMITTED_FOR_UPDATE'.&lt;br /&gt;if a request propagate from on method with one isolation level to another method with another isolation level, does the isolation level changes when it enter the new method? Don't know!!! I should, but I am not sure if it does so now!&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2175219814894859693?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2175219814894859693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2175219814894859693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2175219814894859693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2175219814894859693'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/concurrency-levels-weblogic-and-oracle.html' title='Concurrency Levels - WebLogic and Oracle'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2662285115176896536</id><published>2007-10-24T16:11:00.000+05:30</published><updated>2007-10-24T16:40:43.193+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Serialization and ClassLoading</title><content type='html'>Do we need the Class in the classpath to Serialize an instance of the class? Not really, even if the Class is not accessible, we can get the Class by Object.getClass() method and get required information.&lt;br /&gt;However if the Class referring (using) other classes which are not in classpath. then it will break.&lt;br /&gt;It break when it try to get the SerialVersionUID which internally trying to getDeclaredFields&lt;br /&gt;It would have better if we could have avoid this dependency.&lt;br /&gt;You can download a sample program demonstrating the same here&lt;br /&gt;&lt;a href="http://rejeev.googlepages.com/source_code_Serialization.zip"&gt;http://rejeev.googlepages.com/source_code_Serialization.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2662285115176896536?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2662285115176896536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2662285115176896536' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2662285115176896536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2662285115176896536'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/serialization-and-classloading.html' title='Serialization and ClassLoading'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8241835198477602070</id><published>2007-10-18T16:17:00.000+05:30</published><updated>2007-10-25T16:33:19.147+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>log4j and j2ee applications</title><content type='html'>If you use log4j (for that matter java.util.logging package) in J2EE applications?&lt;br /&gt;log4j starts a separate thread for writing log entries (if you use asynchronous Handlers?)&lt;br /&gt;It is important to stop this thread during undeployment of the application. You can stop the thread by calling LogManager.shutdown().&lt;br /&gt;Note: It is not recommended to start thread in J2EE application, then is it recommended to use log4j in j2ee application?&lt;br /&gt;Also it is not recommended to use File IO in J2EE application.&lt;br /&gt;Then how do you do logging for your application? Use logging framework provided by your app server.  However logging framework is not yet standard and you will be having vendor specific code. Hope logging framework be part of J2EE specification in near future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8241835198477602070?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8241835198477602070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8241835198477602070' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8241835198477602070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8241835198477602070'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/log4j-and-j2ee-applications.html' title='log4j and j2ee applications'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8607741693850361410</id><published>2007-10-15T22:38:00.000+05:30</published><updated>2007-10-15T22:39:57.867+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>NPE from JVM</title><content type='html'>NullPointerException from JVM. Good link&lt;br /&gt;http://www.javaspecialists.eu/archive/Issue062.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8607741693850361410?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8607741693850361410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8607741693850361410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8607741693850361410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8607741693850361410'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/npe-from-jvm.html' title='NPE from JVM'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3689673977294913232</id><published>2007-10-15T16:16:00.000+05:30</published><updated>2007-10-15T16:31:49.730+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>XA Transactions and order of commit</title><content type='html'>Consider the following scenario;&lt;br /&gt;&lt;br /&gt;XA Transaction begin&lt;br /&gt;insert a row into a database table&lt;br /&gt;send a message to JMS Queue with pk of inserted row&lt;br /&gt;XA Transaction commits&lt;br /&gt;&lt;br /&gt;An MDB listens on the Queue and process the message. MDB selects the row and updates it.&lt;br /&gt;&lt;br /&gt;Here comes the catch. As there is no order for committing it may happen that JMS message may get committed first and hence when MDB processing the message it may occur that database is not yet committed and hence the row is not yet available!&lt;br /&gt;This occurs because there is no ordering mentioned in JTA spec.&lt;br /&gt;In WebLogic (not sure if it is documented supported feature) there is an order for commit. It commits in the same order as the resources getting enlisted.&lt;br /&gt;Bottom line: Make sure to enlist database resource first in similar scenarios.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3689673977294913232?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3689673977294913232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3689673977294913232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3689673977294913232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3689673977294913232'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/xa-transactions-and-order-of-commit.html' title='XA Transactions and order of commit'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-366063082770456443</id><published>2007-10-04T21:19:00.000+05:30</published><updated>2007-10-25T16:34:25.761+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>ORA-01000: maximum open cursors exceeded</title><content type='html'>Hitting maximum open cursors exceeded?&lt;br /&gt;Read the following post by Natalka&lt;br /&gt;http://orafaq.com/node/758&lt;br /&gt;v$open_cursor and v$sesstat doesn't show the currently open cursors correctly. It includes the cursors 'marked for close' but not yet closed. Looks like there is no safe way to find the cursors really open!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-366063082770456443?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/366063082770456443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=366063082770456443' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/366063082770456443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/366063082770456443'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/ora-01000-maximum-open-cursors-exceeded.html' title='ORA-01000: maximum open cursors exceeded'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-475755470699052605</id><published>2007-10-03T21:34:00.000+05:30</published><updated>2007-10-25T16:35:05.092+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Detecting memory leak in perm space</title><content type='html'>Use &lt;span style="color: rgb(255, 0, 0);"&gt;Jstat&lt;/span&gt; to verify if there is a memory leak in perm space. Jstat is available only from JDK 5.0 however you can connect to 1.4 JVM from a 1.5 jstat.&lt;br /&gt;Once you confirmed that there is a memory leak in perm space, use &lt;span style="color: rgb(255, 0, 0);"&gt;-verbose:class&lt;/span&gt; to find out the offending class. look for the class which is repeatedly getting loaded but *not* getting unloaded.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-475755470699052605?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/475755470699052605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=475755470699052605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/475755470699052605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/475755470699052605'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/detecting-memory-leak-in-perm-space.html' title='Detecting memory leak in perm space'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1278132131986315023</id><published>2007-10-01T17:13:00.000+05:30</published><updated>2007-10-25T16:35:48.014+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>Issues with Oracle, Time and JDBC</title><content type='html'>1) java.sql.Date doesn't contain time information (hh:mm:ss) (However 'DATE' data type contains time information). If you want to include time also along with date, you need to use java.sql.Timestamp.&lt;br /&gt;2) 'DATE' and 'TIMESTAMP' data types doesn't contain time zone information. If you want to include time zone, you need to use either 'TIMESTAMP WITH TIME ZONE' or 'TIMESTAMP WITH LOCAL TIME ZONE'.&lt;br /&gt;2) If the time zone of JVM and time zone of session are different, the time will not be saved correctly into Oracle. It will pick time component from JVM and time zone component from session (without conversion). Hence you need to keep the session time zone as same as the JVM time zone.&lt;br /&gt;3) There is no direct way to retrieve the time with time zone from 'TIMESTAMP WITH TIME ZONE'. You need to retrieve as string and parse it.&lt;br /&gt;4) If you use 'TIMESTAMP WITH LOCAL TIME ZONE' you can retrieve the time with time zone correctly. However you need to set the time zone explicitly on the session. You need to use the Oracle specific API OracleConnection.setSessionTimeZone().&lt;br /&gt;5)You cannot alter database timezone when database has TIMESTAMP WITH LOCAL TIME ZONE columns ( ORA-30079)&lt;br /&gt;&lt;br /&gt;One possible solution would be keep Oracle, Application server and session are in GMT. Make time zone conversions at all input output points.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1278132131986315023?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1278132131986315023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1278132131986315023' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1278132131986315023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1278132131986315023'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/10/issues-with-oracle-time-and-jdbc.html' title='Issues with Oracle, Time and JDBC'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8333370107253517862</id><published>2007-09-28T11:15:00.000+05:30</published><updated>2007-10-25T16:37:03.118+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>World Clock</title><content type='html'>Do you need to talk to people from different timezones? Had difficulties in finding their current local time?&lt;br /&gt;Use this site!&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;http://www.timeanddate.com/&lt;/span&gt;&lt;br /&gt;You can configure your own personal world clock - You can choose places of your interest to display on the page!&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;http://www.timeanddate.com/worldclock/setpersonal.html&lt;/span&gt;&lt;br /&gt;List of important places available at&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;http://www.timeanddate.com/worldclock/full.html&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8333370107253517862?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.timeanddate.com/' title='World Clock'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8333370107253517862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8333370107253517862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8333370107253517862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8333370107253517862'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/09/world-clock.html' title='World Clock'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5703033454981377750</id><published>2007-09-27T08:46:00.001+05:30</published><updated>2010-12-19T15:58:15.246+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>EJBs and proxies with WebLogic</title><content type='html'>If you have EJB based application with think clients, Then probably you will encounter this issue.&lt;br /&gt;Most of the cases you will have a firewall/proxy in between the Client and Application server. That means clients will not have direct access to application server. All requests are routed through the proxy. If you have cluster configured, Application server will include the ip addresses of all nodes in the EJB stub. EJB client uses this ip address list for load balancing. As client doesn't have direct access this invocation will fail.&lt;br /&gt;WebLogic has a solution via external address. However my experience is that it is buggy and not working properly. It is not well documented in WebLogic documentation. Do they think such usages are rare?&lt;br /&gt;Note: Similar condition exist for web application also when you use sendRedirect to another resource using absolute path&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5703033454981377750?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5703033454981377750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5703033454981377750' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5703033454981377750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5703033454981377750'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/09/ejbs-and-proxies-with-weblogic.html' title='EJBs and proxies with WebLogic'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8625777622795203242</id><published>2007-09-26T09:12:00.002+05:30</published><updated>2010-12-19T15:58:36.495+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Issues with CMP Entity beans</title><content type='html'>Most of the complex enterprise applications have entity beans and modifying data through direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SQL&lt;/span&gt; (either from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQLDAO&lt;/span&gt; or through database functions/procedures).&lt;br /&gt;When we access the same table through entity bean and through direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SQL&lt;/span&gt; you have problems.&lt;br /&gt;Case 1: data modified through entity bean and subsequently read/modify the same data through &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;SQL&lt;/span&gt; - This will fail in most app servers as most of the app servers delay the entity bean &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;SQL&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;untill&lt;/span&gt; the end of transaction.&lt;br /&gt;You can work around this in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;WebLogic&lt;/span&gt; via the following tag in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;weblogic&lt;/span&gt;-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;ejb&lt;/span&gt;-jar.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;xml&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;delay-updates-until-end-of-tx&gt;[delay-updates-until-end-of-tx]false[/delay-updates-until-end-of-tx]&lt;/delay-updates-until-end-of-tx&gt;&lt;/span&gt;&lt;br /&gt;Then you will loose most of the caching advantage.&lt;br /&gt;Another work around (again for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;weblogic&lt;/span&gt;) is to call a non PK finder before doing a direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;SQL&lt;/span&gt;. Non PK finder by default (make sure you have not disabled this) flushes all modifications to database before finder is called.&lt;br /&gt;Case 2: data modified through direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;SQL&lt;/span&gt; and subsequently read through entity bean. If the same entity bean is accessed before the direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;SQL&lt;/span&gt; (see the sequence below)&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Employee.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;getName&lt;/span&gt;();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;directSQL&lt;/span&gt; - change Name&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;Employee.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;getName&lt;/span&gt;()&lt;/span&gt;&lt;br /&gt;Entity bean &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;access&lt;/span&gt; after the direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;SQL&lt;/span&gt; will not reflect the modifications done by direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;SQL&lt;/span&gt;.&lt;br /&gt;This is because entity bean loads the data only once at the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_20"&gt;beginning&lt;/span&gt; of the transaction.&lt;br /&gt;There is no easy solution for this.&lt;br /&gt;I heard that if you load the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_21"&gt;entity&lt;/span&gt; bean again using a non PK finder it loads again - not sure; and it is unlikely. Also if you have already modified the entity bean, then you are lost.&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Bottom line is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;never&lt;/span&gt; access the same table though entity bean and direct &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;SQL&lt;/span&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8625777622795203242?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8625777622795203242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8625777622795203242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8625777622795203242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8625777622795203242'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/09/issues-with-cmp-entity-beans.html' title='Issues with CMP Entity beans'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6768893006881585909</id><published>2007-09-22T12:12:00.000+05:30</published><updated>2007-10-25T17:13:36.837+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><title type='text'>New Home</title><content type='html'>&lt;iframe src="http://wikimapia.org/s/#y=8561554&amp;amp;x=76913459&amp;amp;z=17&amp;amp;l=0&amp;amp;m=a&amp;amp;v=2" frameborder="0" height="696" width="546"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6768893006881585909?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://picasaweb.google.com/rejeev/NewHome' title='New Home'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6768893006881585909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6768893006881585909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6768893006881585909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6768893006881585909'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/09/new-home.html' title='New Home'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7640743164807411983</id><published>2007-09-09T19:22:00.000+05:30</published><updated>2007-10-25T17:04:08.764+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Wikimapia</title><content type='html'>Very interesting site. Hybrid of Google map and Wikipedia. Very good resolution equally good or better than Google maps. AND you can edit it like wikipedia. You add places you know.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7640743164807411983?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://wikimapia.org' title='Wikimapia'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7640743164807411983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7640743164807411983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7640743164807411983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7640743164807411983'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/09/wikimapia.html' title='Wikimapia'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-3037447201098096306</id><published>2007-09-09T19:18:00.000+05:30</published><updated>2007-10-25T17:14:03.244+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><title type='text'>My Village - Uppukandam</title><content type='html'>&lt;iframe src="http://wikimapia.org/s/#y=10133145&amp;amp;x=76626720&amp;amp;z=13&amp;amp;l=0&amp;amp;m=a&amp;amp;v=2" frameborder="0" height="532" width="618"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;input id="sq6" size="60" name="sq6" type="hidden"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-3037447201098096306?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/3037447201098096306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=3037447201098096306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3037447201098096306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/3037447201098096306'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/09/my-village-uppukandam.html' title='My Village - Uppukandam'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7777431775212419585</id><published>2007-08-23T16:40:00.000+05:30</published><updated>2007-08-23T16:44:16.687+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Cobertura - Code coverage tool</title><content type='html'>Cobertura is very good code coverage tool. It supports command line usage as well as ant tasks.&lt;br /&gt;You need to instrument the application (it modifies the bytecode). Then you need to run your unit tests. Cobertura captures the test coverage in a binray file (which is generated during instrumentation). You can then generage report. Cobertura generate very beatiful HTML reports. For all these you have command line tasks and ant tasks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7777431775212419585?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://cobertura.sourceforge.net/' title='Cobertura - Code coverage tool'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7777431775212419585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7777431775212419585' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7777431775212419585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7777431775212419585'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/cobertura-code-coverage-tool.html' title='Cobertura - Code coverage tool'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2009504487518493008</id><published>2007-08-23T16:33:00.000+05:30</published><updated>2007-10-25T17:04:46.823+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>YourKit - Java Profiler</title><content type='html'>Recently I have evaluated many profilers. Following were the main requirements&lt;br /&gt;a) Memory leak detection&lt;br /&gt;b) CPU profiling&lt;br /&gt;c) Method tracing&lt;br /&gt;d) Code coverage&lt;br /&gt;I have fount that YourKit is very good for Memory leak detection and CPU profiling. It also supports Method tracing but you need to use Java SE 5 or later. It doesn't supprot code coverage (I use cobertura for the same). Overall it is very good profiler.&lt;br /&gt;Note: It is not free however it is very reasonable - $1200 f0r 5 license.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2009504487518493008?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.yourkit.com/' title='YourKit - Java Profiler'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2009504487518493008/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2009504487518493008' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2009504487518493008'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2009504487518493008'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/yourkit-java-profiler.html' title='YourKit - Java Profiler'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7183474742175016817</id><published>2007-08-23T16:22:00.000+05:30</published><updated>2007-10-25T17:05:18.198+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>PMD - Code analyzer tool</title><content type='html'>Recently I have used PMD - a code analyzer tool. It is very useful. You can check for various common coding mistakes in your code. For example an exception is caught and rethrown another exception without including the original excpetion. You detects even duplicate code. You can write your own rules as well. using either as a java class or XPath expression. Pretty cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7183474742175016817?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://pmd.sourceforge.net/' title='PMD - Code analyzer tool'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7183474742175016817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7183474742175016817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7183474742175016817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7183474742175016817'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/pmd-code-analyzer-tool.html' title='PMD - Code analyzer tool'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-7674126448931398616</id><published>2007-08-23T16:15:00.000+05:30</published><updated>2007-10-25T17:05:49.764+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>JProgressBar</title><content type='html'>Have you used JProgressBar (to display when a long running process is going on in the foreground)? and if so have you encountered any memory leak issues?&lt;br /&gt;JProgressBar registers itself with a timer for periodic display. We had an issue due to this. We had to extend the JProgressBar to include an additional method which calls JProgressBar.getUI().uninstallUI()&lt;br /&gt;Looks like a Bug in java API!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-7674126448931398616?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/7674126448931398616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=7674126448931398616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7674126448931398616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/7674126448931398616'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/jprogressbar.html' title='JProgressBar'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-9118583763506483053</id><published>2007-08-13T08:00:00.000+05:30</published><updated>2007-10-25T17:06:17.468+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Java IDEs</title><content type='html'>Most of the IDEs (Eclipse, IntelliJ, NetBeans etc) are currently parse the complete source code and libraries and load that into memory at the begining. This causes a) Large memory requirement, b) very slow startup. Why can't we parse the files on the fly? (as Gel is doing). In most of the cases we need to parse only a limited set of files.&lt;br /&gt;For auto completion:&lt;br /&gt;   Classname - same file and classpath (if we use 'java.util.*' kind of import)&lt;br /&gt;   variable/method name - one file&lt;br /&gt;source code navigation may require parsing complete classes if you want to see all overloaded methods.&lt;br /&gt;&lt;br /&gt;I think it would be better if we get choice between rich functionality with slow start and heaviness and lighter version&lt;br /&gt;People in Eclipse listening?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-9118583763506483053?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/9118583763506483053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=9118583763506483053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9118583763506483053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/9118583763506483053'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/java-ides.html' title='Java IDEs'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1839198932218991835</id><published>2007-08-11T12:55:00.000+05:30</published><updated>2007-10-25T17:06:42.018+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>Gel - Java light weight java IDE</title><content type='html'>Recently I got a chance to try Gel - a light weight java IDE written in Delphi. I found it very good. Very light in memory footprint and very fast to load the projects.&lt;br /&gt;Why a java IDE is written anything other than Java? Why not? (any reason other than political reason?). I have found two interesting advantages with Gel.&lt;br /&gt;1) It is natively compiled and (hence) light weight in memory foot print.&lt;br /&gt;2) It doesn't parse and load the whole project at the startup and hence start up is very fast (also attributing to low memory usage).&lt;br /&gt;However the Del project is not active now. As I understand the owner is looking for somebody who can take it forward. If anybody interested this would be very useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1839198932218991835?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.gexperts.com/index.html' title='Gel - Java light weight java IDE'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1839198932218991835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1839198932218991835' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1839198932218991835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1839198932218991835'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/gel-java-light-weight-java-ide.html' title='Gel - Java light weight java IDE'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-1427221020118965609</id><published>2007-08-11T12:33:00.000+05:30</published><updated>2007-10-25T17:07:15.488+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><title type='text'>Why water in ocean not flowing towards pole?</title><content type='html'>&lt;a href="http://bp0.blogger.com/_Hit9aXPuEPE/Rr1iOzMm7gI/AAAAAAAABC0/V3hEAsjwGdw/s1600-h/earth.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5097338359654051330" style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://bp0.blogger.com/_Hit9aXPuEPE/Rr1iOzMm7gI/AAAAAAAABC0/V3hEAsjwGdw/s320/earth.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;As we know that the shape of earth is not pure sphere; it is Spheroid.&lt;br /&gt;Consider the diagram (it is an exaggerated shape to illustrate the point). Consider the point P (P is at the surface of water at an ocean). The direction of gravity is not vertical to the water surface (due to the fact that shape of earth is spheroid). Then water should flow towards the pole due to the horizontal component of gravity!!!!!&lt;br /&gt;It doesn't happen; why?????&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-1427221020118965609?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/1427221020118965609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=1427221020118965609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1427221020118965609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/1427221020118965609'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/why-water-in-ocean-not-flowing-towards.html' title='Why water in ocean not flowing towards pole?'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_Hit9aXPuEPE/Rr1iOzMm7gI/AAAAAAAABC0/V3hEAsjwGdw/s72-c/earth.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-785547180579120404</id><published>2007-08-07T22:38:00.000+05:30</published><updated>2007-10-25T17:07:43.515+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><title type='text'>Lighter in day, heavier in night?</title><content type='html'>&lt;a href="http://bp0.blogger.com/_Hit9aXPuEPE/RriniDMm7dI/AAAAAAAABCc/7okASPYDeGE/s1600-h/sun_earth.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5096007181785296338" style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://bp0.blogger.com/_Hit9aXPuEPE/RriniDMm7dI/AAAAAAAABCc/7okASPYDeGE/s320/sun_earth.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Refer the diagram.&lt;/p&gt;&lt;p&gt;Weight is due to gravity and you have weight due to any celestial object in your vicinity and is proportional to the mass and distance between the objects.&lt;/p&gt;&lt;p&gt;Your weight is predominantly due to Earth, however you have weight due to Sun as well (though small due to the large distance)&lt;/p&gt;&lt;p&gt;At 12 noon, weight of a person = weight due to Earth - weight due to SunAt 12 midnight weight = weight due to Earth + weight due ot SunHence you should weigh slightly heavier in night????&lt;/p&gt;&lt;p&gt;However it is not so! Why???&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-785547180579120404?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/785547180579120404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=785547180579120404' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/785547180579120404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/785547180579120404'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/refer-diagram.html' title='Lighter in day, heavier in night?'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_Hit9aXPuEPE/RriniDMm7dI/AAAAAAAABCc/7okASPYDeGE/s72-c/sun_earth.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-5123309067953257014</id><published>2007-08-03T08:09:00.000+05:30</published><updated>2007-10-25T17:08:06.149+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Time Zone magics</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_Hit9aXPuEPE/RrKuQDMm7YI/AAAAAAAABB0/kautybCIMe0/s1600-h/dateline1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp2.blogger.com/_Hit9aXPuEPE/RrKuQDMm7YI/AAAAAAAABB0/kautybCIMe0/s320/dateline1.JPG" alt="" id="BLOGGER_PHOTO_ID_5094325719268781442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Have you heard of Time Zone GMT+14?&lt;br /&gt;How many days/dates exists in earth at a time? 1? 2? or 3?&lt;br /&gt;You are traveling from Samoa to Kiribati. What happens? You have heard that when you travel towards East you lose a day! Well I am prepared for that!&lt;br /&gt;When I started from Samoa it was 11:30 pm Sunday.&lt;br /&gt;When I reached Kiribati it is 12:30 am Monday? No it is 12:30 am Tuesday!!!!!!!!!!!!!!&lt;br /&gt;&lt;br /&gt;This is because some of the places (Kiribati) decided to be in eastern hemisphere to be with the same date with other near by countries.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-5123309067953257014?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://worldatlas.com/aatlas/infopage/dateline.htm' title='Time Zone magics'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/5123309067953257014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=5123309067953257014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5123309067953257014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/5123309067953257014'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/08/time-zone-magics.html' title='Time Zone magics'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_Hit9aXPuEPE/RrKuQDMm7YI/AAAAAAAABB0/kautybCIMe0/s72-c/dateline1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8828481753218862841</id><published>2007-07-31T22:28:00.000+05:30</published><updated>2007-10-25T17:08:26.549+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Java EE 6</title><content type='html'>Interesting article. My views on that later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8828481753218862841?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blog.interface21.com/main/2007/07/03/java-ee-6-gets-it-right' title='Java EE 6'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8828481753218862841/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8828481753218862841' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8828481753218862841'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8828481753218862841'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/07/java-ee-6.html' title='Java EE 6'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2838016602622979261</id><published>2007-07-31T08:34:00.000+05:30</published><updated>2007-10-25T17:08:46.633+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Stumbleupon</title><content type='html'>I have been using Stumbleupon for some time. It is quite interesting site. If you have some free time and want to just suft. It is the best place. You can choose the topics of your interest. Stubleupon will throw you some new sties (with high rating) when u click the stumble button. You can rate the site using 'I like it' or 'dont like it'. When u click 'i like it' it automatically added to ur favourties.&lt;br /&gt;&lt;br /&gt;These kind of services (web 2.0) are the new trend in Internet. It is quite powerful especially in the new era of information overloading. For each kind of requirement there are n number of sites available. It is impossible to evaluate each one and choose the best. These kind of syndication tools provide very good rating mechanism. However I am not very sure if it is tamper proof. How about if the provider tampers the ratings. If the ratings are tampered heavily then credibility may be lost. However if they tamper only to certain extend then you may not notice it. Another approach is like google putting advt as separate list. this is not very effective as nobody will click on the advt (it is not only displaying your name in the screen, but also about credibility). God knows if the providers really tamper the list or not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2838016602622979261?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.stumbleupon.com/' title='Stumbleupon'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2838016602622979261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2838016602622979261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2838016602622979261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2838016602622979261'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/07/stumbleupon.html' title='Stumbleupon'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-8473556838248506260</id><published>2007-07-19T08:20:00.000+05:30</published><updated>2007-10-25T17:09:17.393+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>OpenID</title><content type='html'>A new standard for identity management.&lt;br /&gt;If you need to maintain too many user accounts at various sites, if you are fed up with login to each site you visit (not a big deal as most sites provides 'remember me' option; still it annoying if u change machine). If the site supports openid authentication, then you can use the same openid account for that site. additionally it supports SSO.&lt;br /&gt;check it out more about open id:&lt;br /&gt;&lt;a href="http://www.theserverside.com/tt/articles/article.tss?l=OpenID"&gt;http://www.theserverside.com/tt/articles/article.tss?l=OpenID&lt;/a&gt;&lt;br /&gt;&lt;a href="http://openid.net/"&gt;http://openid.net/&lt;/a&gt;&lt;br /&gt;&lt;a href="http://code.google.com/p/openid4java/"&gt;http://code.google.com/p/openid4java/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can get your openid accout with:&lt;br /&gt;&lt;a href="https://pip.verisignlabs.com/"&gt;https://pip.verisignlabs.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-8473556838248506260?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.theserverside.com/tt/articles/article.tss?l=OpenID' title='OpenID'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/8473556838248506260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=8473556838248506260' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8473556838248506260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/8473556838248506260'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/07/openid.html' title='OpenID'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6261407720930208204</id><published>2007-07-12T12:38:00.000+05:30</published><updated>2007-10-25T17:09:37.116+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>25 websites We can't live without</title><content type='html'>Times has a list of 25 websites without which you can't live without.&lt;br /&gt;Interestingly I was living without many of them so long :(&lt;br /&gt;Checkout if you are lagging behind (few months? World is moving too fast to keep updated)&lt;br /&gt;&lt;a href="http://www.time.com/time/specials/2007/article/0,28804,1638266_1638253,00.html"&gt;25 websites We can't live without&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6261407720930208204?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.time.com/time/specials/2007/article/0,28804,1638266_1638253,00.html' title='25 websites We can&apos;t live without'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6261407720930208204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6261407720930208204' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6261407720930208204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6261407720930208204'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/07/25-websites-we-cant-live-without.html' title='25 websites We can&apos;t live without'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6042696652691814300</id><published>2007-07-12T08:55:00.000+05:30</published><updated>2007-10-25T17:09:57.361+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>JDocs</title><content type='html'>Recently I have tried JDcos and found very useful. It is a site where you can find javadoc APIs for most of the important java packages (like Java SE, Java EE, Apache Ant etc). Previously I used to bookmark in the browser most of these APIs links, now I can find all at a single place.&lt;br /&gt;Moreover the GUI is much rich than the conventional frame based javadoc UI, especially the method navigator, source navigator etc.&lt;br /&gt;It also provides viewing source code. Now I don't need to download and keep the source code just look at the implementation detail occasionally.&lt;br /&gt;It also supports uploading APIs of projects which you actively participate,  however I haven't tried that yet.&lt;br /&gt;It is something worth trying. &lt;a href="http://www.jdocs.com/"&gt;JDoc&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6042696652691814300?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6042696652691814300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6042696652691814300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6042696652691814300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6042696652691814300'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/07/jdocs.html' title='JDocs'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-2735401137526092319</id><published>2007-07-02T08:12:00.000+05:30</published><updated>2007-10-25T17:10:18.152+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='j2ee'/><title type='text'>Glassfish</title><content type='html'>I was playing around glassfish (JEE 5 compliant open source application server (for those who are not familiar with)). I found it pretty cool. Some of the features I found useful are:&lt;br /&gt;Memory settings and other JVM configuration options are also configurable from admin console (For most of the leading app servers this has to be done in the startup script and the configuration information is spread in two files startup script and configuration xml file). For glassfish all configuration information is stored in domain.xml. Flassfish achieves this by using launcher Java program.&lt;br /&gt;Log levels can be configurable at sub system level (for example you can enable "finest" logging for security sub system to debug some security issues)&lt;br /&gt;Admin console looks pretty neat and clean. No applets (which has heavy dependency on Java plug in and can be big pain)&lt;br /&gt;JSR 196 implimentation. Even though it is part of JEE 5, glassfish impments JSR 196 (Java Authentication Service Provider Interface for Containers). which is a much awaited feature I would say.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-2735401137526092319?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='https://glassfish.dev.java.net/' title='Glassfish'/><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/2735401137526092319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=2735401137526092319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2735401137526092319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/2735401137526092319'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/07/glassfish.html' title='Glassfish'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-6930191810523717593</id><published>2007-06-22T08:14:00.000+05:30</published><updated>2007-10-25T17:11:36.660+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>LinkedIn, iGoogle and del.icio.us</title><content type='html'>Lately I started using three new products LinkedIn, iGoogle and del.icio.us&lt;br /&gt;Linkedin is a contacts management tool. It helped me in keeping (and in fact re-establishing lost contacts) with my old colleagues and classmates.&lt;br /&gt;iGoogle is kind of dashboard where you can choose verity of tools of your interest. A lot tools availabe as well like ToDo list, expense management tool, etc.&lt;br /&gt;Del.icio.us is a social bookmarking tool - you can keep you bookmarks here rather than (or along with) browser bookmarks.&lt;br /&gt;iGoogle and del.icio.us are especially useful for people like me who use separate machines at office and home.&lt;br /&gt;www.LinkedIn.com&lt;br /&gt;www.google.com/ig&lt;br /&gt;del.icio.us&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-6930191810523717593?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/6930191810523717593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=6930191810523717593' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6930191810523717593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/6930191810523717593'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2007/06/linkedin-igoogle-and-delicious.html' title='LinkedIn, iGoogle and del.icio.us'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-108782208161622727</id><published>2004-06-21T18:12:00.000+05:30</published><updated>2007-10-25T17:12:08.906+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='puzzles'/><title type='text'>funda !!!</title><content type='html'>anybody thinks ic engines has maximum effieciency at a certain speed?&lt;br /&gt;wrong.&lt;br /&gt;put it more specific, a moped [gearless; i don't want to mix gear ratio with effiency] , at what speed it has maximum effiency [km/litre],is there any definite speed which gives max efficiency?&lt;br /&gt;no . as you ride less speed , you will get more efficiency. less the speed more the efficiency. anybody disagrees, will discuss then.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-108782208161622727?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/108782208161622727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=108782208161622727' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/108782208161622727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/108782208161622727'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2004/06/funda.html' title='funda !!!'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7353270.post-108755833493097271</id><published>2004-06-18T16:58:00.000+05:30</published><updated>2007-10-25T17:12:29.615+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>HashMap</title><content type='html'>Do anyone thinks , if HashMap.containsKey() returns false, means , the key is NOT mapped in the map? Wrong !!!!!! , Suppose, the state of the Key object changes so that hashcode() now returns different value, after you put your key-value to the map. Now map.containsKey, or map.get will not necessarily return the key-value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7353270-108755833493097271?l=rejeev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rejeev.blogspot.com/feeds/108755833493097271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7353270&amp;postID=108755833493097271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/108755833493097271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7353270/posts/default/108755833493097271'/><link rel='alternate' type='text/html' href='http://rejeev.blogspot.com/2004/06/hashmap.html' title='HashMap'/><author><name>Rejeev Divakaran</name><uri>http://www.blogger.com/profile/06702947675339940130</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://1.bp.blogspot.com/_Hit9aXPuEPE/SeqjTSGP1aI/AAAAAAAACgw/BZAYbiOSBPQ/S220/IMG_2071.JPG'/></author><thr:total>0</thr:total></entry></feed>
