<?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-10891001</id><updated>2012-02-16T04:19:44.303-08:00</updated><category term='deployment'/><category term='web application'/><category term='Tomcat'/><category term='java script'/><category term='JBOSS'/><category term='J2EE'/><category term='html'/><title type='text'>A Java Learner's Notes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://madhukrishna.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://madhukrishna.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Madhu</name><uri>http://www.blogger.com/profile/03960500256612816920</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-10891001.post-8186556812313023899</id><published>2011-02-09T23:56:00.000-08:00</published><updated>2011-02-10T00:53:58.009-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java script'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>HTML height and offsetHeight help you trigger action when element is visible</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Problem Context:&lt;/span&gt; you have a tabbed UI and you are not in control of the tab element. (that means your code is embedded inside external site)&lt;br /&gt;Under one of the tabs, a div is present, for which you don't want to load the content till the tab is not changed.&lt;br /&gt;&lt;br /&gt;We solved it this way:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; the div height is set to 1 px with some default content like 'Loading...'.&lt;br /&gt;&lt;li&gt; time interval function to keep looking at &lt;span style="font-style:italic;"&gt;offsetHeight&lt;/span&gt; of this div element. &lt;br /&gt;&lt;li&gt; the offsetHeight would be zero as long as the div is not shown to the user. that means till the tab is not changed its value would be zero.&lt;br /&gt;&lt;li&gt; So the condition to add is if offsetHeight is greater than zero, then clear the interval, invoke the loading of you content for this tab into the div.  &lt;br /&gt;&lt;li&gt; clear the interval so that this code is not executed again.&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10891001-8186556812313023899?l=madhukrishna.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://madhukrishna.blogspot.com/feeds/8186556812313023899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10891001&amp;postID=8186556812313023899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/8186556812313023899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/8186556812313023899'/><link rel='alternate' type='text/html' href='http://madhukrishna.blogspot.com/2011/02/html-height-and-offsetheight-help-you.html' title='HTML height and offsetHeight help you trigger action when element is visible'/><author><name>Madhu</name><uri>http://www.blogger.com/profile/03960500256612816920</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10891001.post-1770019362856531254</id><published>2008-01-04T01:06:00.000-08:00</published><updated>2008-05-27T04:29:06.228-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web application'/><category scheme='http://www.blogger.com/atom/ns#' term='JBOSS'/><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='J2EE'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><title type='text'>Deloyment on JBoss</title><content type='html'>&lt;!--Include this JavaScript library once in the BODY of your HTML page--&gt;&lt;br /&gt;&lt;script type="text/javascript" src="http://widgets.clearspring.com/launchpad/include.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--Put your widget in between the following div tags--&gt;&lt;br /&gt;&lt;div id="PutWidgetHere"&gt;&lt;br /&gt;Application deployment or migration is a bit concerned for all of us, as every appserver has its own configuration and deployment policies. JBoss is no different here.&lt;br /&gt;Even though JBoss embeds Tomcat, the deployment is a bit different.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The auto deploy folder is - JBOSS_HOME/server/default/deploy. Not only applications, even data sources configurations are dropped here.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Application deployment&lt;br /&gt;&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Drop .war, .ear files here to get auto-deploy. Removing them will un-deploy them.&lt;/li&gt;&lt;li&gt;You can also deploy explode the archive into a folder and copy them here. For web application, hai.war, the folder name should also be "hai.war"&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Every time server starts, the .war, .ear files get extracted into a temporary folder - JBOSS_HOME/server/default/tmp/deploy/tmpXXXX.&lt;/li&gt;&lt;li&gt;Replacing the file while server is running, will extract to a different temp folder.&lt;/li&gt;&lt;li&gt;While undeploying, redeploying and server shutdown, these tmp folders also get deleted.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Like in Tomcat, you can find generated JSP servlet java code here - JBOSS_HOME/server/default/work/jboss.web/localhost/&lt;app&gt;/&lt;/app&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;Web application exploded deployment&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Inside auto deploy folder - create a folder with same name as archive and extract all the contents - exp1.war, exp2.jar etc.,&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Declaring &amp;lt;context&amp;gt; for web application. Tomcat is embedded, for JBoss 4.2, the folder is JBOSS_HOME/serverdefault/deploy/jboss-web.deployer/server.xml as described  &lt;a href="http://tomcat.apache.org/tomcat-5.5-doc/config/context.html"&gt;tomcat manual here&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Deploying from existing web application folder (say our eclipse project development setup) - then you should have a folder as said above, and then declare that folder in the discover list - &lt;span style="font-weight: bold;"&gt;jboss-service.xml&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;attribute name="URLs"&amp;gt;&lt;br /&gt;         deploy/, file:/E:/workspace/madhu-deploy/&amp;lt;br /&amp;gt;      &lt;br /&gt;&amp;lt;/attribute&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;     I will keep my applications exploded under as E:/workspace/madhu-deploy/hai.war/, E:/workspace/madhu-deploy/exp2.jar/ etc.,&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Data sources&lt;br /&gt;&lt;/span&gt;Create data sources by placing separate files - XXX-ds.xml in auto deploy folder (specified above)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;There exists a default datasource for HSQL database here - hsqldb-ds.xml&lt;/li&gt;&lt;li&gt;Copy the content to different file with same suffix.&lt;/li&gt;&lt;li&gt;Edit the below driver properties&lt;/li&gt;&lt;/ul&gt; &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;connection-url&amp;gt;jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB&amp;lt;/connection-url&amp;gt;&lt;br /&gt; &amp;lt;driver-class&amp;gt;org.hsqldb.jdbcDriver&amp;lt;/driver-class&amp;gt;&lt;br /&gt;  &amp;lt;user-name&amp;gt;sa&amp;lt;/user-name&amp;gt;&lt;br /&gt;  &amp;lt;password&amp;gt;&amp;lt;/password&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Specify the mapping - depending the database vendor and version.  JBOSS_HOME/server/default/conf/standardjbosscmp-jdbc.xml&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;metadata&amp;gt;&lt;br /&gt;        &amp;lt;type-mapping&amp;gt;Hypersonic SQL&amp;lt;/type-mapping&amp;gt;&lt;br /&gt;  &amp;lt;/metadata&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;For MYSQL - mySQL, ORACLE it is Oracle7, Oracle8, Oracle9i etc.,&lt;/li&gt;&lt;li&gt;Specify unique JNDI name&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;    &lt;br /&gt;&amp;lt;jndi-name&amp;gt;jdbc/mysql_MyApp_DS&amp;lt;/jndi-name&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Mail resource&lt;br /&gt;&lt;/span&gt;Edit mail-service.xml already present in auto deploy folder&lt;br /&gt;&lt;ul&gt;&lt;li&gt;JNDI name specified there is "java:/Mail"&lt;/li&gt;&lt;li&gt;If you have access to SMTP server,&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;        &lt;br /&gt;&amp;lt;property name="mail.smtp.host" value="mail.mycompany.com"&amp;gt;&lt;br /&gt;       &amp;lt;property name="mail.smtp.port" value="25"&amp;gt;&lt;br /&gt;       &amp;lt;property name="mail.from" value="welcome@studynetwork.com"&amp;gt;&lt;br /&gt;&amp;lt;/property&amp;gt;&amp;lt;/property&amp;gt;&amp;lt;/property&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;Using GMail, you need to specify login and password.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;Changing web port and port access&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;The default web port is 8080, which conflicts with tomcat.&lt;br /&gt;You may also want to change this in production machine.&lt;br /&gt;JBOSS_HOME/serverdefault/deploy/jboss-web.deployer/server.xml&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Change &amp;lt;connector&amp;gt; port value to desired port.&lt;/li&gt;&lt;/ul&gt; &lt;blockquote&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;connector port="8282" address="${jboss.bind.address}" maxthreads="250"&lt;br /&gt;  maxhttpheadersize="8192" emptysessionpath="true" protocol="HTTP/1.1"&lt;br /&gt;  enablelookups="false" redirectport="8443" acceptcount="100"&lt;br /&gt;  connectiontimeout="20000" disableuploadtimeout="true"&amp;gt;&lt;br /&gt;&amp;lt;/connector&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;In JBoss 4.2, we observed the applications are not get served to different machines other than the one where it is deployed. That is because of &lt;span style="font-weight: bold;"&gt;address&lt;/span&gt; attribute specified.&lt;/li&gt;&lt;li&gt; ${jboss.bind.address} stands for local machine. So the web applications are only accessible locally.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You can specify to your subnet by giving regex - 192.168.*&lt;/li&gt;&lt;li&gt;This is a cool feature for secured applications to be accessible for known people.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Remove this attribute to all machines to access your deployed  applications. (especially on production machine)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--This script invokes the Button or Menu. Note: the "source" should point to ID of the div that contains your widget--&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;$Launchpad.ShowMenu({"userId": "483ac967e9369ab2", "widgetName": "rama_widget", "source": "PutWidgetHere", "customCSS": "http://cdn.clearspring.com/launchpad/skins/white.css"});&lt;br /&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10891001-1770019362856531254?l=madhukrishna.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://madhukrishna.blogspot.com/feeds/1770019362856531254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10891001&amp;postID=1770019362856531254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/1770019362856531254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/1770019362856531254'/><link rel='alternate' type='text/html' href='http://madhukrishna.blogspot.com/2008/01/deloyment-on-jboss.html' title='Deloyment on JBoss'/><author><name>Madhu</name><uri>http://www.blogger.com/profile/03960500256612816920</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10891001.post-9152295752112190934</id><published>2007-05-25T01:37:00.000-07:00</published><updated>2007-05-25T09:02:16.092-07:00</updated><title type='text'></title><content type='html'>&lt;h1&gt;Introducing Python for Java developers&lt;br&gt;&lt;/h1&gt;&lt;br&gt;    &lt;div align="left"&gt;&lt;table style="width: 904px; height: 1410px;" border="5" cellpadding="3" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="50%"&gt;&lt;span style="font-weight: bold;"&gt;Java&lt;/span&gt;&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;&lt;span style="font-weight: bold;"&gt;Python&lt;/span&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;Source files are called Java classes stored with extension - .java&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;Source files are called modules stored with extension - .py&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;.java compiled to .class and interpreted by JVM&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;interpreted .py file&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;CLASSPATH env variable &amp;amp; jre/lib/ext with .class or .jar/.zip files&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;&lt;a class="envvar" name="l2h-10"&gt;PYTHONPATH env variable &amp;amp;  &lt;/a&gt;&amp;lt;python-install&amp;gt;/Lib folder containing all .py files.&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;compile with optimization and execution:&lt;br&gt;javac -g:none HelloWorld.java (creates .class file)&lt;br&gt;java HelloWorld&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;Execute directly.&lt;br&gt;python -O HelloWorld.py&lt;br&gt;(may create .pyo or .pyc files)&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;// this is a comment&lt;br&gt;/* bulk comment */&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;#this is  a comment. Don't indent me in case of if etc.,&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;Packaging: Java source should have package specified as the first statement -&lt;br&gt;package com.pramati.samples&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;Those directories having the __init__.py file (can be empty) are treated as packages -&lt;br&gt;Inside &amp;lt;install&amp;gt;/Lib/com/pramati/samples/__init__.py&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;Importing classes from other packages and using.&lt;br&gt;import [package-name].[class-name] as present in jar or class folder - &lt;br&gt;import com.pramati.util.List;&lt;br&gt;import com.pramati.io.*;&lt;br&gt;import java.util.*;&lt;br&gt;import java.sql.*;&lt;br&gt;&lt;br&gt;Need not refer to full name of the class EXCEPT for conflicting ones (here Date is present in util and sql packages)&lt;br&gt;void method1() {&lt;br&gt;java.util.Date utilDate = new java.util.Date();&lt;br&gt;Connection  con = null;&lt;br&gt;java.io.BufferedReader br = new java.io.BufferedReader(System.in)&lt;br&gt;}&lt;br&gt;&lt;br&gt;Need not declare when fully qualified path is specified where used (here java.io.BufferedReader is not imported)&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;WITHOUT IMPORT statement, you can't use the module&lt;br&gt;&lt;br&gt;The style of importing defines how you use them&lt;br&gt;Method 1:&lt;br&gt;import com.pramati.util.List &lt;br&gt;def m1():&lt;br&gt;   com.pramati.util.List.removeDuplicates(li)&lt;br&gt;&lt;br&gt;Method 2A:&lt;br&gt;from com.pramati.util import List&lt;br&gt;def m1():&lt;br&gt;   List.removeDuplicates(li)&lt;br&gt;&lt;br&gt;Method 2B: Importing multiple modules: __init__.py should define variable __all__ with modules to load -&lt;br&gt;__init__.py inside folder com/pramati/util&lt;br&gt;__all__ = ["List", "Set", "Collection"]&lt;br&gt;def m1():&lt;br&gt;    List.removeDuplicates(li)&lt;br&gt; &lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;; and { } are statement separators and blocks&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;statement per line and indentation (usually followed by colon)used for blocks like if, for etc&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;method declaration : &amp;lt;return type&amp;gt; &amp;lt;name&amp;gt;(&amp;lt;args&amp;gt;){ &amp;lt;BODY&amp;gt;}&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;def &amp;lt;name&amp;gt;(&amp;lt;args with default values like in C++&amp;gt;) : &amp;lt;INDENTED BODY&amp;gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;if(&amp;lt;boolean expression&amp;gt;) { &amp;lt;BODY&amp;gt;}&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;if &amp;lt;C style non-zero arithmetic expression&amp;gt;: &amp;lt;INDENTED BODY&amp;gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;for each loop  --  for(int y : arr) {system.out.println(y)}&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;for y in arr: &lt;br&gt;    print(y)&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;While loop.&lt;br&gt;&lt;br&gt;while(b&amp;lt;10) {&lt;br&gt;  b++;&lt;br&gt;  if (b ==9) {     &lt;br&gt;    break;&lt;br&gt;  } else {&lt;br&gt;     continue;&lt;br&gt;  }&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;1.No increment or decrement operators.&lt;br&gt;2. comparing with "==" as in Java/C&lt;br&gt;3. break, continue as it is in C.&lt;br&gt;while b&amp;lt;10:&lt;br&gt;   b = b + 1&lt;br&gt;   if b==9:&lt;br&gt;      break&lt;br&gt;   else&lt;br&gt;      continue&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;System.out.println()&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;print&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;Arrays : int a[] = new int[10]&lt;br&gt;Lists :&lt;br&gt;List li = new ArrayList()&lt;br&gt;li.add("hari");&lt;br&gt;li.add(2, "sri");&lt;br&gt;li.addAll(new ArrayList());&lt;br&gt;li.remove("sri");&lt;br&gt;li.size();&lt;br&gt;li.indexOf("sri");&lt;br&gt;Collections.sort(li);&lt;br&gt;Collections.reverse(li);&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;Has only Lists. The syntax of using lists is more like arrays in java.&lt;br&gt;li = ['spam', 'eggs', 100, 1234]&lt;br&gt;li.append(10)&lt;br&gt;li.insert(6, 'sri')&lt;br&gt;li.extend([10, 20, 30])&lt;br&gt;li.remove('sri')&lt;br&gt;li[0]='rama'&lt;br&gt;len(li)&lt;br&gt;li.index("sri")&lt;br&gt;li.sort()&lt;br&gt;li.reverse()&lt;br&gt;&lt;br&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;Read input - int x = System.in.read()&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;x = int(raw_input("Please enter an integer: ")) &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="50%"&gt;Empty statement &lt;br&gt;if (x &amp;gt; 10)&lt;br&gt;   ; // do nothing.&lt;br&gt;&lt;br&gt;&lt;/td&gt;&lt;td width="50%"&gt;if x &amp;gt; 10:&lt;br&gt;   pass #do nothing&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;Null value - Object x = null;&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;x = None&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;Converting (numbers) to String:&lt;br&gt;int age = 19; List wealth = new ArrayList();&lt;br&gt;- concating primitives and objects (with overridden toString()) &lt;br&gt;String x = "At age " + 19 +  " acquired below property - n" +wealth&lt;br&gt;- String.valueOf()&lt;br&gt;String x = String.valueOf(age)&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br&gt;any variable with in reverse quotes (&lt;code&gt;``&lt;/code&gt;)&lt;br&gt;myage = 19, dadage=40&lt;br&gt;iam = 'I am ' + `dadage` + '-' + `myage` + '= '  + `(dadage-myage)`  + ' yrs older'  &lt;br&gt;print iam&lt;br&gt;OUTPUT: I am 40-19= 21 yrs older&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;Converting String to number:&lt;br&gt;int x  = Integer.parseInt("43434");&lt;br&gt;double y = Double.parseDouble("343.999");&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;string module defines many useful methods other than these&lt;br&gt;import string&lt;br&gt;x = string.atoi("4343")&lt;br&gt;y = string.atof("3434.4343")&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;Exception handling&lt;br&gt;try {&lt;br&gt;int y = 0;&lt;br&gt;int x = 10 /y;&lt;br&gt;} catch(Exception e) {&lt;br&gt;   e.printStackTrace();&lt;br&gt;   System.out.println(e.getMessage());&lt;br&gt;} finally {&lt;br&gt; System.out.println("done..");&lt;br&gt;}&lt;br&gt;&lt;br&gt;A &lt;tt class="keyword"&gt;try&lt;/tt&gt; statement must have one or more catch  clauses and may or may not have one finally clause.&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br&gt;try:&lt;br&gt;   x = 1/0&lt;br&gt;except (ZeroDivisionError, ValueError, NameError):&lt;br&gt;   print sys.exc_info()[0]&lt;br&gt;else : #called when &lt;br&gt;   print "no problem!"&lt;br&gt;&lt;br&gt;try :&lt;br&gt;    x = 1/0&lt;br&gt;finally :&lt;br&gt;    print "In finally"&lt;br&gt;&lt;br&gt;A &lt;tt class="keyword"&gt;try&lt;/tt&gt; statement must either have one or more except  clauses or one finally clause, but not both   &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;throw new Exception("Invalid value");&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;raise NameError, "Invalid value"&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="vertical-align: top;"&gt;&lt;br&gt;&lt;/td&gt;&lt;td style="vertical-align: top;"&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br&gt;Note :&lt;br&gt;&lt;ul&gt;&lt;li&gt;A program doesn't run any faster when it is read from a &lt;span class="file"&gt;.pyc&lt;/span&gt; or &lt;span class="file"&gt;.pyo&lt;/span&gt; file than when it is read  from a &lt;span class="file"&gt;.py&lt;/span&gt; file; the only thing that's faster about  &lt;span class="file"&gt;.pyc&lt;/span&gt; or &lt;span class="file"&gt;.pyo&lt;/span&gt; files is the speed  with which they are loaded&lt;/li&gt;&lt;li&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10891001-9152295752112190934?l=madhukrishna.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://madhukrishna.blogspot.com/feeds/9152295752112190934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10891001&amp;postID=9152295752112190934' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/9152295752112190934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/9152295752112190934'/><link rel='alternate' type='text/html' href='http://madhukrishna.blogspot.com/2007/05/introducing-python-for-java-developers.html' title=''/><author><name>Madhu</name><uri>http://www.blogger.com/profile/03960500256612816920</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-10891001.post-112116774687907253</id><published>2005-07-12T04:03:00.000-07:00</published><updated>2005-07-12T05:44:10.936-07:00</updated><title type='text'>Corba Vs WSDL</title><content type='html'>Interesting comparison : &lt;a href="http://www.products.nasscom.org/downloads/idl-wsdl.pdf"&gt; Tools that can generate from IDL to CORBA code in C etc and as well as WSDL. &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt; IDL, WSDL file Differences :&lt;/strong&gt;&lt;br /&gt;&lt;OL&gt;&lt;br /&gt;&lt;li&gt; IDL type (struct or valuetype or exception) corresponds to WSDL type(defined in &amp;lt;type&amp;gt; tag)&lt;br /&gt;&lt;li&gt; IDL method signature (return-type + name + paramtypes) corresponds to WSDL operation (operation tag with nested tags : input, output and fault tags).&lt;br /&gt;&lt;li&gt; IDL Interface (encapsulating all its members) corresponds to WSDL port (Using port tag). &lt;br /&gt;&lt;li&gt; A Corba Object corresponds to a WebService.&lt;br /&gt;&lt;LI&gt; WSDL-SOAP message can be on wide transports : http, smtp etc. where as Corba objects communicate over IIOP protocol only. However a particual SOAP Binding is tied to a particular transport in the WSDL file itself [In soap:binding tag with transport attribute].&lt;br /&gt;&lt;/OL&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;A service (wsdl) is like a contract of loosely-coupled messages exchangeable where as interface (idl) allows binding with an object (thru a stub/proxy).&lt;br /&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/10891001-112116774687907253?l=madhukrishna.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://madhukrishna.blogspot.com/feeds/112116774687907253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=10891001&amp;postID=112116774687907253' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/112116774687907253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/10891001/posts/default/112116774687907253'/><link rel='alternate' type='text/html' href='http://madhukrishna.blogspot.com/2005/07/corba-vs-wsdl.html' title='Corba Vs WSDL'/><author><name>Madhu</name><uri>http://www.blogger.com/profile/03960500256612816920</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
