<?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-856092880743554053</id><updated>2012-02-17T11:43:42.161-08:00</updated><category term='Servlets'/><category term='XSD'/><category term='MVC'/><category term='Architecture'/><category term='WTP'/><category term='JSP'/><category term='Helios'/><category term='Image'/><category term='EMF'/><category term='Resource Plugin'/><category term='HSQLDB'/><category term='new'/><category term='Eclipse Demo Camp'/><category term='Tutorial'/><category term='YUI'/><category term='Java'/><category term='Middleware'/><category term='Programming'/><category term='Web'/><category term='Editor'/><category term='Google APIs'/><category term='problem solving'/><category term='trac'/><category term='Meets'/><category term='Frameworks'/><category term='Flash'/><category term='Charts'/><category term='Tests'/><category term='RCP'/><category term='Firefox'/><category term='Enterprise Apps'/><category term='Eclipse'/><category term='Flex'/><category term='Plug-in'/><category term='Technologies'/><category term='Spring'/><category term='Legacy'/><category term='Query2'/><category term='Facebook'/><category term='SWT'/><title type='text'>codify</title><subtitle type='html'>Exploring the new dimensions and my notes</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>46</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-5358224405175553602</id><published>2011-12-26T07:39:00.000-08:00</published><updated>2012-01-12T08:55:13.153-08:00</updated><title type='text'>Eclipse Tips -Part 4</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;After quite a long time i chanced upon some UI programming. So the thought of putting the next edition of Eclipse Tips came to my mind.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;File Browsing Dialog&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;It may happen that you would like to browse for a file in the file system and then select it for further processing.Remember how you browse for projects when you import projects from your local file system.&lt;br /&gt;&lt;br /&gt;The File browsing dialog can be brought by using FileDialog. You can also use the FileDialog to filter on the file names, extensions etc through the APIs such as&amp;nbsp;public void setFilterNames (String [] names) and&amp;nbsp;public void setFilterNames (String [] names) respectively.&lt;br /&gt;&lt;br /&gt;This is how you can use FileDialog in your code&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;FileDialog dialog = new FileDialog(parentComposite.getShell());&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;EMF Unparseable content&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I also ventured into some intricacies of EMF Models.Part of my work was to evaluate the possiblity of sending non parseable content through the EMF Models. So i finalized two options Base64 Binary and CDATA.CDATA being the standard way caught my attention first. Here is the link which describes the difference CDATA and Base64 Binary.&amp;nbsp;&lt;a href="http://forums.devx.com/showthread.php?t=4667"&gt;http://forums.devx.com/showthread.php?t=4667&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;CDATA&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-yMOXWoVGgwA/Tw55GHPL8_I/AAAAAAAAAqE/y5AP7bjvBEc/s1600/article-page-main_ehow_images_a04_s0_bp_use-cdata-xml-800x800.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-yMOXWoVGgwA/Tw55GHPL8_I/AAAAAAAAAqE/y5AP7bjvBEc/s1600/article-page-main_ehow_images_a04_s0_bp_use-cdata-xml-800x800.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&amp;nbsp;In EMF you can pass the CDATA if you annotize your model with the mixed content.Please follow the steps to model a mixed content.&lt;br /&gt;&lt;br /&gt;(a) Define the EClass for which you want to have the mixed content.Lets say I want to send my java script code through my Request EClass.&lt;br /&gt;So i would define an EClass saying Request.Annotate the Request class by giving the source as&amp;nbsp;Source&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;http:///org/eclipse/emf/ecore/util/ExtendedMetaData.&lt;br /&gt;&lt;br /&gt;(b) Create a new Details Entry value for that annotation with name as 'request' and kind as 'mixed'.So it makes the Request class to contain an attribute of type mixed content.&lt;br /&gt;&lt;br /&gt;(c) Then define the actual attribute which will contain the mixed content for e.g. JSCode of type EFeatureMapEntry Then annotate JSCode with ExtendedMetadata and then put the Details Entry value with name as mixed and kind of elementWildCard.&lt;br /&gt;&lt;br /&gt;How to add the CDATA from your code&lt;br /&gt;&lt;br /&gt;//get the instance of the Request class&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;FeatureMapUtil.addCDATA(request.getJSCode(),"js code");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The FeatureMapUtil adds the CDATA to your mixed content attribute.&lt;br /&gt;&lt;br /&gt;Another example i do is for the famous ExtLibrary model. I add an attribute called content in the Library class which contains the mixed content.Below is the xml of the ecore for that part.For this blog purpose i have removed all the other attributes and references of the Library class.&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://pastebin.com/embed_iframe.php?i=H6fHhvpk" style="border: none; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Check how the Library is class is told to contain a mixed attribute and then attribute called content is added which is the actual mixed content.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Base64 Binary&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;I also tried to explore the Base64Binary way of passing the content.&lt;br /&gt;&lt;br /&gt;It is very simple as how to pass the Base64 binary data.Just create the attribute of type Base64Binary.EMF comes with a datatype built in for that.&lt;br /&gt;&lt;br /&gt;I end this post here.&lt;br /&gt;&lt;br /&gt;Happy working on eclipse.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-5358224405175553602?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/5358224405175553602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=5358224405175553602' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5358224405175553602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5358224405175553602'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/12/after-quite-long-time-i-chanced-upon.html' title='Eclipse Tips -Part 4'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-yMOXWoVGgwA/Tw55GHPL8_I/AAAAAAAAAqE/y5AP7bjvBEc/s72-c/article-page-main_ehow_images_a04_s0_bp_use-cdata-xml-800x800.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4719323328676151551</id><published>2011-12-06T00:56:00.001-08:00</published><updated>2011-12-11T18:51:31.596-08:00</updated><title type='text'>Eclipse Demo camp 2011 and so on</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Well this post comes after a long time , reason being i got involved in lot of other different things other than the technical stuff.&lt;br /&gt;&lt;br /&gt;Again i got an oppurtunity to visit a world class conference.I was there in Ludgwigsburg to attend and speak at Eclipse Con Europe.More interesting and new concepts were learner there and it also gave me an opportunity to talk with lot of talented people. My experiences in Eclipse Con Europe are captured here.&lt;br /&gt;&lt;br /&gt;http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/27444 &lt;br /&gt;&lt;br /&gt;Bangalore even is not far behind in exploring and promoting the eclipse related activites. This year demo camp in Bangalore again promises to be an interesting one and boasts of number of cool talks.&lt;br /&gt;&lt;br /&gt;http://wiki.eclipse.org/Eclipse_DemoCamps_November_2011/Bangalore &lt;br /&gt;&lt;br /&gt;I for a change move from my Query2 talk to more generic EMF related topics. Well for last one year i have been exploring CDO and currently also i am exploring Mylyn modeling bridge for one of my projects.&lt;br /&gt;&lt;br /&gt;CDO has been one of the projects which has taken EMF to another level and used by enterprises heavily.CDO is a pure Java &lt;i&gt;model repository&lt;/i&gt; for your EMF models and meta models. CDO can also serve as a &lt;i&gt;persistence and distribution framework&lt;/i&gt; for your EMF based application systems. CDO supports plentyfold deployments such as embedded repositories, offline clones or replicated clusters. The following diagram illustrates the most common scenario:&lt;br /&gt;&lt;br /&gt;More details here http://www.eclipse.org/cdo/documentation/&lt;br /&gt;&lt;br /&gt;We have been trying to integrate Query2 with CDO i.e. to support expressing EMF Query2 queries in CDO landscape.With the advent of Storage processor framework in Query2 ,its already possible to integrate any kind of backend.&lt;br /&gt;&lt;br /&gt;Mylyn modeling bridge enables to use Mylyn context with EMF based applications i.e. an user can have his own context.Imagine an user working on a particular task for a huge graphical diagram.But he only wants to work on some of the elements of that diagram.The user can build his own context and can work upon that.Such that he only sees those elements in the diagram. He can also then deactivate the context and then he will get the full diagram.&lt;br /&gt;&lt;br /&gt;More details about the work going here&lt;br /&gt;&lt;br /&gt;http://wiki.eclipse.org/Mylyn/Modeling_Bridge&lt;br /&gt;&lt;br /&gt;Please find the slide here&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="__ss_10547477" style="width: 425px;"&gt; &lt;strong style="display: block; margin: 12px 0 4px;"&gt;&lt;a href="http://www.slideshare.net/sauravsarkar/enterprise-modeling" target="_blank" title="Enterprise modeling"&gt;Enterprise modeling&lt;/a&gt;&lt;/strong&gt; &lt;iframe frameborder="0" height="355" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/10547477" width="425"&gt;&lt;/iframe&gt; &lt;div style="padding: 5px 0 12px;"&gt; View more &lt;a href="http://www.slideshare.net/" target="_blank"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/sauravsarkar" target="_blank"&gt;Saurav Sarkar&lt;/a&gt; &lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Stay tuned on this blog as i reveal one more interesting concept on testing in the next post.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4719323328676151551?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4719323328676151551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4719323328676151551' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4719323328676151551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4719323328676151551'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/12/eclipse-demo-camp-2011-and-so-on.html' title='Eclipse Demo camp 2011 and so on'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2186209735364037315</id><published>2011-06-24T03:34:00.000-07:00</published><updated>2011-06-24T03:45:31.950-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Query2'/><title type='text'>Query2 Internals Part-1</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;This particular post will be interesting to the people who would like to adopt Query2 in their framework or would like to extend some of its functionality.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Simple Query calculation&lt;/b&gt;&lt;br /&gt;Query2 considers a simple select from all statement as a Simple Query.So the BQLMemoryEstimationengine first checks if the query is a simple query.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--rh_L2YkxM8/TgRpirBmH8I/AAAAAAAAAnY/CJWecne5IWk/s1600/simple-glossy-text-4.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" i$="true" src="http://4.bp.blogspot.com/--rh_L2YkxM8/TgRpirBmH8I/AAAAAAAAAnY/CJWecne5IWk/s200/simple-glossy-text-4.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;Following conditions determine whether the query is a simple query.&lt;br /&gt;&lt;br /&gt;(a) If there is only select statement.&lt;br /&gt;(b) If there are no attribute comparison&lt;br /&gt;(c) If there are no nested queries.&lt;br /&gt;&lt;br /&gt;Once the above condition satisfies and the query is considered as a simple query.The estimation engine separately executes the query.&lt;br /&gt;&lt;br /&gt;Check this method private SpiFqlQueryResultSet executeVerySimpleQuery(SpiSelectExpression selectExpression) in BasicQueryProcessorMemoryEstimationImpl&lt;br /&gt;&lt;br /&gt;The following code shows how the types of the objects are retrieved and then the call is passed to the IndexQueryService.The IndexQueryService sends back all the resources which contains the specfic types.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;URI[] types = selectExpression.getModelElementClusterExpression().getHeaderModelElementExpression().getTypes();&lt;br /&gt;&lt;br /&gt;CoreQueryClientScope queryClientScope = new CoreQueryClientScope(pris, included);&lt;br /&gt;try {&lt;br /&gt;// obtain the instances from the index&lt;br /&gt;elements = IndexQueryService.getInstances(this.index, queryClientScope, types);&lt;br /&gt;} catch (IllegalArgumentException e) &lt;br /&gt;{&lt;br /&gt;// this can only happen whenever we have Reflect::Element with and exclusive scope&lt;br /&gt;throw new SpiFacilityQueryServiceException(e, SpiFacilityQueryServiceException.ERROR_CODE_REFLECT_ELEMENT,&lt;br /&gt;&lt;br /&gt;ApiMessages.MUST_RESTRICT_SCOPE_FOR_ELEMENT);&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;After the URI are retrieved the result set is constructed in this way&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;for (URI mri : elements) {&lt;br /&gt;int resultPos = resultSet.addEmptyEntry();&lt;br /&gt;resultSet.setMri(resultPos, 0, mri);&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So this is how the simple query is being recognized and then being executed.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Intersection and Union of scopes&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In the previos posts i have mentioned how important scoping is.To effectively use scopes some useful scoping APIs of Query2 can be consulted.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-leSuJKZsq94/TgRqbxUkfpI/AAAAAAAAAnc/pKU5cJJjKwY/s1600/SCOPES.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="171" i$="true" src="http://2.bp.blogspot.com/-leSuJKZsq94/TgRqbxUkfpI/AAAAAAAAAnc/pKU5cJJjKwY/s200/SCOPES.jpg" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;AuxServices is quite a handy class. It contains two vital services for scope calulcation.These APIs are used across various places by the Query core.I feel it will be useful for people who are willing to plug their own storage processor.&lt;br /&gt;&lt;br /&gt;Use this &lt;code&gt;public &lt;e&gt;Set&lt;e&gt; intersectScopes(Set&lt;e&gt; leftScope, boolean leftIncluded, Set&lt;e&gt; rightScope, boolean rightIncluded) &lt;/code&gt;when you want to intersect the scopes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and this &lt;code&gt;public &lt;e&gt;Set&lt;e&gt; unionScopes(Set&lt;e&gt; leftScope, boolean leftIncluded, Set&lt;e&gt; rightScope, boolean rightIncluded) &lt;/code&gt;when you want to want the union.&lt;br /&gt;&lt;br /&gt;In the Dirty state calculation post we have seen the use of intersectScopes which in turn calls the combineSets method.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;New and Noteworthy in Query2&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Please check the new and noteworthy in this link&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.eclipse.org/EMF/Query2/NewAndNoteworthy"&gt;http://wiki.eclipse.org/EMF/Query2/NewAndNoteworthy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This page would get updated as in new updates on Query2 appear.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-2186209735364037315?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2186209735364037315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2186209735364037315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2186209735364037315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2186209735364037315'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/06/query2-internals-part-1.html' title='Query2 Internals Part-1'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/--rh_L2YkxM8/TgRpirBmH8I/AAAAAAAAAnY/CJWecne5IWk/s72-c/simple-glossy-text-4.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-3786581993450785354</id><published>2011-04-20T01:33:00.000-07:00</published><updated>2011-04-20T01:34:27.455-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resource Plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse Tips -Part3</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="margin: 0px;"&gt;&lt;span style="font-family: inherit;"&gt;Here is the next edition for the Eclipse tips.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;u&gt;&lt;span style="font-family: inherit;"&gt;Radio Button through SWT&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;u&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span style="font-family: inherit;"&gt;SWT has a button widget.This button widget can further take the style of a radio buttion or a check box button.&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;span style="font-family: inherit;"&gt;For radio button we need to provide&lt;/span&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;code&gt;&lt;span style="font-family: inherit;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div style="margin: 0px;"&gt;&lt;code&gt;&lt;span style="font-family: inherit;"&gt;Button button=new Button(parent,SWT.Radio)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Eclipse Resource&lt;/u&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Now lets come to some Eclipse resource stuff.Often you will get some requirement where you need to loop through your project resources and need to work on the files only.But while looping through you will also get instances of IFolder.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Below code is an recursive fuction which can save your blues.&lt;/span&gt;&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=0hDnWREn"&gt;&lt;/script&gt;&lt;br /&gt;Check the highlighted lines where i check the type of resource.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Eclipse Resource and EMF&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Lets see extend our resource tips&amp;nbsp;to EMF stuffs.One of the most important stuff when we start working on EMF is how the EMF resource is mapped to Eclipse file system.In my experience most often i have faced this question of conversion of EMF Resource to IResource. I found this tip on Prakash's blog.Please check this blog post link &lt;a href="http://blog.eclipse-tips.com/2008/03/converting-emf-resource-to-platform.html"&gt;conversion of EMF Resource to IResource&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Vice versa also is some times important.Check the code snapshot i had pasted above. From an IResource the URI is being retrieved and an EMF URI is constructed.And then once you get the URI you can get an EMF Resource.&lt;br /&gt;&lt;br /&gt;Now one more important stuff.Lets say you have an instance of IFile and&amp;nbsp;now you want the platform URI&lt;br /&gt;For this check this code.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;URI.createPlatformResourceURI(file.getFullPath().toString(), true)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope these series of tips are interesting and useful.I would encourage everyone to keep posting their questions in the comments section.I will try to incorporate the answers to their questions in the Eclipse Tips -Part 4.&lt;br /&gt;&lt;br /&gt;Off the topic - Couple of weeks back i went to Santa Clara to attend the EclipseCon.As expected i came back with a wealth of learning and information.I have captured my expriences and provided some useful links in this SDN blog post.&lt;br /&gt;&lt;a href="http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/24054"&gt;http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/24054&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Saurav&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/856092880743554053-3786581993450785354?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/3786581993450785354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=3786581993450785354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/3786581993450785354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/3786581993450785354'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/04/eclipse-tips-part3.html' title='Eclipse Tips -Part3'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-3116007224448779563</id><published>2011-04-13T04:14:00.000-07:00</published><updated>2011-04-13T04:22:37.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Query2'/><title type='text'>Dirty state calculation in Query2</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Continuing my effort to document Query2.In this post i will take up how dirty state calculation is done in Query2.My example here will be again the Query editor which is shipped with Query2.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-8NBpIta0xIY/TaWEw6oQpJI/AAAAAAAAAmo/yLtaxax1Y1k/s1600/Query_view.PNG" imageanchor="1" style="clear: left; cssfloat: left; float: left; height: 120px; margin-bottom: 1em; margin-right: 1em; width: 317px;"&gt;&lt;img border="0" height="88" r6="true" src="http://4.bp.blogspot.com/-8NBpIta0xIY/TaWEw6oQpJI/AAAAAAAAAmo/yLtaxax1Y1k/s320/Query_view.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;In QueryView there is an context menu action called 'Run on dirty state'.Internally Query2 engine calculates the resources which are open and dirty and puts them in the resource set.&lt;br /&gt;&lt;br /&gt;As i mentioned earlier Query2 has a component called Scheduler which actually takes care of determining the state of the resources and keeps a set of resources which are in memory.&lt;br /&gt;There is a concept of scope in Querying. i.e. a scope of resources under which the resources are queried.&lt;br /&gt;So scope is part of a query context which you pass when query is supposed to be executed.This how a query can be executed.&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=jnuHeL90"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;In case of dirty case scenarios, as i mentioned above all the resources are in the resource set.When the Scheduler part kicks in , it will check all the resources in the resource set and put them in an HashSet called &lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;this.relevantPartitionPRIs = new HashSet&lt;uri&gt;();&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;Then scheduler constructs the graph of the Query.The Query is broken and each atomic entry is called a node and the corresponding associate predicate is&amp;nbsp;actually the joining&amp;nbsp;edge of the nodes.&lt;br /&gt;&lt;br /&gt;Below is the scheduler code where it happens.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&amp;nbsp;/* ---- The Actual Scheduling Algorithm ---- */&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;* (1) Construct a graph for each leaf query and build up a&lt;br /&gt;* node-map, mapping the atomic entries to their nodes in the&lt;br /&gt;* respective graphs&lt;br /&gt;*/&lt;br /&gt;Map&lt;atomicentry, node=""&gt; nodeMap = this.buildNodeMap(resultQuery);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Build Node map according to the scope of the node tags it either Non Dirty, Dirty or Mixed.The most important part here is the calculation of the scope of the nodes.&lt;br /&gt;This is done in a method of Auxiallry services public &lt;e&gt;Set&lt;e&gt; intersectScopes(Set&lt;e&gt; leftScope, boolean leftIncluded, Set&lt;e&gt; rightScope, boolean rightIncluded) which in turn calls combineSets method.Here is the code of combineSets method.&lt;br /&gt;&lt;script src="http://pastebin.com/embed_js.php?i=jHsPKx55"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;As you can see in the combinesets method the whole intersection of the scope is being done.In the dirty case state left set is the scope of the FormEntry (usually the scope passed in the Query context) and right set consitutes the HashSet called relevantPartitionPRIs.If an intersection is found that means there is a common resource which is both dirty and persistent .So the node must be mixed and dirty state kicks in.&lt;br /&gt;So in case of dirty scenario the Query is broken and being spread to multiple queries and a ResultUnion of the queries are constructed.&lt;br /&gt;&lt;br /&gt;I hope i was able to cover this topic in a simpler way.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-3116007224448779563?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/3116007224448779563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=3116007224448779563' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/3116007224448779563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/3116007224448779563'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/04/dirty-state-calculation-in-query2.html' title='Dirty state calculation in Query2'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-8NBpIta0xIY/TaWEw6oQpJI/AAAAAAAAAmo/yLtaxax1Y1k/s72-c/Query_view.PNG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4057316417257375505</id><published>2011-02-01T22:05:00.000-08:00</published><updated>2011-02-01T22:08:03.305-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Query2'/><title type='text'>EMF Model Query2-The Next Generation Model Query</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="font-family: inherit;"&gt;&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;Need for EMF is well known and well documented everywhere.Usage of EMF across the software community is increasing day by day.Now what happens if the application which is based on EMF wants to query its EMF data, what happens when the model data grows gradually, who takes care of the scalability.Definetely a need arises when the querying of the model is of utmost importance.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;EMF project has a sub project called EMF Query which helps EMF users to achieve querying.Now this again has two subcomponents EMF Model Query and EMF Model Query2.EMF Model Query although has been addressing the concerns of model querying , but it suffers when the model data increases.EMF Model Query loads all the resources in the memory and then performs the querying.So this way of querying becomes a problem in case of large resources.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;So EMF Query2 uses an in build index mechanism which is very efficient and fast.So when querying is performed very minimal resource loading takes place and all the information is gathered from the index.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Among the other key features of Query2 is to express the query.The Query can be expressed in two formats one is the textual way which is an xtext based syntax.This completely looks like SQL and is very user intuitive.Users also get the flavor of writing the queries in the Java based format.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Queries are type safe that means, the Query2 framework contains a component called TypeChecker which checks the type safety of the Queries by checking it against the metamodel.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Query2 comes with a testing UI, which can be used by the user to test his models by firing queries.These queries are to be written in the textual format.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;In the next posts of Query2 i will put the screenshots for the testing UI and will show how it behaves.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;Query2 can be downloaded from here &lt;span style="font-family: &amp;quot;Calibri&amp;quot;, &amp;quot;sans-serif&amp;quot;; font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;&lt;a href="https://hudson.eclipse.org/hudson/job/tycho-query2-nightly/lastSuccessfulBuild/artifact/targetPlatform/"&gt;&lt;span style="color: blue;"&gt;https://hudson.eclipse.org/hudson/job/tycho-query2-nightly/lastSuccessfulBuild/artifact/targetPlatform/&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;Add the link mentioned above as the Update site to your IDE and download the plug-ins.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;span style="font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;Query2 Wiki home: &lt;span style="font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;&lt;a href="http://wiki.eclipse.org/EMF_Query2Home"&gt;&lt;span style="color: blue;"&gt;http://wiki.eclipse.org/EMF_Query2Home&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;&lt;span style="font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;&lt;span style="font-family: inherit;"&gt;Query2 Developer guide:&amp;nbsp;&lt;span style="font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;&lt;span style="mso-spacerun: yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://wiki.eclipse.org/EMF_Query2Home/EMF_Query2DevGuide"&gt;&lt;span style="color: blue;"&gt;http://wiki.eclipse.org/EMF_Query2Home/EMF_Query2DevGuide&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit; font-size: 11pt; mso-ansi-language: EN-US; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-US;"&gt;Keep a watch on this page for more interesting revelations about Query2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;cheers&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4057316417257375505?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4057316417257375505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4057316417257375505' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4057316417257375505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4057316417257375505'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/02/emf-model-query2-next-generation-model.html' title='EMF Model Query2-The Next Generation Model Query'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-1579305799263691249</id><published>2011-01-19T10:40:00.000-08:00</published><updated>2011-01-19T10:40:45.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Frameworks'/><title type='text'>Dont Nail Null in the Skull</title><content type='html'>Null in computer languages is like what Zero is in Mathematics.Java has no exception, i am sure everyone who has programmed in Java must have got NullPointerException sometime in their whole programming career.&lt;br /&gt;&lt;br /&gt;Handling Null can be tricky and very impactful in your code.Pragmatists would generally&amp;nbsp;argue don't pass null to the method, but i am sure this fellow can not be avoided.Our general hunch would be to directly go in the code and&amp;nbsp;check for the null.But does that really solve the problem ?.Once you do this you need to make sure the callee also handles the null well and then this chain will continue&lt;br /&gt;&lt;br /&gt;So, while looking over some code samples&amp;nbsp;and checking some web links i compile some best practices for handling null.Again the kind of approach you take will be dependent on your programming scenario.&lt;br /&gt;&lt;br /&gt;(a) &lt;em&gt;&lt;u&gt;Use of Exception: &lt;/u&gt;&lt;/em&gt;Exceptions could be thrown when you get an null, but yes this wont be NPE.I have seen many places where IllegalArgumentException is thrown.Very common thing to do when you want to check the arguments of a method, specially if it is a public API.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;if(argument==null)&lt;br /&gt;&amp;nbsp;throw new IllegalArgumentException("the provided argument was null "+argument);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(b) &lt;em&gt;&lt;u&gt;Use of Assertions: &lt;/u&gt;&lt;/em&gt;Some people will argue in favor of using Assertions over Exceptions.In this case the particular variable can be checked for an assertion with null.&lt;br /&gt;&lt;br /&gt;(c) &lt;em&gt;&lt;u&gt;Use of loggings:&lt;/u&gt;&amp;nbsp;&lt;/em&gt;Loggers are one of the most important component of any software application.I see some user get perturbed by seeing Exception or Assertions.So, for them a proper user intutive logging can be made in the log file.&lt;br /&gt;&lt;br /&gt;(d) &lt;em&gt;&lt;u&gt;Returning Empty objects: &lt;/u&gt;&lt;/em&gt;Some Java&amp;nbsp; Collections return Emtpy List, arrays.Java Collections framework author Joshua Bloch strongly recommends usage of empty objects.In this case the client or callee doesnt really have to take care of handling the NPE.These objects though have to be judiciously used.&lt;br /&gt;&lt;br /&gt;(e) &lt;em&gt;&lt;u&gt;Ease of debugging: &lt;/u&gt;&lt;/em&gt;Consider the following code&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;getObjectA().getObjectB().getObjectC().getObjectD();&lt;br /&gt;&lt;br /&gt;A stacktrace for NPE can point to this exact line , but it is not easy to find out which method call exactly has thrown the exeption.So, it is better to break up the above code into separate lines.&lt;br /&gt;&lt;br /&gt;Some other pointers could be usage of primitive types instead of Objects, doing "".equals(stringObject) rather than stringObject.equals("");&lt;br /&gt;&lt;br /&gt;I hope with this post i was able to nullify the null factor.Would love to hear more examples of handling null from you.&lt;br /&gt;&lt;br /&gt;Cheers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-1579305799263691249?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/1579305799263691249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=1579305799263691249' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1579305799263691249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1579305799263691249'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2011/01/dont-nail-null-in-skull.html' title='Dont Nail Null in the Skull'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2511244649256135082</id><published>2010-12-29T00:24:00.000-08:00</published><updated>2010-12-29T00:24:13.059-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Servlets'/><category scheme='http://www.blogger.com/atom/ns#' term='JSP'/><category scheme='http://www.blogger.com/atom/ns#' term='Facebook'/><title type='text'>Integrate your Web Site with Facebook through Java</title><content type='html'>Now a days majority of web sites are integrated with social networking sites like Facebook and Twitter.I believe its two way.The social network site is not complete unless it exposes it's API and allows other web sites to talk to it .The web site can not feel the same unless it allows its users to have interaction with the social networking site.&lt;br /&gt;&lt;br /&gt;Facebook now a days comes with a convinient Graph API, they have deprecated the old REST APIs.&lt;br /&gt;More details on Graph API can be found here &lt;a href="http://developers.facebook.com/docs/api/"&gt;http://developers.facebook.com/docs/api/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This post will cover how a facebook status message can be shared from a JSP page.For a web site or a web page to talk to Facebook.You need to allow the web site to talk to Facebook .i.e Facebook needs to authorize the Web site on behalf of the user.Facebook OAuth2 to authorize the user.&lt;br /&gt;&lt;br /&gt;Follow the steps below to authorize the web page to the facebook.&lt;br /&gt;&lt;br /&gt;1. Create a web site.&lt;br /&gt;2. Log on to facebook and register your web site with the facebook.Facebook will generate a client id and client secret for your web site which has to be used later.M&lt;br /&gt;3. Mention the callback url while registering the application, this callback URL will be used by facebook to redirect the response messages.&lt;br /&gt;&lt;br /&gt;On completion of above three steps would mean a web site has been sucessfully registered with Facebook.&lt;br /&gt;&lt;br /&gt;Next steps have to be performed from the web site.&lt;br /&gt;&lt;br /&gt;Facebook comes with set of permissions, in general when a web site is authorised to use Facebook it means only the general public information of the user can be used.Facebook has concept of extended permissions which can be used for extended permission levels like 'publish status messages', sending emails'.&lt;br /&gt;More details on how to authorize , about extended permissions can be found here.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://developers.facebook.com/docs/authentication/"&gt;http://developers.facebook.com/docs/authentication/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;How to authorize an user.&lt;br /&gt;&lt;br /&gt;(a) Authorize the web site on behalf of the user to access facebook by using the below call&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;a href="https://graph.facebook.com/oauth/authorize?client_id=...&amp;amp;redirect_uri=http://www.example.com/oauth_redirect"&gt;https://graph.facebook.com/oauth/authorize?client_id=...&amp;amp;redirect_uri=http://www.example.com/oauth_redirect&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The client id is the id user got once registering the web site on the Facebook.&lt;br /&gt;&lt;br /&gt;(b) Once Authorized get the Access token of the user.Facebook returns a code as a request parameter to the redirect URI mentioned.Once you get the code , use the same code value in the below call to get the access token.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;https://graph.facebook.com/oauth/access_token?&lt;br /&gt;&lt;br /&gt;client_id=...&amp;amp;redirect_uri=http://www.example.com/oauth_redirect&amp;amp;client_secret=...&amp;amp;code=...&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;Now here is the catch, Facebook does not return the access token to the redirected URI.It actually displays the acess token in its own URL.This acess token needs to be captured somehow. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;(c) Once you get the access token , this access token can be used to fetch user's other details like this &lt;br /&gt;&lt;a href="https://graph.facebook.com/me?access_token"&gt;https://graph.facebook.com/me?access_token&lt;/a&gt;=... &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Here i was using JSP/Servlets to make calls to Facebook.For this i used Restfb which is a lightweight Facebook API Java client.More details about Restfb here &lt;a href="http://restfb.com/"&gt;http://restfb.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;How to add restfb libraries in your project.&lt;br /&gt;Here i used Eclipse.Please follow the below steps to configure restfb for your project.&lt;br /&gt;&lt;br /&gt;(1) Create a Dynamic web project in Eclipse.&lt;br /&gt;(2) Download restfb.zip , extract it and copy paste the restfb.jar into the lib folder of the dynamic web project.&lt;br /&gt;(3) You also need to add restfb.jar in the J2EE module dependencies of the project.Right click on the project and click on properties and navigate to the J2EE module dependencies tab.Then add restfb.jar as the external jar.&amp;nbsp; &lt;br /&gt;&amp;nbsp; &lt;br /&gt;Now below is the combination of JSP/Servlet code which can take you through getting the access token. &lt;br /&gt;&lt;code&gt;&amp;nbsp; &lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;private static final long serialVersionUID = 1L; &lt;br /&gt;private String statusMsg;&lt;br /&gt;String appid = "your app id";&lt;br /&gt;String appsecret = "your app secret";&lt;br /&gt;String redirectURL = "http://localhost:8080/project_fb/facebookjsp.jsp";&lt;br /&gt;String authorizeURLStr = &lt;a href="https://graph.facebook.com/oauth/authorize?client_id="&gt;https://graph.facebook.com/oauth/authorize?client_id=&lt;/a&gt;&lt;br /&gt;+ appid + "&amp;amp;redirect_uri=" + redirectURL&lt;br /&gt;+"&amp;amp;scope="+"publish_stream";&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://pastebin.com/embed_iframe.php?i=aFKMaHkH" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; width: 100%;"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;The above servlet code shows how the response could be redirected with the authorized URL.Please note the FbModule.publishFeeds() method will be explained later in the post.&lt;br /&gt;&lt;br /&gt;Once you get the authorized code, put that code in the next call to get the access token like this.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;accessTokenURLStr = "https://graph.facebook.com/oauth/access_token?client_id="&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;+ appid + "&amp;amp;redirect_uri=" + redirectURL + "&amp;amp;client_secret=" + appsecret&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;+ "&amp;amp;code=" + code +"&amp;amp;type=web_server";&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Calling the above URL will redirect to Facebook's site.We need to capture the access token from this site.Below code shows how the access token could be captured and read.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;div class="code_box"&gt;&lt;script src="http://pastebin.com/embed_js.php?i=JFSQDG1i"&gt;&lt;/script&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;accessToken=readUrl(accessTokenURLStr).split("&amp;amp;")[0].replaceFirst("access_token=", "");&lt;/code&gt;&lt;br /&gt;&lt;code&gt;%&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The readUrl() method reads the access token.The accessToken variable now has the access token.&lt;br /&gt;&lt;br /&gt;Now the restFb framework comes into&amp;nbsp; the picture.Intitialize the restFb framework by passing the access token as the constructor.Once the framework is initialized ,call other framework APIs to publish the status message.&lt;br /&gt;&lt;br /&gt;&lt;div class="code_box"&gt;&lt;script src="http://pastebin.com/embed_js.php?i=e678Dgfi"&gt;&lt;/script&gt;&lt;/div&gt;&lt;br /&gt;As you can see this code actually publishes the status message&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;FacebookType publishMessageResponse =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; facebookClient.publish("me/feed", FacebookType.class,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Parameter.with("message", statusMsg));&lt;br /&gt;&lt;br /&gt;Check restfb documentation to find out how other APIs can be used to achieve other functionality with Facebook.&lt;br /&gt;I hope this post was useful how Facebook can be integrated with a web application which uses Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-2511244649256135082?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2511244649256135082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2511244649256135082' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2511244649256135082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2511244649256135082'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/12/integrate-your-web-site-with-facebook.html' title='Integrate your Web Site with Facebook through Java'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6738572010999026006</id><published>2010-12-17T23:01:00.000-08:00</published><updated>2010-12-17T23:03:04.545-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Frameworks'/><title type='text'>Philosophy behind Java Collections</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Collections framework as all Junta would agree with me is one of the most important packages in Java SDK.Computer science students would know both the fun and pain of writing the collections classes by themselves from their 'C' days.Well Java Collection brought the real fun of playing with Data structures.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;My major motivation behind this post is&amp;nbsp;&lt;a href="http://java.sun.com/developer/onlineTraining/collections/Collection.html"&gt;http://java.sun.com/developer/onlineTraining/collections/Collection.html&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;You may read this link or continue to read a gist of the link in this post.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Sets come to our mind as the basic collection, Sets are everywhere, set of numbers {0...9}, set of alphabets {a...z}.Given that the elements in the set can not be duplicate.Then came the maps where you have entries as key value pairs.When the keys of the maps are returned like Sets in keySet() , because keys can not be duplicate.With Lists interface came notion of indexing mechanism for collections.With lists the elements could be retrieved or inserted by specifying the &amp;nbsp;indexing number.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Generally if you have a data structure like Maps,lists you would like to traverse through all the elements, for this the collections framework came with a traversal interface called 'Iterator'.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Below are the basic methods of the 'Collections ' interface which can be used to work with any group of elements.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;add(element: Object) : boolean&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;addAll(collection: Collection) : boolean&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;contains(elements: Object) : boolean&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;size():int&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;remove(element:Object): boolean&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;removeAll(collection: Collection): boolean&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;toArray(): Object[]&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;toArray(array:Object[]): Object[]&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;iterator(): Iterator&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;code&gt;&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The names of the methods of the implies their importance and are pretty self explanatory.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;AbstractList class is an abstract implementation of the List interface which overrides the equals() and hashcode() methods.Two lists are equal if they are of same size and contains the same elements.Similarly as is done in the AbstractSet class.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Maps follow a completely different hierarchy &amp;nbsp;and they don't come from the Collections interface.They have methods like put, get etc.One of the most important method of the map is entrySet() which returns a set of Map.Entry.Map.Entry interface in turn is key value pair of the underlying map.Again there is an AbstractMap class which does the same as AbstractList and AbstractSet were doing.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;HashTable and Properties classes are one of the implementations of the Map interface.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Next comes the requirement for sorting the collections.Collections framework provides SortedMap and SortedSet classes which provides a sorted map and sorted set respectively.The&amp;nbsp;&lt;code style="color: #444444;"&gt;Comparable&lt;/code&gt;&amp;nbsp;interface, in the&amp;nbsp;&lt;code style="color: #444444;"&gt;java.lang&lt;/code&gt;&amp;nbsp;package, is for when a class has a natural ordering. Given a collection of objects of the same type, the interface allows you to order the collection into that natural ordering.With compareTo() method the logic for comparison of two elements can be written.Sorting can be itself a big topic which we can take up later.Further Java objects for primitive types like Integer,Character implement Comparable interface and have it &amp;nbsp;according to their natural ordering.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Collections framework provides a Collections class which is again a very utility class.Below lines will indicate its importance.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Collections can be made Singleton by using the singleton(T) method when you only want only one element to be part of the Singleton.The collections can be made thread safe by using the synchronized methods in the class.Collections can be made read only similarly by using the unmodified method.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;In Computer science again we come across very common operations on data structures like searching ,sorting.Collections class again provides&amp;nbsp;utility&amp;nbsp;methods like sorting and searching.Please have a look at the Collections class for more details.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The article also gave insight on the old Collection classes like Vector,Arrays,Dictionaries etc.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;For those who are fascinates by Trees they can have a look at this link&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.javakb.com/Uwe/Forum.aspx/java-programmer/9507/Trees-in-the-Java-Collections-framework"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;http://www.javakb.com/Uwe/Forum.aspx/java-programmer/9507/Trees-in-the-Java-Collections-framework&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;I found some good discussion about the Collections framework and why tree is not part of the collections framework.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;All in all Collections framework is one of the most facets of Java, without which java looks incomplete.I have seen people implementing new kind of Data Structures by implementing,extending or composing the above ones.The power of Collection framework is incomparable.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6738572010999026006?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6738572010999026006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6738572010999026006' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6738572010999026006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6738572010999026006'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/12/philosophy-behind-java-collections.html' title='Philosophy behind Java Collections'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2292889023822876398</id><published>2010-12-01T23:04:00.000-08:00</published><updated>2010-12-01T23:04:57.348-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='XSD'/><title type='text'>XSD APIs in Eclipse</title><content type='html'>For last few days i worked extensively on XSD and WSDL tooling for Eclipse, which included working and snarling on WSDL and XSD APIs of Eclipse.In this entry i plan to cover the basics of XSD and how Eclipse provides support for XSD.&lt;br /&gt;&lt;br /&gt;XSD as we know is a schema or in simple words the rule which defines a structural element like XML.XSD defines what elements,what types and what attributes can be defined in the structural document.One of the most important advantages which i feel XSD has it that it is written in XML.XSD schemas can be extended i.e. a XSD schema can be resued by another XSD schema.&lt;br /&gt;&lt;br /&gt;A basic entity of any XSD schema is an &lt;u&gt;element&lt;/u&gt;.An element is a single declaration tag which has a name and a type associated with it.The type can be of any type which itself comes from schema definition i.e. String,int etc.&lt;br /&gt;&lt;br /&gt;A Simple Type is only contains one element.A Complex Type is a collection of Simple types.These types can further contain restrictions which means the type validations like length,min,max occurrence can also be performed.&lt;br /&gt;&lt;br /&gt;This post is not about What XSD is, but i gave a quite briefing about What XSD is, its advantages and main features. This post higlights how Eclipse helps in XSD related things.&lt;br /&gt;&lt;br /&gt;Eclipse provides an API for XSD data manipulation.More details can be found &lt;a href="http://www.eclipse.org/modeling/mdt/?project=xsd#xsd"&gt;here&lt;/a&gt;.The XSD APIs are basically based on the EMF.An EMF model for the XSD was defined and then the code for the XSD APIs was generated.Those who are familiar with EMF must know that how EMF generates convenient classes for your runtime and would be able to grasp the XSD APIs much easier.&lt;br /&gt;&lt;br /&gt;For e.g. in case of XSD model it generates the XSDFactory class through which you can create your XSD related classes.The object level hierarchy and diagram is explained &lt;a href="http://download.eclipse.org/modeling/mdt/xsd/javadoc/2.3.0/org/eclipse/xsd/package-summary.html#details"&gt;here&lt;/a&gt;. The top level element is XSDComponent which is then again implemented by other elements.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;i&gt;Important classes&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;&lt;b&gt;XSDSchema&lt;/b&gt; is an important class which gives you access to the schema.It can be created like this&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;XSDFactory.eInstance.createXSDSchema();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you get the XSDSchema you get access to the namespace, document, version etc.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;XSDComplexTypeDefinition&lt;/b&gt; and &lt;b&gt;XSDSimpleTypeDefinition&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;As the name suggests couple of very important classes are the above two.These two classes gives you access to the ComplexTypes and SimpleTypes of the XSD.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;i&gt;How to add contents to the XSDSchema&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;Once you create the XSDSchema now you would like to add types to the XSD Schema.Below code shows how you can do this.&lt;br /&gt;XSDElementDeclaration is any type of element in the XSDSchema.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;XSDElementDeclaration element = XSDFactory.eINSTANCE&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;.createXSDElementDeclaration();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;element.setName(internalElementName);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;XSDComplexTypeDefinition xsdComplexTypeDefinition = XSDFactory.eINSTANCE&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;.createXSDComplexTypeDefinition();&lt;/code&gt;&lt;br /&gt;&lt;code&gt;elementDeclaration.setAnonymousTypeDefinition(xsdComplexTypeDefinition);&lt;/code&gt;&lt;br /&gt;&lt;div&gt;&lt;code&gt;xsdSchema.getContents().add(elementDeclaration);&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once the element is created, you need to associate a type with the element declared then add the element to the contents of the XSDSchema created.&lt;br /&gt;&lt;br /&gt;As this post is getting bigger i will cover how type&amp;nbsp;definitions&amp;nbsp;are created, how sequence information are added to the types. Check out this space for more information on XSD APIs of Eclipse.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-2292889023822876398?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2292889023822876398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2292889023822876398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2292889023822876398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2292889023822876398'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/12/xsd-apis-in-eclipse.html' title='XSD APIs in Eclipse'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4339187054361760784</id><published>2010-11-25T02:52:00.000-08:00</published><updated>2010-11-25T02:52:00.002-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='WTP'/><title type='text'>Configuring Server types in Eclipse (Tomcat)</title><content type='html'>Eclipse has a wonderful support for all kind of web and application servers through its WST adapter plug-ins.In this blog post i will cover a kind of short tutorial how we can add a specfic kind of server instance to the Eclipse.&lt;br /&gt;&lt;br /&gt;For this blog i am using&amp;nbsp;&amp;nbsp; the Ubiquitous Tomcat server here.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://1.bp.blogspot.com/_f8qPsCVykEE/TO43uVZP1BI/AAAAAAAAANs/HG4U5qWU79E/s1600/Server_view.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="88" ox="true" src="http://1.bp.blogspot.com/_f8qPsCVykEE/TO43uVZP1BI/AAAAAAAAANs/HG4U5qWU79E/s320/Server_view.jpg" width="320" /&gt;&lt;/a&gt;To add a server&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;Go to Window-&amp;gt;Show View- &amp;gt; Servers.&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;It will open a server viewas shown on the left hand side.Then right click on the view say -&amp;gt;New-&amp;gt;Server&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_f8qPsCVykEE/TO47QDEp15I/AAAAAAAAANw/bQOwQsXXp-0/s1600/Add_Server.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="167" ox="true" src="http://3.bp.blogspot.com/_f8qPsCVykEE/TO47QDEp15I/AAAAAAAAANw/bQOwQsXXp-0/s320/Add_Server.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;The left hand side image shows the available servers,&amp;nbsp;I add the tomcat 6.0 server here.Once done you will get a Tomcat server configuration page.&lt;br /&gt;&lt;br /&gt;Enter your tomcat server details there.Once done you will get the available 'Web Projects' in your workspace to be added to the Tomcat server.&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Just add whatever projects you want to be deployed onto the current servers&lt;br /&gt;&lt;br /&gt;Click finish and your tomcat server should be added and should be displayed like this in the server view.&lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_f8qPsCVykEE/TO491PM5EKI/AAAAAAAAAN0/hErFcsY76JI/s1600/Server_Added.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="92" ox="true" src="http://2.bp.blogspot.com/_f8qPsCVykEE/TO491PM5EKI/AAAAAAAAAN0/hErFcsY76JI/s320/Server_Added.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;Then you can go ahead and start the server.&lt;br /&gt;&lt;br /&gt;I showed with the tomcat server, in similar ways if you have your server installers for other servers also and you have the server adapter in your eclipse.You should be able to add the server and work with it.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4339187054361760784?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4339187054361760784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4339187054361760784' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4339187054361760784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4339187054361760784'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/11/configuring-server-types-in-eclipse.html' title='Configuring Server types in Eclipse (Tomcat)'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_f8qPsCVykEE/TO43uVZP1BI/AAAAAAAAANs/HG4U5qWU79E/s72-c/Server_view.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-3676770008761888441</id><published>2010-10-30T22:40:00.000-07:00</published><updated>2010-10-30T22:40:00.823-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='problem solving'/><title type='text'>Software problem solving-The web entangled</title><content type='html'>Mistakes could be done but most important thing is to learn from the mistakes and then not doing them.In my over five years of career in software engineering i have seen loads of challenges while developing software.Some challenges were really tough to comprehend and solve.&lt;br /&gt;&lt;br /&gt;In this post i would like to showcase some best practices we could do to solve these challenges and how to tackle them.&lt;br /&gt;&lt;br /&gt;(1) Write your problem in a sheet of paper.&lt;br /&gt;(2) Devise any alogrithm for that.&lt;br /&gt;(3) Do you have proper diagram.?&lt;br /&gt;(4) If yes, Solve it&lt;br /&gt;(5) Write tests for it after solving.&lt;br /&gt;(6) If any problem arises, break your code by the automated tests.&lt;br /&gt;(7) Once you solve the problem make sure the broken test is green now&lt;br /&gt;&lt;br /&gt;Smart debugging is one of the means how you can efficiently solve a problem.Lets limit our scope to debugging tools what we have.&lt;br /&gt;Smart debugging would mean following.&lt;br /&gt;&lt;br /&gt;(1) Identifying the problem.&lt;br /&gt;(2) If you know the classes where to put the breakpoint then its good and fine otherwise make an intelligent guess to find the class and put the breakpoint.&lt;br /&gt;(3) One more effective way would be backtracking, that is go to the error prone area, dig deep and find out the specific object which is causing the error.Check the object state and try to guess if you can find out anything.If not backtrack up the stack trace and try to get the clue.&lt;br /&gt;&lt;br /&gt;Another effective way is to post a specific questions on the forums.But make sure before asking a question on the forum you have done your homework.Only ask to the point questions and be prepared to answer any follow up questions.&lt;br /&gt;&lt;br /&gt;Again googling always helps.&lt;br /&gt;&lt;br /&gt;Hope this post helps.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Saurav&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-3676770008761888441?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/3676770008761888441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=3676770008761888441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/3676770008761888441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/3676770008761888441'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/10/software-problem-solving-web-entangled.html' title='Software problem solving-The web entangled'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-1518843229062955164</id><published>2010-10-23T09:01:00.000-07:00</published><updated>2010-10-24T08:00:50.008-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse Demo Camp'/><title type='text'>Bangalore Eclipse Demo Camp</title><content type='html'>Eclipse Demo camps are one of the wonderful initiatives by the Eclipse foundation.Twice a year Eclipse foundation alongwith some sponsors organize these events all across the world.&lt;br /&gt;These demo camps are the platform for other local Eclipse enthusiasts to get together and also to witness the latest happenings/demoes in the Eclipse world.&lt;br /&gt;&lt;br /&gt;This time SAP Labs India with Eclipse foundation is hosting the event on 19th of November.Few cool demoes will be on display.I will be presenting the all new next generation EMF Query language in the event.&lt;br /&gt;&lt;br /&gt;All participants will be eligible for some cool goodies.&lt;br /&gt;More details on how to register for the event can be found here.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wiki.eclipse.org/Eclipse_DemoCamps_November_2010/Bangalore"&gt;Bangalore Eclipse demo camp&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.eclipse.org/Eclipse_DemoCamps_November_2010/Bangalore"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Dont forget to attend the Event&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-1518843229062955164?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/1518843229062955164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=1518843229062955164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1518843229062955164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1518843229062955164'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/10/bangalore-eclipse-demo-camp.html' title='Bangalore Eclipse Demo Camp'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-5609043309038924139</id><published>2010-08-08T20:42:00.000-07:00</published><updated>2010-08-08T20:42:03.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google APIs'/><category scheme='http://www.blogger.com/atom/ns#' term='RCP'/><title type='text'>Contact Google APIs through Java and RCP</title><content type='html'>&lt;script type="text/javascript"&gt;window['PR_SHOULD_USE_CONTINUATION'] = true;/** the number of characters between tab columns */window['PR_TAB_WIDTH'] = 8;/** Walks the DOM returning a properly escaped version of innerHTML.  * @param {Node} node  * @param {Array.&lt;string&gt;} out output buffer that receives chunks of HTML.  */window['PR_normalizedHtml']/** Contains functions for creating and registering new language handlers.  * @type {Object}  */  = window['PR']/** Pretty print a chunk of code.  *  * @param {string} sourceCodeHtml code as html  * @return {string} code as html, but prettier  */  = window['prettyPrintOne']/** Find all the {@code &lt;pre&gt;} and {@code &lt;code&gt;} tags in the DOM with&lt;br /&gt;  * {@code class=prettyprint} and prettify them.&lt;br /&gt;  * @param {Function?} opt_whenDone if specified, called when the last entry&lt;br /&gt;  *     has been finished.&lt;br /&gt;  */&lt;br /&gt;  = window['prettyPrint'] = void 0;&lt;br /&gt;&lt;br /&gt;/** browser detection. @extern @returns false if not IE, otherwise the major version. */&lt;br /&gt;window['_pr_isIE6'] = function () {&lt;br /&gt;  var ieVersion = navigator &amp;&amp; navigator.userAgent &amp;&amp;&lt;br /&gt;      navigator.userAgent.match(/\bMSIE ([678])\./);&lt;br /&gt;  ieVersion = ieVersion ? +ieVersion[1] : false;&lt;br /&gt;  window['_pr_isIE6'] = function () { return ieVersion; };&lt;br /&gt;  return ieVersion;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(function () {&lt;br /&gt;  // Keyword lists for various languages.&lt;br /&gt;  var FLOW_CONTROL_KEYWORDS =&lt;br /&gt;      "break continue do else for if return while ";&lt;br /&gt;  var C_KEYWORDS = FLOW_CONTROL_KEYWORDS + "auto case char const default " +&lt;br /&gt;      "double enum extern float goto int long register short signed sizeof " +&lt;br /&gt;      "static struct switch typedef union unsigned void volatile ";&lt;br /&gt;  var COMMON_KEYWORDS = C_KEYWORDS + "catch class delete false import " +&lt;br /&gt;      "new operator private protected public this throw true try typeof ";&lt;br /&gt;  var CPP_KEYWORDS = COMMON_KEYWORDS + "alignof align_union asm axiom bool " +&lt;br /&gt;      "concept concept_map const_cast constexpr decltype " +&lt;br /&gt;      "dynamic_cast explicit export friend inline late_check " +&lt;br /&gt;      "mutable namespace nullptr reinterpret_cast static_assert static_cast " +&lt;br /&gt;      "template typeid typename using virtual wchar_t where ";&lt;br /&gt;  var JAVA_KEYWORDS = COMMON_KEYWORDS +&lt;br /&gt;      "abstract boolean byte extends final finally implements import " +&lt;br /&gt;      "instanceof null native package strictfp super synchronized throws " +&lt;br /&gt;      "transient ";&lt;br /&gt;  var CSHARP_KEYWORDS = JAVA_KEYWORDS +&lt;br /&gt;      "as base by checked decimal delegate descending event " +&lt;br /&gt;      "fixed foreach from group implicit in interface internal into is lock " +&lt;br /&gt;      "object out override orderby params partial readonly ref sbyte sealed " +&lt;br /&gt;      "stackalloc string select uint ulong unchecked unsafe ushort var ";&lt;br /&gt;  var JSCRIPT_KEYWORDS = COMMON_KEYWORDS +&lt;br /&gt;      "debugger eval export function get null set undefined var with " +&lt;br /&gt;      "Infinity NaN ";&lt;br /&gt;  var PERL_KEYWORDS = "caller delete die do dump elsif eval exit foreach for " +&lt;br /&gt;      "goto if import last local my next no our print package redo require " +&lt;br /&gt;      "sub undef unless until use wantarray while BEGIN END ";&lt;br /&gt;  var PYTHON_KEYWORDS = FLOW_CONTROL_KEYWORDS + "and as assert class def del " +&lt;br /&gt;      "elif except exec finally from global import in is lambda " +&lt;br /&gt;      "nonlocal not or pass print raise try with yield " +&lt;br /&gt;      "False True None ";&lt;br /&gt;  var RUBY_KEYWORDS = FLOW_CONTROL_KEYWORDS + "alias and begin case class def" +&lt;br /&gt;      " defined elsif end ensure false in module next nil not or redo rescue " +&lt;br /&gt;      "retry self super then true undef unless until when yield BEGIN END ";&lt;br /&gt;  var SH_KEYWORDS = FLOW_CONTROL_KEYWORDS + "case done elif esac eval fi " +&lt;br /&gt;      "function in local set then until ";&lt;br /&gt;  var ALL_KEYWORDS = (&lt;br /&gt;      CPP_KEYWORDS + CSHARP_KEYWORDS + JSCRIPT_KEYWORDS + PERL_KEYWORDS +&lt;br /&gt;      PYTHON_KEYWORDS + RUBY_KEYWORDS + SH_KEYWORDS);&lt;br /&gt;&lt;br /&gt;  // token style names.  correspond to css classes&lt;br /&gt;  /** token style for a string literal */&lt;br /&gt;  var PR_STRING = 'str';&lt;br /&gt;  /** token style for a keyword */&lt;br /&gt;  var PR_KEYWORD = 'kwd';&lt;br /&gt;  /** token style for a comment */&lt;br /&gt;  var PR_COMMENT = 'com';&lt;br /&gt;  /** token style for a type */&lt;br /&gt;  var PR_TYPE = 'typ';&lt;br /&gt;  /** token style for a literal value.  e.g. 1, null, true. */&lt;br /&gt;  var PR_LITERAL = 'lit';&lt;br /&gt;  /** token style for a punctuation string. */&lt;br /&gt;  var PR_PUNCTUATION = 'pun';&lt;br /&gt;  /** token style for a punctuation string. */&lt;br /&gt;  var PR_PLAIN = 'pln';&lt;br /&gt;&lt;br /&gt;  /** token style for an sgml tag. */&lt;br /&gt;  var PR_TAG = 'tag';&lt;br /&gt;  /** token style for a markup declaration such as a DOCTYPE. */&lt;br /&gt;  var PR_DECLARATION = 'dec';&lt;br /&gt;  /** token style for embedded source. */&lt;br /&gt;  var PR_SOURCE = 'src';&lt;br /&gt;  /** token style for an sgml attribute name. */&lt;br /&gt;  var PR_ATTRIB_NAME = 'atn';&lt;br /&gt;  /** token style for an sgml attribute value. */&lt;br /&gt;  var PR_ATTRIB_VALUE = 'atv';&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * A class that indicates a section of markup that is not code, e.g. to allow&lt;br /&gt;   * embedding of line numbers within code listings.&lt;br /&gt;   */&lt;br /&gt;  var PR_NOCODE = 'nocode';&lt;br /&gt;&lt;br /&gt;  /** A set of tokens that can precede a regular expression literal in&lt;br /&gt;    * javascript.&lt;br /&gt;    * http://www.mozilla.org/js/language/js20/rationale/syntax.html has the full&lt;br /&gt;    * list, but I've removed ones that might be problematic when seen in&lt;br /&gt;    * languages that don't support regular expression literals.&lt;br /&gt;    *&lt;br /&gt;    * &lt;p&gt;&lt;br /&gt;&lt;br /&gt;Specifically, I've removed any keywords that can't precede a regexp&lt;br /&gt;    * literal in a syntactically legal javascript program, and I've removed the&lt;br /&gt;    * "in" keyword since it's not a keyword in many languages, and might be used&lt;br /&gt;    * as a count of inches.&lt;br /&gt;    *&lt;br /&gt;    * &lt;p&gt;&lt;br /&gt;&lt;br /&gt;The link a above does not accurately describe EcmaScript rules since&lt;br /&gt;    * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works&lt;br /&gt;    * very well in practice.&lt;br /&gt;    *&lt;br /&gt;    * @private&lt;br /&gt;    */&lt;br /&gt;  var REGEXP_PRECEDER_PATTERN = function () {&lt;br /&gt;      var preceders = [&lt;br /&gt;          "!", "!=", "!==", "#", "%", "%=", "&amp;", "&amp;&amp;", "&amp;&amp;=",&lt;br /&gt;          "&amp;=", "(", "*", "*=", /* "+", */ "+=", ",", /* "-", */ "-=",&lt;br /&gt;          "-&gt;", /*".", "..", "...", handled below */ "/", "/=", ":", "::", ";",&lt;br /&gt;          "&lt;", "&lt;&lt;", "&lt;&lt;=", "&lt;=", "=", "==", "===", "&gt;",&lt;br /&gt;          "&gt;=", "&gt;&gt;", "&gt;&gt;=", "&gt;&gt;&gt;", "&gt;&gt;&gt;=", "?", "@", "[",&lt;br /&gt;          "^", "^=", "^^", "^^=", "{", "|", "|=", "||",&lt;br /&gt;          "||=", "~" /* handles =~ and !~ */,&lt;br /&gt;          "break", "case", "continue", "delete",&lt;br /&gt;          "do", "else", "finally", "instanceof",&lt;br /&gt;          "return", "throw", "try", "typeof"&lt;br /&gt;          ];&lt;br /&gt;      var pattern = '(?:^^|[+-]';&lt;br /&gt;      for (var i = 0; i &lt; preceders.length; ++i) {&lt;br /&gt;        pattern += '|' + preceders[i].replace(/([^=&lt;&gt;:&amp;a-z])/g, '\\$1');&lt;br /&gt;      }&lt;br /&gt;      pattern += ')\\s*';  // matches at end, and matches empty string&lt;br /&gt;      return pattern;&lt;br /&gt;      // CAVEAT: this does not properly handle the case where a regular&lt;br /&gt;      // expression immediately follows another since a regular expression may&lt;br /&gt;      // have flags for case-sensitivity and the like.  Having regexp tokens&lt;br /&gt;      // adjacent is not valid in any language I'm aware of, so I'm punting.&lt;br /&gt;      // TODO: maybe style special characters inside a regexp as punctuation.&lt;br /&gt;    }();&lt;br /&gt;&lt;br /&gt;  // Define regexps here so that the interpreter doesn't have to create an&lt;br /&gt;  // object each time the function containing them is called.&lt;br /&gt;  // The language spec requires a new object created even if you don't access&lt;br /&gt;  // the $1 members.&lt;br /&gt;  var pr_amp = /&amp;/g;&lt;br /&gt;  var pr_lt = /&lt;/g;&lt;br /&gt;  var pr_gt = /&gt;/g;&lt;br /&gt;  var pr_quot = /\"/g;&lt;br /&gt;  /** like textToHtml but escapes double quotes to be attribute safe. */&lt;br /&gt;  function attribToHtml(str) {&lt;br /&gt;    return str.replace(pr_amp, '&amp;amp;')&lt;br /&gt;        .replace(pr_lt, '&lt;')&lt;br /&gt;        .replace(pr_gt, '&gt;')&lt;br /&gt;        .replace(pr_quot, '&amp;quot;');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** escapest html special characters to html. */&lt;br /&gt;  function textToHtml(str) {&lt;br /&gt;    return str.replace(pr_amp, '&amp;amp;')&lt;br /&gt;        .replace(pr_lt, '&lt;')&lt;br /&gt;        .replace(pr_gt, '&gt;');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  var pr_ltEnt = /&lt;/g;&lt;br /&gt;  var pr_gtEnt = /&gt;/g;&lt;br /&gt;  var pr_aposEnt = /&amp;apos;/g;&lt;br /&gt;  var pr_quotEnt = /&amp;quot;/g;&lt;br /&gt;  var pr_ampEnt = /&amp;amp;/g;&lt;br /&gt;  var pr_nbspEnt = /&amp;nbsp;/g;&lt;br /&gt;  /** unescapes html to plain text. */&lt;br /&gt;  function htmlToText(html) {&lt;br /&gt;    var pos = html.indexOf('&amp;');&lt;br /&gt;    if (pos &lt; 0) { return html; }&lt;br /&gt;    // Handle numeric entities specially.  We can't use functional substitution&lt;br /&gt;    // since that doesn't work in older versions of Safari.&lt;br /&gt;    // These should be rare since most browsers convert them to normal chars.&lt;br /&gt;    for (--pos; (pos = html.indexOf('&amp;#', pos + 1)) &gt;= 0;) {&lt;br /&gt;      var end = html.indexOf(';', pos);&lt;br /&gt;      if (end &gt;= 0) {&lt;br /&gt;        var num = html.substring(pos + 3, end);&lt;br /&gt;        var radix = 10;&lt;br /&gt;        if (num &amp;&amp; num.charAt(0) === 'x') {&lt;br /&gt;          num = num.substring(1);&lt;br /&gt;          radix = 16;&lt;br /&gt;        }&lt;br /&gt;        var codePoint = parseInt(num, radix);&lt;br /&gt;        if (!isNaN(codePoint)) {&lt;br /&gt;          html = (html.substring(0, pos) + String.fromCharCode(codePoint) +&lt;br /&gt;                  html.substring(end + 1));&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return html.replace(pr_ltEnt, '&lt;')&lt;br /&gt;        .replace(pr_gtEnt, '&gt;')&lt;br /&gt;        .replace(pr_aposEnt, "'")&lt;br /&gt;        .replace(pr_quotEnt, '"')&lt;br /&gt;        .replace(pr_nbspEnt, ' ')&lt;br /&gt;        .replace(pr_ampEnt, '&amp;');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** is the given node's innerHTML normally unescaped? */&lt;br /&gt;  function isRawContent(node) {&lt;br /&gt;    return 'XMP' === node.tagName;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var newlineRe = /[\r\n]/g;&lt;br /&gt;  /**&lt;br /&gt;   * Are newlines and adjacent spaces significant in the given node's innerHTML?&lt;br /&gt;   */&lt;br /&gt;  function isPreformatted(node, content) {&lt;br /&gt;    // PRE means preformatted, and is a very common case, so don't create&lt;br /&gt;    // unnecessary computed style objects.&lt;br /&gt;    if ('PRE' === node.tagName) { return true; }&lt;br /&gt;    if (!newlineRe.test(content)) { return true; }  // Don't care&lt;br /&gt;    var whitespace = '';&lt;br /&gt;    // For disconnected nodes, IE has no currentStyle.&lt;br /&gt;    if (node.currentStyle) {&lt;br /&gt;      whitespace = node.currentStyle.whiteSpace;&lt;br /&gt;    } else if (window.getComputedStyle) {&lt;br /&gt;      // Firefox makes a best guess if node is disconnected whereas Safari&lt;br /&gt;      // returns the empty string.&lt;br /&gt;      whitespace = window.getComputedStyle(node, null).whiteSpace;&lt;br /&gt;    }&lt;br /&gt;    return !whitespace || whitespace === 'pre';&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function normalizedHtml(node, out, opt_sortAttrs) {&lt;br /&gt;    switch (node.nodeType) {&lt;br /&gt;      case 1:  // an element&lt;br /&gt;        var name = node.tagName.toLowerCase();&lt;br /&gt;&lt;br /&gt;        out.push('&lt;', name);&lt;br /&gt;        var attrs = node.attributes;&lt;br /&gt;        var n = attrs.length;&lt;br /&gt;        if (n) {&lt;br /&gt;          if (opt_sortAttrs) {&lt;br /&gt;            var sortedAttrs = [];&lt;br /&gt;            for (var i = n; --i &gt;= 0;) { sortedAttrs[i] = attrs[i]; }&lt;br /&gt;            sortedAttrs.sort(function (a, b) {&lt;br /&gt;                return (a.name &lt; b.name) ? -1 : a.name === b.name ? 0 : 1;&lt;br /&gt;              });&lt;br /&gt;            attrs = sortedAttrs;&lt;br /&gt;          }&lt;br /&gt;          for (var i = 0; i &lt; n; ++i) {&lt;br /&gt;            var attr = attrs[i];&lt;br /&gt;            if (!attr.specified) { continue; }&lt;br /&gt;            out.push(' ', attr.name.toLowerCase(),&lt;br /&gt;                     '="', attribToHtml(attr.value), '"');&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;        out.push('&gt;');&lt;br /&gt;        for (var child = node.firstChild; child; child = child.nextSibling) {&lt;br /&gt;          normalizedHtml(child, out, opt_sortAttrs);&lt;br /&gt;        }&lt;br /&gt;        if (node.firstChild || !/^(?:br|link|img)$/.test(name)) {&lt;br /&gt;          out.push('&lt;\/', name, '&gt;');&lt;br /&gt;        }&lt;br /&gt;        break;&lt;br /&gt;      case 3: case 4: // text&lt;br /&gt;        out.push(textToHtml(node.nodeValue));&lt;br /&gt;        break;&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally&lt;br /&gt;   * matches the union o the sets o strings matched d by the input RegExp.&lt;br /&gt;   * Since it matches globally, if the input strings have a start-of-input&lt;br /&gt;   * anchor (/^.../), it is ignored for the purposes of unioning.&lt;br /&gt;   * @param {Array.&lt;regexp&gt;} regexs non multiline, non-global regexs.&lt;br /&gt;   * @return {RegExp} a global regex.&lt;br /&gt;   */&lt;br /&gt;  function combinePrefixPatterns(regexs) {&lt;br /&gt;    var capturedGroupIndex = 0;&lt;br /&gt;&lt;br /&gt;    var needToFoldCase = false;&lt;br /&gt;    var ignoreCase = false;&lt;br /&gt;    for (var i = 0, n = regexs.length; i &lt; n; ++i) {&lt;br /&gt;      var regex = regexs[i];&lt;br /&gt;      if (regex.ignoreCase) {&lt;br /&gt;        ignoreCase = true;&lt;br /&gt;      } else if (/[a-z]/i.test(regex.source.replace(&lt;br /&gt;                     /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {&lt;br /&gt;        needToFoldCase = true;&lt;br /&gt;        ignoreCase = false;&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function decodeEscape(charsetPart) {&lt;br /&gt;      if (charsetPart.charAt(0) !== '\\') { return charsetPart.charCodeAt(0); }&lt;br /&gt;      switch (charsetPart.charAt(1)) {&lt;br /&gt;        case 'b': return 8;&lt;br /&gt;        case 't': return 9;&lt;br /&gt;        case 'n': return 0xa;&lt;br /&gt;        case 'v': return 0xb;&lt;br /&gt;        case 'f': return 0xc;&lt;br /&gt;        case 'r': return 0xd;&lt;br /&gt;        case 'u': case 'x':&lt;br /&gt;          return parseInt(charsetPart.substring(2), 16)&lt;br /&gt;              || charsetPart.charCodeAt(1);&lt;br /&gt;        case '0': case '1': case '2': case '3': case '4':&lt;br /&gt;        case '5': case '6': case '7':&lt;br /&gt;          return parseInt(charsetPart.substring(1), 8);&lt;br /&gt;        default: return charsetPart.charCodeAt(1);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function encodeEscape(charCode) {&lt;br /&gt;      if (charCode &lt; 0x20) {&lt;br /&gt;        return (charCode &lt; 0x10 ? '\\x0' : '\\x') + charCode.toString(16);&lt;br /&gt;      }&lt;br /&gt;      var ch = String.fromCharCode(charCode);&lt;br /&gt;      if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {&lt;br /&gt;        ch = '\\' + ch;&lt;br /&gt;      }&lt;br /&gt;      return ch;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function caseFoldCharset(charSet) {&lt;br /&gt;      var charsetParts = charSet.substring(1, charSet.length - 1).match(&lt;br /&gt;          new RegExp(&lt;br /&gt;              '\\\\u[0-9A-Fa-f]{4}'&lt;br /&gt;              + '|\\\\x[0-9A-Fa-f]{2}'&lt;br /&gt;              + '|\\\\[0-3][0-7]{0,2}'&lt;br /&gt;              + '|\\\\[0-7]{1,2}'&lt;br /&gt;              + '|\\\\[\\s\\S]'&lt;br /&gt;              + '|-'&lt;br /&gt;              + '|[^-\\\\]',&lt;br /&gt;              'g'));&lt;br /&gt;      var groups = [];&lt;br /&gt;      var ranges = [];&lt;br /&gt;      var inverse = charsetParts[0] === '^';&lt;br /&gt;      for (var i = inverse ? 1 : 0, n = charsetParts.length; i &lt; n; ++i) {&lt;br /&gt;        var p = charsetParts[i];&lt;br /&gt;        switch (p) {&lt;br /&gt;          case '\\B': case '\\b':&lt;br /&gt;          case '\\D': case '\\d':&lt;br /&gt;          case '\\S': case '\\s':&lt;br /&gt;          case '\\W': case '\\w':&lt;br /&gt;            groups.push(p);&lt;br /&gt;            continue;&lt;br /&gt;        }&lt;br /&gt;        var start = decodeEscape(p);&lt;br /&gt;        var end;&lt;br /&gt;        if (i + 2 &lt; n &amp;&amp; '-' === charsetParts[i + 1]) {&lt;br /&gt;          end = decodeEscape(charsetParts[i + 2]);&lt;br /&gt;          i += 2;&lt;br /&gt;        } else {&lt;br /&gt;          end = start;&lt;br /&gt;        }&lt;br /&gt;        ranges.push([start, end]);&lt;br /&gt;        // If the range might intersect letters, then expand it.&lt;br /&gt;        if (!(end &lt; 65 || start &gt; 122)) {&lt;br /&gt;          if (!(end &lt; 65 || start &gt; 90)) {&lt;br /&gt;            ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);&lt;br /&gt;          }&lt;br /&gt;          if (!(end &lt; 97 || start &gt; 122)) {&lt;br /&gt;            ranges.push([Math.max(97, start) &amp; ~32, Math.min(end, 122) &amp; ~32]);&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]&lt;br /&gt;      // -&gt; [[1, 12], [14, 14], [16, 17]]&lt;br /&gt;      ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1]  - a[1]); });&lt;br /&gt;      var consolidatedRanges = [];&lt;br /&gt;      var lastRange = [NaN, NaN];&lt;br /&gt;      for (var i = 0; i &lt; ranges.length; ++i) {&lt;br /&gt;        var range = ranges[i];&lt;br /&gt;        if (range[0] &lt;= lastRange[1] + 1) {&lt;br /&gt;          lastRange[1] = Math.max(lastRange[1], range[1]);&lt;br /&gt;        } else {&lt;br /&gt;          consolidatedRanges.push(lastRange = range);&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      var out = ['['];&lt;br /&gt;      if (inverse) { out.push('^'); }&lt;br /&gt;      out.push.apply(out, groups);&lt;br /&gt;      for (var i = 0; i &lt; consolidatedRanges.length; ++i) {&lt;br /&gt;        var range = consolidatedRanges[i];&lt;br /&gt;        out.push(encodeEscape(range[0]));&lt;br /&gt;        if (range[1] &gt; range[0]) {&lt;br /&gt;          if (range[1] + 1 &gt; range[0]) { out.push('-'); }&lt;br /&gt;          out.push(encodeEscape(range[1]));&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      out.push(']');&lt;br /&gt;      return out.join('');&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function allowAnywhereFoldCaseAndRenumberGroups(regex) {&lt;br /&gt;      // Split into character sets, escape sequences, punctuation strings&lt;br /&gt;      // like ('(', '(?:', ')', '^'), and runs of characters that do not&lt;br /&gt;      // include any of the above.&lt;br /&gt;      var parts = regex.source.match(&lt;br /&gt;          new RegExp(&lt;br /&gt;              '(?:'&lt;br /&gt;              + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]'  // a character set&lt;br /&gt;              + '|\\\\u[A-Fa-f0-9]{4}'  // a unicode escape&lt;br /&gt;              + '|\\\\x[A-Fa-f0-9]{2}'  // a hex escape&lt;br /&gt;              + '|\\\\[0-9]+'  // a back-reference or octal escape&lt;br /&gt;              + '|\\\\[^ux0-9]'  // other escape sequence&lt;br /&gt;              + '|\\(\\?[:!=]'  // start of a non-capturing group&lt;br /&gt;              + '|[\\(\\)\\^]'  // start/emd of a group, or line start&lt;br /&gt;              + '|[^\\x5B\\x5C\\(\\)\\^]+'  // run of other characters&lt;br /&gt;              + ')',&lt;br /&gt;              'g'));&lt;br /&gt;      var n = parts.length;&lt;br /&gt;&lt;br /&gt;      // Maps captured group numbers to the number they will occupy in&lt;br /&gt;      // the output or to -1 if that has not been determined, or to&lt;br /&gt;      // undefined if they need not be capturing in the output.&lt;br /&gt;      var capturedGroups = [];&lt;br /&gt;&lt;br /&gt;      // Walk over and identify back references to build the capturedGroups&lt;br /&gt;      // mapping.&lt;br /&gt;      for (var i = 0, groupIndex = 0; i &lt; n; ++i) {&lt;br /&gt;        var p = parts[i];&lt;br /&gt;        if (p === '(') {&lt;br /&gt;          // groups are 1-indexed, so max group index is count of '('&lt;br /&gt;          ++groupIndex;&lt;br /&gt;        } else if ('\\' === p.charAt(0)) {&lt;br /&gt;          var decimalValue = +p.substring(1);&lt;br /&gt;          if (decimalValue &amp;&amp; decimalValue &lt;= groupIndex) {&lt;br /&gt;            capturedGroups[decimalValue] = -1;&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      // Renumber groups and reduce capturing groups to non-capturing groups&lt;br /&gt;      // where possible.&lt;br /&gt;      for (var i = 1; i &lt; capturedGroups.length; ++i) {&lt;br /&gt;        if (-1 === capturedGroups[i]) {&lt;br /&gt;          capturedGroups[i] = ++capturedGroupIndex;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      for (var i = 0, groupIndex = 0; i &lt; n; ++i) {&lt;br /&gt;        var p = parts[i];&lt;br /&gt;        if (p === '(') {&lt;br /&gt;          ++groupIndex;&lt;br /&gt;          if (capturedGroups[groupIndex] === undefined) {&lt;br /&gt;            parts[i] = '(?:';&lt;br /&gt;          }&lt;br /&gt;        } else if ('\\' === p.charAt(0)) {&lt;br /&gt;          var decimalValue = +p.substring(1);&lt;br /&gt;          if (decimalValue &amp;&amp; decimalValue &lt;= groupIndex) {&lt;br /&gt;            parts[i] = '\\' + capturedGroups[groupIndex];&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      // Remove any prefix anchors so that the output will match anywhere.&lt;br /&gt;      // ^^ really does mean an anchored match though.&lt;br /&gt;      for (var i = 0, groupIndex = 0; i &lt; n; ++i) {&lt;br /&gt;        if ('^' === parts[i] &amp;&amp; '^' !== parts[i + 1]) { parts[i] = ''; }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      // Expand letters to groupts to handle mixing of case-sensitive and&lt;br /&gt;      // case-insensitive patterns if necessary.&lt;br /&gt;      if (regex.ignoreCase &amp;&amp; needToFoldCase) {&lt;br /&gt;        for (var i = 0; i &lt; n; ++i) {&lt;br /&gt;          var p = parts[i];&lt;br /&gt;          var ch0 = p.charAt(0);&lt;br /&gt;          if (p.length &gt;= 2 &amp;&amp; ch0 === '[') {&lt;br /&gt;            parts[i] = caseFoldCharset(p);&lt;br /&gt;          } else if (ch0 !== '\\') {&lt;br /&gt;            // TODO: handle letters in numeric escapes.&lt;br /&gt;            parts[i] = p.replace(&lt;br /&gt;                /[a-zA-Z]/g,&lt;br /&gt;                function (ch) {&lt;br /&gt;                  var cc = ch.charCodeAt(0);&lt;br /&gt;                  return '[' + String.fromCharCode(cc &amp; ~32, cc | 32) + ']';&lt;br /&gt;                });&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      return parts.join('');&lt;br /&gt;    }&lt;br /&gt; var rewritten = [];&lt;br /&gt;    for (var i = 0, n = regexs.length; i &lt; n; ++i) {&lt;br /&gt;      var regex = regexs[i];&lt;br /&gt;      if (regex.global || regex.multiline) { throw new Error('' + regex); }&lt;br /&gt;      rewritten.push(&lt;br /&gt;          '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var PR_innerHtmlWorks = null;&lt;br /&gt;  function getInnerHtml(node) {&lt;br /&gt;    // inner html is hopelessly broken in Safari 2.0.4 when the content is&lt;br /&gt;    // an html description of well formed XML and the containing tag is a PRE&lt;br /&gt;    // tag, so we detect that case and emulate innerHTML.&lt;br /&gt;    if (null === PR_innerHtmlWorks) {&lt;br /&gt;      var testNode = document.createElement('PRE');&lt;br /&gt;      testNode.appendChild(&lt;br /&gt;          document.createTextNode('&lt;!DOCTYPE foo PUBLIC "foo bar"&gt;\n&lt;foo /&gt;'));&lt;br /&gt;      PR_innerHtmlWorks = !/&lt;/.test(testNode.innerHTML);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    if (PR_innerHtmlWorks) {&lt;br /&gt;      var content = node.innerHTML;&lt;br /&gt;      // XMP tags contain unescaped entities so require special handling.&lt;br /&gt;      if (isRawContent(node)) {&lt;br /&gt;        content = textToHtml(content);&lt;br /&gt;      } else if (!isPreformatted(node, content)) {&lt;br /&gt;        content = content.replace(/(&lt;br\s*\/?&gt;)[\r\n]+/g, '$1')&lt;br /&gt;            .replace(/(?:[\r\n]+[ \t]*)+/g, ' ');&lt;br /&gt;      }&lt;br /&gt;      return content;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    var out = [];&lt;br /&gt;    for (var child = node.firstChild; child; child = child.nextSibling) {&lt;br /&gt;      normalizedHtml(child, out);&lt;br /&gt;    }&lt;br /&gt;    return out.join('');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** returns a function that expand tabs to spaces.  This function can be fed&lt;br /&gt;    * successive chunks of text, and will maintain its own internal state to&lt;br /&gt;    * keep track of how tabs are expanded.&lt;br /&gt;    * @return {function (string) : string} a function that takes&lt;br /&gt;    *   plain text and return the text with tabs expanded.&lt;br /&gt;    * @private&lt;br /&gt;    */&lt;br /&gt;  function makeTabExpander(tabWidth) {&lt;br /&gt;    var SPACES = '                ';&lt;br /&gt;    var charInLine = 0;&lt;br /&gt;&lt;br /&gt;    return function (plainText) {&lt;br /&gt;      // walk over each character looking for tabs and newlines.&lt;br /&gt;      // On tabs, expand them.  On newlines, reset charInLine.&lt;br /&gt;      // Otherwise increment charInLine&lt;br /&gt;      var out = null;&lt;br /&gt;      var pos = 0;&lt;br /&gt;      for (var i = 0, n = plainText.length; i &lt; n; ++i) {&lt;br /&gt;        var ch = plainText.charAt(i);&lt;br /&gt;&lt;br /&gt;        switch (ch) {&lt;br /&gt;          case '\t':&lt;br /&gt;            if (!out) { out = []; }&lt;br /&gt;            out.push(plainText.substring(pos, i));&lt;br /&gt;            // calculate how much space we need in front of this part&lt;br /&gt;            // nSpaces is the amount of padding -- the number of spaces needed&lt;br /&gt;            // to move us to the next column, where columns occur at factors of&lt;br /&gt;            // tabWidth.&lt;br /&gt;            var nSpaces = tabWidth - (charInLine % tabWidth);&lt;br /&gt;            charInLine += nSpaces;&lt;br /&gt;            for (; nSpaces &gt;= 0; nSpaces -= SPACES.length) {&lt;br /&gt;              out.push(SPACES.substring(0, nSpaces));&lt;br /&gt;            }&lt;br /&gt;            pos = i + 1;&lt;br /&gt;            break;&lt;br /&gt;          case '\n':&lt;br /&gt;            charInLine = 0;&lt;br /&gt;            break;&lt;br /&gt;          default:&lt;br /&gt;            ++charInLine;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      if (!out) { return plainText; }&lt;br /&gt;      out.push(plainText.substring(pos));&lt;br /&gt;      return out.join('');&lt;br /&gt;    };&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var pr_chunkPattern = new RegExp(&lt;br /&gt;      '[^&lt;]+'  // A run of characters other than '&lt;'&lt;br /&gt;      + '|&lt;\!--[\\s\\S]*?--\&gt;'  // an HTML comment&lt;br /&gt;      + '|&lt;!\\[CDATA\\[[\\s\\S]*?\\]\\]&gt;'  // a CDATA section&lt;br /&gt;      // a probable tag that should not be highlighted&lt;br /&gt;      + '|&lt;\/?[a-zA-Z](?:[^&gt;\"\']|\'[^\']*\'|\"[^\"]*\")*&gt;'&lt;br /&gt;      + '|&lt;',  // A '&lt;' that does not begin a larger chunk&lt;br /&gt;      'g');&lt;br /&gt;  var pr_commentPrefix = /^&lt;\!--/;&lt;br /&gt;  var pr_cdataPrefix = /^&lt;!\[CDATA\[/;&lt;br /&gt;  var pr_brPrefix = /^&lt;br\b/i;&lt;br /&gt;  var pr_tagNameRe = /^&lt;(\/?)([a-zA-Z][a-zA-Z0-9]*)/;&lt;br /&gt;&lt;br /&gt;  /** split markup into chunks of html tags (style null) and&lt;br /&gt;    * plain text (style {@link #PR_PLAIN}), converting tags which are&lt;br /&gt;    * significant for tokenization (&lt;br /&gt;) into their textual equivalent.&lt;br /&gt;    *&lt;br /&gt;    * @param {string} s html where whitespace is considered significant.&lt;br /&gt;    * @return {Object} source code and extracted tags.&lt;br /&gt;    * @private&lt;br /&gt;    */&lt;br /&gt;  function extractTags(s) {&lt;br /&gt;    // since the pattern has the 'g' modifier and defines no capturing groups,&lt;br /&gt;    // this will return a list of all chunks which we then classify and wrap as&lt;br /&gt;    // PR_Tokens&lt;br /&gt;    var matches = s.match(pr_chunkPattern);&lt;br /&gt;    var sourceBuf = [];&lt;br /&gt;    var sourceBufLen = 0;&lt;br /&gt;    var extractedTags = [];&lt;br /&gt;    if (matches) {&lt;br /&gt;      for (var i = 0, n = matches.length; i &lt; n; ++i) {&lt;br /&gt;        var match = matches[i];&lt;br /&gt;        if (match.length &gt; 1 &amp;&amp; match.charAt(0) === '&lt;') {&lt;br /&gt;          if (pr_commentPrefix.test(match)) { continue; }&lt;br /&gt;          if (pr_cdataPrefix.test(match)) {&lt;br /&gt;            // strip CDATA prefix and suffix.  Don't unescape since it's CDATA&lt;br /&gt;            sourceBuf.push(match.substring(9, match.length - 3));&lt;br /&gt;            sourceBufLen += match.length - 12;&lt;br /&gt;          } else if (pr_brPrefix.test(match)) {&lt;br /&gt;            // &lt;br /&gt;tags are lexically significant so convert them to text.&lt;br /&gt;            // This is undone later.&lt;br /&gt;            sourceBuf.push('\n');&lt;br /&gt;            ++sourceBufLen;&lt;br /&gt;          } else {&lt;br /&gt;            if (match.indexOf(PR_NOCODE) &gt;= 0 &amp;&amp; isNoCodeTag(match)) {&lt;br /&gt;              // A &lt;span class="nocode"&gt; will start a section that should be&lt;br /&gt;              // ignored.  Continue walking the list until we see a matching end&lt;br /&gt;              // tag.&lt;br /&gt;              var name = match.match(pr_tagNameRe)[2];&lt;br /&gt;              var depth = 1;&lt;br /&gt;              var j;&lt;br /&gt;              end_tag_loop:&lt;br /&gt;              for (j = i + 1; j &lt; n; ++j) {&lt;br /&gt;                var name2 = matches[j].match(pr_tagNameRe);&lt;br /&gt;                if (name2 &amp;&amp; name2[2] === name) {&lt;br /&gt;                  if (name2[1] === '/') {&lt;br /&gt;                    if (--depth === 0) { break end_tag_loop; }&lt;br /&gt;                  } else {&lt;br /&gt;                    ++depth;&lt;br /&gt;                  }&lt;br /&gt;                }&lt;br /&gt;              }&lt;br /&gt;              if (j &lt; n) {&lt;br /&gt;                extractedTags.push(&lt;br /&gt;                    sourceBufLen, matches.slice(i, j + 1).join(''));&lt;br /&gt;                i = j;&lt;br /&gt;              } else {  // Ignore unclosed sections.&lt;br /&gt;                extractedTags.push(sourceBufLen, match);&lt;br /&gt;              }&lt;br /&gt;            } else {&lt;br /&gt;              extractedTags.push(sourceBufLen, match);&lt;br /&gt;            }&lt;br /&gt;          }&lt;br /&gt;        } else {&lt;br /&gt;          var literalText = htmlToText(match);&lt;br /&gt;          sourceBuf.push(literalText);&lt;br /&gt;          sourceBufLen += literalText.length;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    return { source: sourceBuf.join(''), tags: extractedTags };&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** True if the given tag contains a class attribute with the nocode class. */&lt;br /&gt;  function isNoCodeTag(tag) {&lt;br /&gt;    return !!tag&lt;br /&gt;        // First canonicalize the representation of attributes&lt;br /&gt;        .replace(/\s(\w+)\s*=\s*(?:\"([^\"]*)\"|'([^\']*)'|(\S+))/g,&lt;br /&gt;                 ' $1="$2$3$4"')&lt;br /&gt;        // Then look for the attribute we want.&lt;br /&gt;        .match(/[cC][lL][aA][sS][sS]=\"[^\"]*\bnocode\b/);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * Apply the given language handler to sourceCode and add the resulting&lt;br /&gt;   * decorations to out.&lt;br /&gt;   * @param {number} basePos the index of sourceCode within the chunk of source&lt;br /&gt;   *    whose decorations are already present on out.&lt;br /&gt;   */&lt;br /&gt;  function appendDecorations(basePos, sourceCode, langHandler, out) {&lt;br /&gt;    if (!sourceCode) { return; }&lt;br /&gt;    var job = {&lt;br /&gt;      source: sourceCode,&lt;br /&gt;      basePos: basePos&lt;br /&gt;    };&lt;br /&gt;    langHandler(job);&lt;br /&gt;    out.push.apply(out, job.decorations);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** Given triples of [style, pattern, context] returns a lexing function,&lt;br /&gt;    * The lexing function interprets the patterns to find token boundaries and&lt;br /&gt;    * returns a decoration list of the form&lt;br /&gt;    * [index_0, style_0, index_1, style_1, ..., index_n, style_n]&lt;br /&gt;    * where index_n is an index into the sourceCode, and style_n is a style&lt;br /&gt;    * constant like PR_PLAIN.  index_n-1 &lt;= index_n, and style_n-1 applies to&lt;br /&gt;    * all characters in sourceCode[index_n-1:index_n].&lt;br /&gt;    *&lt;br /&gt;    * The stylePatterns is a list whose elements have the form&lt;br /&gt;    * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].&lt;br /&gt;    *&lt;br /&gt;    * Style is a style constant like PR_PLAIN, or can be a string of the&lt;br /&gt;    * form 'lang-FOO', where FOO is a language extension describing the&lt;br /&gt;    * language of the portion of the token in $1 after pattern executes.&lt;br /&gt;    * E.g., if style is 'lang-lisp', and group 1 contains the text&lt;br /&gt;    * '(hello (world))', then that portion of the token will be passed to the&lt;br /&gt;    * registered lisp handler for formatting.&lt;br /&gt;    * The text before and after group 1 will be restyled using this decorator&lt;br /&gt;    * so decorators should take care that this doesn't result in infinite&lt;br /&gt;    * recursion.  For example, the HTML lexer rule for SCRIPT elements looks&lt;br /&gt;    * something like ['lang-js', /&lt;[s]cript&gt;(.+?)&lt;\/script&gt;/].  This may match&lt;br /&gt;    * '&lt;script&gt;foo()&lt;\/script&gt;', which would cause the current decorator to&lt;br /&gt;    * be called with '&lt;script&gt;' which would not match the same rule since&lt;br /&gt;    * group 1 must not be empty, so it would be instead styled as PR_TAG by&lt;br /&gt;    * the generic tag rule.  The handler registered for the 'js' extension would&lt;br /&gt;    * then be called with 'foo()', and finally, the current decorator would&lt;br /&gt;    * be called with '&lt;\/script&gt;' which would not match the original rule and&lt;br /&gt;    * so the generic tag rule would identify it as a tag.&lt;br /&gt;    *&lt;br /&gt;    * Pattern must only match prefixes, and if it matches a prefix, then that&lt;br /&gt;    * match is considered a token with the same style.&lt;br /&gt;    *&lt;br /&gt;    * Context is applied to the last non-whitespace, non-comment token&lt;br /&gt;    * recognized.&lt;br /&gt;    *&lt;br /&gt;    * Shortcut is an optional string of characters, any of which, if the first&lt;br /&gt;    * character, gurantee that this pattern and only this pattern matches.&lt;br /&gt;    *&lt;br /&gt;    * @param {Array} shortcutStylePatterns patterns that always start with&lt;br /&gt;    *   a known character.  Must have a shortcut string.&lt;br /&gt;    * @param {Array} fallthroughStylePatterns patterns that will be tried in&lt;br /&gt;    *   order if the shortcut ones fail.  May have shortcuts.&lt;br /&gt;    *&lt;br /&gt;    * @return {function (Object)} a&lt;br /&gt;    *   function that takes source code and returns a list of decorations.&lt;br /&gt;    */&lt;br /&gt;  function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {&lt;br /&gt;    var shortcuts = {};&lt;br /&gt;    var tokenizer;&lt;br /&gt;    (function () {&lt;br /&gt;      var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);&lt;br /&gt;      var allRegexs = [];&lt;br /&gt;      var regexKeys = {};&lt;br /&gt;      for (var i = 0, n = allPatterns.length; i &lt; n; ++i) {&lt;br /&gt;        var patternParts = allPatterns[i];&lt;br /&gt;        var shortcutChars = patternParts[3];&lt;br /&gt;        if (shortcutChars) {&lt;br /&gt;          for (var c = shortcutChars.length; --c &gt;= 0;) {&lt;br /&gt;            shortcuts[shortcutChars.charAt(c)] = patternParts;&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;        var regex = patternParts[1];&lt;br /&gt;        var k = '' + regex;&lt;br /&gt;        if (!regexKeys.hasOwnProperty(k)) {&lt;br /&gt;          allRegexs.push(regex);&lt;br /&gt;          regexKeys[k] = null;&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      allRegexs.push(/[\0-\uffff]/);&lt;br /&gt;      tokenizer = combinePrefixPatterns(allRegexs);&lt;br /&gt;    })();&lt;br /&gt;&lt;br /&gt;    var nPatterns = fallthroughStylePatterns.length;&lt;br /&gt;    var notWs = /\S/;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Lexes job.source and produces an output array job.decorations of style&lt;br /&gt;     * classes preceded by the position at which they start in job.source in&lt;br /&gt;     * order.&lt;br /&gt;     *&lt;br /&gt;     * @param {Object} job an object like {@code&lt;br /&gt;     *    source: {string} sourceText plain text,&lt;br /&gt;     *    basePos: {int} position of job.source in the larger chunk of&lt;br /&gt;     *        sourceCode.&lt;br /&gt;     * }&lt;br /&gt;     */&lt;br /&gt;    var decorate = function (job) {&lt;br /&gt;      var sourceCode = job.source, basePos = job.basePos;&lt;br /&gt;      /** Even entries are positions in source in ascending order.  Odd enties&lt;br /&gt;        * are style markers (e.g., PR_COMMENT) that run from that position until&lt;br /&gt;        * the end.&lt;br /&gt;        * @type {Array.&lt;number|string&gt;}&lt;br /&gt;        */&lt;br /&gt;      var decorations = [basePos, PR_PLAIN];&lt;br /&gt;      var pos = 0;  // index into sourceCode&lt;br /&gt;      var tokens = sourceCode.match(tokenizer) || [];&lt;br /&gt;      var styleCache = {};&lt;br /&gt;&lt;br /&gt;      for (var ti = 0, nTokens = tokens.length; ti &lt; nTokens; ++ti) {&lt;br /&gt;        var token = tokens[ti];&lt;br /&gt;        var style = styleCache[token];&lt;br /&gt;        var match = void 0;&lt;br /&gt;&lt;br /&gt;        var isEmbedded;&lt;br /&gt;        if (typeof style === 'string') {&lt;br /&gt;          isEmbedded = false;&lt;br /&gt;        } else {&lt;br /&gt;          var patternParts = shortcuts[token.charAt(0)];&lt;br /&gt;          if (patternParts) {&lt;br /&gt;            match = token.match(patternParts[1]);&lt;br /&gt;            style = patternParts[0];&lt;br /&gt;          } else {&lt;br /&gt;            for (var i = 0; i &lt; nPatterns; ++i) {&lt;br /&gt;              patternParts = fallthroughStylePatterns[i];&lt;br /&gt;              match = token.match(patternParts[1]);&lt;br /&gt;              if (match) {&lt;br /&gt;                style = patternParts[0];&lt;br /&gt;                break;&lt;br /&gt;              }&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            if (!match) {  // make sure that we make progress&lt;br /&gt;              style = PR_PLAIN;&lt;br /&gt;            }&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          isEmbedded = style.length &gt;= 5 &amp;&amp; 'lang-' === style.substring(0, 5);&lt;br /&gt;          if (isEmbedded &amp;&amp; !(match &amp;&amp; typeof match[1] === 'string')) {&lt;br /&gt;            isEmbedded = false;&lt;br /&gt;            style = PR_SOURCE;&lt;br /&gt;          }&lt;br /&gt;&lt;br /&gt;          if (!isEmbedded) { styleCache[token] = style; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        var tokenStart = pos;&lt;br /&gt;        pos += token.length;&lt;br /&gt;&lt;br /&gt;        if (!isEmbedded) {&lt;br /&gt;          decorations.push(basePos + tokenStart, style);&lt;br /&gt;        } else {  // Treat group 1 as an embedded block of source code.&lt;br /&gt;          var embeddedSource = match[1];&lt;br /&gt;          var embeddedSourceStart = token.indexOf(embeddedSource);&lt;br /&gt;          var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;&lt;br /&gt;          if (match[2]) {&lt;br /&gt;            // If embeddedSource can be blank, then it would match at the&lt;br /&gt;            // beginning which would cause us to infinitely recurse on the&lt;br /&gt;            // entire token, so we catch the right context in match[2].&lt;br /&gt;            embeddedSourceEnd = token.length - match[2].length;&lt;br /&gt;            embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;&lt;br /&gt;          }&lt;br /&gt;          var lang = style.substring(5);&lt;br /&gt;          // Decorate the left of the embedded source&lt;br /&gt;          appendDecorations(&lt;br /&gt;              basePos + tokenStart,&lt;br /&gt;              token.substring(0, embeddedSourceStart),&lt;br /&gt;              decorate, decorations);&lt;br /&gt;          // Decorate the embedded source&lt;br /&gt;          appendDecorations(&lt;br /&gt;              basePos + tokenStart + embeddedSourceStart,&lt;br /&gt;              embeddedSource,&lt;br /&gt;              langHandlerForExtension(lang, embeddedSource),&lt;br /&gt;              decorations);&lt;br /&gt;          // Decorate the right of the embedded section&lt;br /&gt;          appendDecorations(&lt;br /&gt;              basePos + tokenStart + embeddedSourceEnd,&lt;br /&gt;              token.substring(embeddedSourceEnd),&lt;br /&gt;              decorate, decorations);&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      job.decorations = decorations;&lt;br /&gt;    };&lt;br /&gt;    return decorate;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** returns a function that produces a list of decorations from source text.&lt;br /&gt;    *&lt;br /&gt;    * This code treats ", ', and ` as string delimiters, and \ as a string&lt;br /&gt;    * escape.  It does not recognize perl's qq() style strings.&lt;br /&gt;    * It has no special handling for double delimiter escapes as in basic, or&lt;br /&gt;    * the tripled delimiters used in python, but should work on those regardless&lt;br /&gt;    * although in those cases a single string literal may be broken up into&lt;br /&gt;    * multiple adjacent string literals.&lt;br /&gt;    *&lt;br /&gt;    * It recognizes C, C++, and shell style comments.&lt;br /&gt;    *&lt;br /&gt;    * @param {Object} options a set of optional parameters.&lt;br /&gt;    * @return {function (Object)} a function that examines the source code&lt;br /&gt;    *     in the input job and builds the decoration list.&lt;br /&gt;    */&lt;br /&gt;  function sourceDecorator(options) {&lt;br /&gt;    var shortcutStylePatterns = [], fallthroughStylePatterns = [];&lt;br /&gt;    if (options['tripleQuotedStrings']) {&lt;br /&gt;      // '''multi-line-string''', 'single-line-string', and double-quoted&lt;br /&gt;      shortcutStylePatterns.push(&lt;br /&gt;          [PR_STRING,  /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,&lt;br /&gt;           null, '\'"']);&lt;br /&gt;    } else if (options['multiLineStrings']) {&lt;br /&gt;      // 'multi-line-string', "multi-line-string"&lt;br /&gt;      shortcutStylePatterns.push(&lt;br /&gt;          [PR_STRING,  /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,&lt;br /&gt;           null, '\'"`']);&lt;br /&gt;    } else {&lt;br /&gt;      // 'single-line-string', "single-line-string"&lt;br /&gt;      shortcutStylePatterns.push(&lt;br /&gt;          [PR_STRING,&lt;br /&gt;           /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,&lt;br /&gt;           null, '"\'']);&lt;br /&gt;    }&lt;br /&gt;    if (options['verbatimStrings']) {&lt;br /&gt;      // verbatim-string-literal production from the C# grammar.  See issue 93.&lt;br /&gt;      fallthroughStylePatterns.push(&lt;br /&gt;          [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);&lt;br /&gt;    }&lt;br /&gt;    if (options['hashComments']) {&lt;br /&gt;      if (options['cStyleComments']) {&lt;br /&gt;        // Stop C preprocessor declarations at an unclosed open comment&lt;br /&gt;        shortcutStylePatterns.push(&lt;br /&gt;            [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,&lt;br /&gt;             null, '#']);&lt;br /&gt;        fallthroughStylePatterns.push(&lt;br /&gt;            [PR_STRING,&lt;br /&gt;             /^&lt;(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)&gt;/,&lt;br /&gt;             null]);&lt;br /&gt;      } else {&lt;br /&gt;        shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    if (options['cStyleComments']) {&lt;br /&gt;      fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);&lt;br /&gt;      fallthroughStylePatterns.push(&lt;br /&gt;          [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);&lt;br /&gt;    }&lt;br /&gt;    if (options['regexLiterals']) {&lt;br /&gt;      var REGEX_LITERAL = (&lt;br /&gt;          // A regular expression literal starts with a slash that is&lt;br /&gt;          // not followed by * or / so that it is not confused with&lt;br /&gt;          // comments.&lt;br /&gt;          '/(?=[^/*])'&lt;br /&gt;          // and then contains any number of raw characters,&lt;br /&gt;          + '(?:[^/\\x5B\\x5C]'&lt;br /&gt;          // escape sequences (\x5C),&lt;br /&gt;          +    '|\\x5C[\\s\\S]'&lt;br /&gt;          // or non-nesting character sets (\x5B\x5D);&lt;br /&gt;          +    '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'&lt;br /&gt;          // finally closed by a /.&lt;br /&gt;          + '/');&lt;br /&gt;      fallthroughStylePatterns.push(&lt;br /&gt;          ['lang-regex',&lt;br /&gt;           new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')&lt;br /&gt;           ]);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    var keywords = options['keywords'].replace(/^\s+|\s+$/g, '');&lt;br /&gt;    if (keywords.length) {&lt;br /&gt;      fallthroughStylePatterns.push(&lt;br /&gt;          [PR_KEYWORD,&lt;br /&gt;           new RegExp('^(?:' + keywords.replace(/\s+/g, '|') + ')\\b'), null]);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    shortcutStylePatterns.push([PR_PLAIN,       /^\s+/, null, ' \r\n\t\xA0']);&lt;br /&gt;    fallthroughStylePatterns.push(&lt;br /&gt;        // TODO(mikesamuel): recognize non-latin letters and numerals in idents&lt;br /&gt;        [PR_LITERAL,     /^@[a-z_$][a-z_$@0-9]*/i, null],&lt;br /&gt;        [PR_TYPE,        /^@?[A-Z]+[a-z][A-Za-z_$@0-9]*/, null],&lt;br /&gt;        [PR_PLAIN,       /^[a-z_$][a-z_$@0-9]*/i, null],&lt;br /&gt;        [PR_LITERAL,&lt;br /&gt;         new RegExp(&lt;br /&gt;             '^(?:'&lt;br /&gt;             // A hex number&lt;br /&gt;             + '0x[a-f0-9]+'&lt;br /&gt;             // or an octal or decimal number,&lt;br /&gt;             + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'&lt;br /&gt;             // possibly in scientific notation&lt;br /&gt;             + '(?:e[+\\-]?\\d+)?'&lt;br /&gt;             + ')'&lt;br /&gt;             // with an optional modifier like UL for unsigned long&lt;br /&gt;             + '[a-z]*', 'i'),&lt;br /&gt;         null, '0123456789'],&lt;br /&gt;        [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#]*/, null]);&lt;br /&gt;&lt;br /&gt;    return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  var decorateSource = sourceDecorator({&lt;br /&gt;        'keywords': ALL_KEYWORDS,&lt;br /&gt;        'hashComments': true,&lt;br /&gt;        'cStyleComments': true,&lt;br /&gt;        'multiLineStrings': true,&lt;br /&gt;        'regexLiterals': true&lt;br /&gt;      });&lt;br /&gt;&lt;br /&gt;  /** Breaks {@code job.source} around style boundaries in&lt;br /&gt;    * {@code job.decorations} while re-interleaving {@code job.extractedTags},&lt;br /&gt;    * and leaves the result in {@code job.prettyPrintedHtml}.&lt;br /&gt;    * @param {Object} job like {&lt;br /&gt;    *    source: {string} source as plain text,&lt;br /&gt;    *    extractedTags: {Array.&lt;number|string&gt;} extractedTags chunks of raw&lt;br /&gt;    *                   html preceded by their position in {@code job.source}&lt;br /&gt;    *                   in order&lt;br /&gt;    *    decorations: {Array.&lt;number|string} an array of style classes preceded&lt;br /&gt;    *                 by the position at which they start in job.source in order&lt;br /&gt;    * }&lt;br /&gt;    * @private&lt;br /&gt;    */&lt;br /&gt;  function recombineTagsAndDecorations(job) {&lt;br /&gt;    var sourceText = job.source;&lt;br /&gt;    var extractedTags = job.extractedTags;&lt;br /&gt;    var decorations = job.decorations;&lt;br /&gt;&lt;br /&gt;    var html = [];&lt;br /&gt;    // index past the last char in sourceText written to html&lt;br /&gt;    var outputIdx = 0;&lt;br /&gt;&lt;br /&gt;    var openDecoration = null;&lt;br /&gt;    var currentDecoration = null;&lt;br /&gt;    var tagPos = 0;  // index into extractedTags&lt;br /&gt;    var decPos = 0;  // index into decorations&lt;br /&gt;    var tabExpander = makeTabExpander(window['PR_TAB_WIDTH']);&lt;br /&gt;&lt;br /&gt;    var adjacentSpaceRe = /([\r\n ]) /g;&lt;br /&gt;    var startOrSpaceRe = /(^| ) /gm;&lt;br /&gt;    var newlineRe = /\r\n?|\n/g;&lt;br /&gt;    var trailingSpaceRe = /[ \r\n]$/;&lt;br /&gt;    var lastWasSpace = true;  // the last text chunk emitted ended with a space.&lt;br /&gt;&lt;br /&gt;    // See bug 71 and http://stackoverflow.com/questions/136443/why-doesnt-ie7-&lt;br /&gt;    var isIE678 = window['_pr_isIE6']();&lt;br /&gt;    var lineBreakHtml = (&lt;br /&gt;        isIE678&lt;br /&gt;        ? (job.sourceNode.tagName === 'PRE'&lt;br /&gt;           // Use line feeds instead of &lt;br /&gt;s so that copying and pasting works&lt;br /&gt;           // on IE.&lt;br /&gt;           // Doing this on other browsers breaks lots of stuff since \r\n is&lt;br /&gt;           // treated as two newlines on Firefox.&lt;br /&gt;           ? (isIE678 === 6 ? '&amp;#160;\r\n' :&lt;br /&gt;              isIE678 === 7 ? '&amp;#160;&lt;br /&gt;\r' : '&amp;#160;\r')&lt;br /&gt;           // IE collapses multiple adjacent &lt;br /&gt;s into 1 line break.&lt;br /&gt;           // Prefix every newline with '&amp;#160;' to prevent such behavior.&lt;br /&gt;           // &amp;nbsp; is the same as &amp;#160; but works in XML as well as HTML.&lt;br /&gt;           : '&amp;#160;&lt;br /&gt;')&lt;br /&gt;        : '&lt;br /&gt;');&lt;br /&gt;&lt;br /&gt;    // Look for a class like linenums or linenums:&lt;n&gt; where &lt;n&gt; is the 1-indexed&lt;br /&gt;    // number of the first line.&lt;br /&gt;    var numberLines = job.sourceNode.className.match(/\blinenums\b(?::(\d+))?/);&lt;br /&gt;    var lineBreaker;&lt;br /&gt;    if (numberLines) {&lt;br /&gt;      var lineBreaks = [];&lt;br /&gt;      for (var i = 0; i &lt; 10; ++i) {&lt;br /&gt;        lineBreaks[i] = lineBreakHtml + '&lt;/li&gt;&lt;br /&gt;&lt;li class="L' + i + '"&gt;';&lt;br /&gt;      }&lt;br /&gt;      var lineNum = numberLines[1] &amp;&amp; numberLines[1].length &lt;br /&gt;          ? numberLines[1] - 1 : 0;  // Lines are 1-indexed&lt;br /&gt;      html.push('&lt;ol class="linenums"&gt;&lt;br /&gt;&lt;li class="L', (lineNum) % 10, '"');&lt;br /&gt;      if (lineNum) {&lt;br /&gt;        html.push(' value="', lineNum + 1, '"');&lt;br /&gt;      }&lt;br /&gt;      html.push('&gt;');&lt;br /&gt;      lineBreaker = function () {&lt;br /&gt;        var lb = lineBreaks[++lineNum % 10];&lt;br /&gt;        // If a decoration is open, we need to close it before closing a list-item&lt;br /&gt;        // and reopen it on the other side of the list item.&lt;br /&gt;        return openDecoration&lt;br /&gt;            ? ('&lt;/span&gt;' + lb + '&lt;span class="' + openDecoration + '"&gt;') : lb;&lt;br /&gt;      };&lt;br /&gt;    } else {&lt;br /&gt;      lineBreaker = lineBreakHtml;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // A helper function that is responsible for opening sections of decoration&lt;br /&gt;    // and outputing properly escaped chunks of source&lt;br /&gt;    function emitTextUpTo(sourceIdx) {&lt;br /&gt;      if (sourceIdx &gt; outputIdx) {&lt;br /&gt;        if (openDecoration &amp;&amp; openDecoration !== currentDecoration) {&lt;br /&gt;          // Close the current decoration&lt;br /&gt;          html.push('&lt;/span&gt;');&lt;br /&gt;          openDecoration = null;&lt;br /&gt;        }&lt;br /&gt;        if (!openDecoration &amp;&amp; currentDecoration) {&lt;br /&gt;          openDecoration = currentDecoration;&lt;br /&gt;          html.push('&lt;span class="', openDecoration, '"&gt;');&lt;br /&gt;        }&lt;br /&gt;        // This interacts badly with some wikis which introduces paragraph tags&lt;br /&gt;        // into pre blocks for some strange reason.&lt;br /&gt;        // It's necessary for IE though which seems to lose the preformattedness&lt;br /&gt;        // of &lt;pre&gt; tags when their innerHTML is assigned.&lt;br /&gt;        // http://stud3.tuwien.ac.at/~e0226430/innerHtmlQuirk.html&lt;br /&gt;        // and it serves to undo the conversion of &lt;br /&gt;s to newlines done in&lt;br /&gt;        // chunkify.&lt;br /&gt;        var htmlChunk = textToHtml(&lt;br /&gt;            tabExpander(sourceText.substring(outputIdx, sourceIdx)))&lt;br /&gt;            .replace(lastWasSpace&lt;br /&gt;                     ? startOrSpaceRe&lt;br /&gt;                     : adjacentSpaceRe, '$1&amp;#160;');&lt;br /&gt;        // Keep track of whether we need to escape space at the beginning of the&lt;br /&gt;        // next chunk.&lt;br /&gt;        lastWasSpace = trailingSpaceRe.test(htmlChunk);&lt;br /&gt;        html.push(htmlChunk.replace(newlineRe, lineBreaker));&lt;br /&gt;        outputIdx = sourceIdx;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    while (true) {&lt;br /&gt;      // Determine if we're going to consume a tag this time around.  Otherwise&lt;br /&gt;      // we consume a decoration or exit.&lt;br /&gt;      var outputTag;&lt;br /&gt;      if (tagPos &lt; extractedTags.length) {&lt;br /&gt;        if (decPos &lt; decorations.length) {&lt;br /&gt;          // Pick one giving preference to extractedTags since we shouldn't open&lt;br /&gt;          // a new style that we're going to have to immediately close in order&lt;br /&gt;          // to output a tag.&lt;br /&gt;          outputTag = extractedTags[tagPos] &lt;= decorations[decPos];&lt;br /&gt;        } else {&lt;br /&gt;          outputTag = true;&lt;br /&gt;        }&lt;br /&gt;      } else {&lt;br /&gt;        outputTag = false;&lt;br /&gt;      }&lt;br /&gt;      // Consume either a decoration or a tag or exit.&lt;br /&gt;      if (outputTag) {&lt;br /&gt;        emitTextUpTo(extractedTags[tagPos]);&lt;br /&gt;        if (openDecoration) {&lt;br /&gt;          // Close the current decoration&lt;br /&gt;          html.push('&lt;/span&gt;');&lt;br /&gt;          openDecoration = null;&lt;br /&gt;        }&lt;br /&gt;        html.push(extractedTags[tagPos + 1]);&lt;br /&gt;        tagPos += 2;&lt;br /&gt;      } else if (decPos &lt; decorations.length) {&lt;br /&gt;        emitTextUpTo(decorations[decPos]);&lt;br /&gt;        currentDecoration = decorations[decPos + 1];&lt;br /&gt;        decPos += 2;&lt;br /&gt;      } else {&lt;br /&gt;        break;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    emitTextUpTo(sourceText.length);&lt;br /&gt;    if (openDecoration) {&lt;br /&gt;      html.push('&lt;/span&gt;');&lt;br /&gt;    }&lt;br /&gt;    if (numberLines) { html.push('&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;'); }&lt;br /&gt;    job.prettyPrintedHtml = html.join('');&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /** Maps language-specific file extensions to handlers. */&lt;br /&gt;  var langHandlerRegistry = {};&lt;br /&gt;  /** Register a language handler for the given file extensions.&lt;br /&gt;    * @param {function (Object)} handler a function from source code to a list&lt;br /&gt;    *      of decorations.  Takes a single argument job which describes the&lt;br /&gt;    *      state of the computation.   The single parameter has the form&lt;br /&gt;    *      {@code {&lt;br /&gt;    *        source: {string} as plain text.&lt;br /&gt;    *        decorations: {Array.&lt;number|string&gt;} an array of style classes&lt;br /&gt;    *                     preceded by the position at which they start in&lt;br /&gt;    *                     job.source in order.&lt;br /&gt;    *                     The language handler should assigned this field.&lt;br /&gt;    *        basePos: {int} the position of source in the larger source chunk.&lt;br /&gt;    *                 All positions in the output decorations array are relative&lt;br /&gt;    *                 to the larger source chunk.&lt;br /&gt;    *      } }&lt;br /&gt;    * @param {Array.&lt;string&gt;} fileExtensions&lt;br /&gt;    */&lt;br /&gt;  function registerLangHandler(handler, fileExtensions) {&lt;br /&gt;    for (var i = fileExtensions.length; --i &gt;= 0;) {&lt;br /&gt;      var ext = fileExtensions[i];&lt;br /&gt;      if (!langHandlerRegistry.hasOwnProperty(ext)) {&lt;br /&gt;        langHandlerRegistry[ext] = handler;&lt;br /&gt;      } else if ('console' in window) {&lt;br /&gt;        console['warn']('cannot override language handler %s', ext);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  function langHandlerForExtension(extension, source) {&lt;br /&gt;    if (!(extension &amp;&amp; langHandlerRegistry.hasOwnProperty(extension))) {&lt;br /&gt;      // Treat it as markup if the first non whitespace character is a &lt; and&lt;br /&gt;      // the last non-whitespace character is a &gt;.&lt;br /&gt;      extension = /^\s*&lt;/.test(source)&lt;br /&gt;          ? 'default-markup'&lt;br /&gt;          : 'default-code';&lt;br /&gt;    }&lt;br /&gt;    return langHandlerRegistry[extension];&lt;br /&gt;  }&lt;br /&gt;  registerLangHandler(decorateSource, ['default-code']);&lt;br /&gt;  registerLangHandler(&lt;br /&gt;      createSimpleLexer(&lt;br /&gt;          [],&lt;br /&gt;          [&lt;br /&gt;           [PR_PLAIN,       /^[^&lt;?]+/],&lt;br /&gt;           [PR_DECLARATION, /^&lt;!\w[^&gt;]*(?:&gt;|$)/],&lt;br /&gt;           [PR_COMMENT,     /^&lt;\!--[\s\S]*?(?:-\-&gt;|$)/],&lt;br /&gt;           // Unescaped content in an unknown language&lt;br /&gt;           ['lang-',        /^&lt;\?([\s\S]+?)(?:\?&gt;|$)/],&lt;br /&gt;           ['lang-',        /^&lt;%([\s\S]+?)(?:%&gt;|$)/],&lt;br /&gt;           [PR_PUNCTUATION, /^(?:&lt;[%?]|[%?]&gt;)/],&lt;br /&gt;           ['lang-',        /^&lt;xmp\b[^&gt;]*&gt;([\s\S]+?)&lt;\/xmp\b[^&gt;]*&gt;/i],&lt;br /&gt;           // Unescaped content in javascript.  (Or possibly vbscript).&lt;br /&gt;           ['lang-js',      /^&lt;script\b[^&gt;]*&gt;([\s\S]*?)(&lt;\/script\b[^&gt;]*&gt;)/i],&lt;br /&gt;           // Contains unescaped stylesheet content&lt;br /&gt;           ['lang-css',     /^&lt;style\b[^&gt;]*&gt;([\s\S]*?)(&lt;\/style\b[^&gt;]*&gt;)/i],&lt;br /&gt;           ['lang-in.tag',  /^(&lt;\/?[a-z][^&lt;&gt;]*&gt;)/i]&lt;br /&gt;          ]),&lt;br /&gt;      ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);&lt;br /&gt;  registerLangHandler(&lt;br /&gt;      createSimpleLexer(&lt;br /&gt;          [&lt;br /&gt;           [PR_PLAIN,        /^[\s]+/, null, ' \t\r\n'],&lt;br /&gt;           [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']&lt;br /&gt;           ],&lt;br /&gt;          [&lt;br /&gt;           [PR_TAG,          /^^&lt;\/?[a-z](?:[\w.:-]*\w)?|\/?&gt;$/i],&lt;br /&gt;           [PR_ATTRIB_NAME,  /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],&lt;br /&gt;           ['lang-uq.val',   /^=\s*([^&gt;\'\"\s]*(?:[^&gt;\'\"\s\/]|\/(?=\s)))/],&lt;br /&gt;           [PR_PUNCTUATION,  /^[=&lt;&gt;\/]+/],&lt;br /&gt;           ['lang-js',       /^on\w+\s*=\s*\"([^\"]+)\"/i],&lt;br /&gt;           ['lang-js',       /^on\w+\s*=\s*\'([^\']+)\'/i],&lt;br /&gt;           ['lang-js',       /^on\w+\s*=\s*([^\"\'&gt;\s]+)/i],&lt;br /&gt;           ['lang-css',      /^style\s*=\s*\"([^\"]+)\"/i],&lt;br /&gt;           ['lang-css',      /^style\s*=\s*\'([^\']+)\'/i],&lt;br /&gt;           ['lang-css',      /^style\s*=\s*([^\"\'&gt;\s]+)/i]&lt;br /&gt;           ]),&lt;br /&gt;      ['in.tag']);&lt;br /&gt;  registerLangHandler(&lt;br /&gt;      createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': CPP_KEYWORDS,&lt;br /&gt;          'hashComments': true,&lt;br /&gt;          'cStyleComments': true&lt;br /&gt;        }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': 'null true false'&lt;br /&gt;        }), ['json']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': CSHARP_KEYWORDS,&lt;br /&gt;          'hashComments': true,&lt;br /&gt;          'cStyleComments': true,&lt;br /&gt;          'verbatimStrings': true&lt;br /&gt;        }), ['cs']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': JAVA_KEYWORDS,&lt;br /&gt;          'cStyleComments': true&lt;br /&gt;        }), ['java']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': SH_KEYWORDS,&lt;br /&gt;          'hashComments': true,&lt;br /&gt;          'multiLineStrings': true&lt;br /&gt;        }), ['bsh', 'csh', 'sh']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': PYTHON_KEYWORDS,&lt;br /&gt;          'hashComments': true,&lt;br /&gt;          'multiLineStrings': true,&lt;br /&gt;          'tripleQuotedStrings': true&lt;br /&gt;        }), ['cv', 'py']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': PERL_KEYWORDS,&lt;br /&gt;          'hashComments': true,&lt;br /&gt;          'multiLineStrings': true,&lt;br /&gt;          'regexLiterals': true&lt;br /&gt;        }), ['perl', 'pl', 'pm']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': RUBY_KEYWORDS,&lt;br /&gt;          'hashComments': true,&lt;br /&gt;          'multiLineStrings': true,&lt;br /&gt;          'regexLiterals': true&lt;br /&gt;        }), ['rb']);&lt;br /&gt;  registerLangHandler(sourceDecorator({&lt;br /&gt;          'keywords': JSCRIPT_KEYWORDS,&lt;br /&gt;          'cStyleComments': true,&lt;br /&gt;          'regexLiterals': true&lt;br /&gt;        }), ['js']);&lt;br /&gt;  registerLangHandler(&lt;br /&gt;      createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);&lt;br /&gt;&lt;br /&gt;  function applyDecorator(job) {&lt;br /&gt;    var sourceCodeHtml = job.sourceCodeHtml;&lt;br /&gt;    var opt_langExtension = job.langExtension;&lt;br /&gt;&lt;br /&gt;    // Prepopulate output in case processing fails with an exception.&lt;br /&gt;    job.prettyPrintedHtml = sourceCodeHtml;&lt;br /&gt;&lt;br /&gt;    try {&lt;br /&gt;      // Extract tags, and convert the source code to plain text.&lt;br /&gt;      var sourceAndExtractedTags = extractTags(sourceCodeHtml);&lt;br /&gt;      /** Plain text. @type {string} */&lt;br /&gt;      var source = sourceAndExtractedTags.source;&lt;br /&gt;      job.source = source;&lt;br /&gt;      job.basePos = 0;&lt;br /&gt;&lt;br /&gt;      /** Even entries are positions in source in ascending order.  Odd entries&lt;br /&gt;        * are tags that were extracted at that position.&lt;br /&gt;        * @type {Array.&lt;number|string&gt;}&lt;br /&gt;        */&lt;br /&gt;      job.extractedTags = sourceAndExtractedTags.tags;&lt;br /&gt;&lt;br /&gt;      // Apply the appropriate language handler&lt;br /&gt;      langHandlerForExtension(opt_langExtension, source)(job);&lt;br /&gt;      // Integrate the decorations and tags back into the source code to produce&lt;br /&gt;      // a decorated html string which is left in job.prettyPrintedHtml.&lt;br /&gt;      recombineTagsAndDecorations(job);&lt;br /&gt;    } catch (e) {&lt;br /&gt;      if ('console' in window) {&lt;br /&gt;        console['log'](e &amp;&amp; e['stack'] ? e['stack'] : e);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function prettyPrintOne(sourceCodeHtml, opt_langExtension) {&lt;br /&gt;    var job = {&lt;br /&gt;      sourceCodeHtml: sourceCodeHtml,&lt;br /&gt;      langExtension: opt_langExtension&lt;br /&gt;    };&lt;br /&gt;    applyDecorator(job);&lt;br /&gt;    return job.prettyPrintedHtml;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function prettyPrint(opt_whenDone) {&lt;br /&gt;    function byTagName(tn) { return document.getElementsByTagName(tn); }&lt;br /&gt;    // fetch a list of nodes to rewrite&lt;br /&gt;    var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];&lt;br /&gt;    var elements = [];&lt;br /&gt;    for (var i = 0; i &lt; codeSegments.length; ++i) {&lt;br /&gt;      for (var j = 0, n = codeSegments[i].length; j &lt; n; ++j) {&lt;br /&gt;        elements.push(codeSegments[i][j]);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;    codeSegments = null;&lt;br /&gt;&lt;br /&gt;    var clock = Date;&lt;br /&gt;    if (!clock['now']) {&lt;br /&gt;      clock = { 'now': function () { return (new Date).getTime(); } };&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // The loop is broken into a series of continuations to make sure that we&lt;br /&gt;    // don't make the browser unresponsive when rewriting a large page.&lt;br /&gt;    var k = 0;&lt;br /&gt;    var prettyPrintingJob;&lt;br /&gt;&lt;br /&gt;    function doWork() {&lt;br /&gt;      var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?&lt;br /&gt;                     clock.now() + 250 /* ms */ :&lt;br /&gt;                     Infinity);&lt;br /&gt;      for (; k &lt; elements.length &amp;&amp; clock.now() &lt; endTime; k++) {&lt;br /&gt;        var cs = elements[k];&lt;br /&gt;        if (cs.className &amp;&amp; cs.className.indexOf('prettyprint') &gt;= 0) {&lt;br /&gt;          // If the classes includes a language extensions, use it.&lt;br /&gt;          // Language extensions can be specified like&lt;br /&gt;          //     &lt;pre class="prettyprint lang-cpp"&gt;&lt;br /&gt;          // the language extension "cpp" is used to find a language handler as&lt;br /&gt;          // passed to PR_registerLangHandler.&lt;br /&gt;          var langExtension = cs.className.match(/\blang-(\w+)\b/);&lt;br /&gt;          if (langExtension) { langExtension = langExtension[1]; }&lt;br /&gt;&lt;br /&gt;          // make sure this is not nested in an already prettified element&lt;br /&gt;          var nested = false;&lt;br /&gt;          for (var p = cs.parentNode; p; p = p.parentNode) {&lt;br /&gt;            if ((p.tagName === 'pre' || p.tagName === 'code' ||&lt;br /&gt;                 p.tagName === 'xmp') &amp;&amp;&lt;br /&gt;                p.className &amp;&amp; p.className.indexOf('prettyprint') &gt;= 0) {&lt;br /&gt;              nested = true;&lt;br /&gt;              break;&lt;br /&gt;            }&lt;br /&gt;          }&lt;br /&gt;          if (!nested) {&lt;br /&gt;            // fetch the content as a snippet of properly escaped HTML.&lt;br /&gt;            // Firefox adds newlines at the end.&lt;br /&gt;            var content = getInnerHtml(cs);&lt;br /&gt;            content = content.replace(/(?:\r\n?|\n)$/, '');&lt;br /&gt;&lt;br /&gt;            // do the pretty printing&lt;br /&gt;            prettyPrintingJob = {&lt;br /&gt;              sourceCodeHtml: content,&lt;br /&gt;              langExtension: langExtension,&lt;br /&gt;              sourceNode: cs&lt;br /&gt;            };&lt;br /&gt;            applyDecorator(prettyPrintingJob);&lt;br /&gt;            replaceWithPrettyPrintedHtml();&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;      }&lt;br /&gt;      if (k &lt; elements.length) {&lt;br /&gt;        // finish up in a continuation&lt;br /&gt;        setTimeout(doWork, 250);&lt;br /&gt;      } else if (opt_whenDone) {&lt;br /&gt;        opt_whenDone();&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    function replaceWithPrettyPrintedHtml() {&lt;br /&gt;      var newContent = prettyPrintingJob.prettyPrintedHtml;&lt;br /&gt;      if (!newContent) { return; }&lt;br /&gt;      var cs = prettyPrintingJob.sourceNode;&lt;br /&gt;&lt;br /&gt;      // push the prettified html back into the tag.&lt;br /&gt;      if (!isRawContent(cs)) {&lt;br /&gt;        // just replace the old html with the new&lt;br /&gt;        cs.innerHTML = newContent;&lt;br /&gt;      } else {&lt;br /&gt;        // we need to change the tag to a &lt;pre&gt; since &lt;xmp&gt;s do not allow&lt;br /&gt;        // embedded tags such as the span tags used to attach styles to&lt;br /&gt;        // sections of source code.&lt;br /&gt;        var pre = document.createElement('PRE');&lt;br /&gt;        for (var i = 0; i &lt; cs.attributes.length; ++i) {&lt;br /&gt;          var a = cs.attributes[i];&lt;br /&gt;          if (a.specified) {&lt;br /&gt;            var aname = a.name.toLowerCase();&lt;br /&gt;            if (aname === 'class') {&lt;br /&gt;              pre.className = a.value;  // For IE 6&lt;br /&gt;            } else {&lt;br /&gt;              pre.setAttribute(a.name, a.value);&lt;br /&gt;            }&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;        pre.innerHTML = newContent;&lt;br /&gt;&lt;br /&gt;        // remove the old&lt;br /&gt;        cs.parentNode.replaceChild(pre, cs);&lt;br /&gt;        cs = pre;&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    doWork();&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  window['PR_normalizedHtml'] = normalizedHtml;&lt;br /&gt;  window['prettyPrintOne'] = prettyPrintOne;&lt;br /&gt;  window['prettyPrint'] = prettyPrint;&lt;br /&gt;  window['PR'] = {&lt;br /&gt;        'combinePrefixPatterns': combinePrefixPatterns,&lt;br /&gt;        'createSimpleLexer': createSimpleLexer,&lt;br /&gt;        'registerLangHandler': registerLangHandler,&lt;br /&gt;        'sourceDecorator': sourceDecorator,&lt;br /&gt;        'PR_ATTRIB_NAME': PR_ATTRIB_NAME,&lt;br /&gt;        'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,&lt;br /&gt;        'PR_COMMENT': PR_COMMENT,&lt;br /&gt;        'PR_DECLARATION': PR_DECLARATION,&lt;br /&gt;        'PR_KEYWORD': PR_KEYWORD,&lt;br /&gt;        'PR_LITERAL': PR_LITERAL,&lt;br /&gt;        'PR_NOCODE': PR_NOCODE,&lt;br /&gt;        'PR_PLAIN': PR_PLAIN,&lt;br /&gt;        'PR_PUNCTUATION': PR_PUNCTUATION,&lt;br /&gt;        'PR_SOURCE': PR_SOURCE,&lt;br /&gt;        'PR_STRING': PR_STRING,&lt;br /&gt;        'PR_TAG': PR_TAG,&lt;br /&gt;        'PR_TYPE': PR_TYPE&lt;br /&gt;      };&lt;br /&gt;})();&lt;br /&gt;&lt;/script&gt;&lt;style type="text/css"&gt;&lt;br /&gt; /* Pretty printing styles. Used with prettify.js. */&lt;br /&gt;&lt;br /&gt;.str { color: #080; }&lt;br /&gt;.kwd { color: #008; }&lt;br /&gt;.com { color: #800; }&lt;br /&gt;.typ { color: #606; }&lt;br /&gt;.lit { color: #066; }&lt;br /&gt;.pun { color: #660; }&lt;br /&gt;.pln { color: #000; }&lt;br /&gt;.tag { color: #008; }&lt;br /&gt;.atn { color: #606; }&lt;br /&gt;.atv { color: #080; }&lt;br /&gt;.dec { color: #606; }&lt;br /&gt;pre.prettyprint { padding: 2px; border: 1px solid #888 }&lt;br /&gt;&lt;br /&gt;/* Specify class=linenums on a pre to get line numbering */&lt;br /&gt;ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */&lt;br /&gt;li.L0,&lt;br /&gt;li.L1,&lt;br /&gt;li.L2,&lt;br /&gt;li.L3,&lt;br /&gt;li.L5,&lt;br /&gt;li.L6,&lt;br /&gt;li.L7,&lt;br /&gt;li.L8 { list-style-type: none }&lt;br /&gt;/* Alternate shading for lines */&lt;br /&gt;li.L1,&lt;br /&gt;li.L3,&lt;br /&gt;li.L5,&lt;br /&gt;li.L7,&lt;br /&gt;li.L9 { background: #eee }&lt;br /&gt;&lt;br /&gt;@media print {&lt;br /&gt;  .str { color: #060; }&lt;br /&gt;  .kwd { color: #006; font-weight: bold; }&lt;br /&gt;  .com { color: #600; font-style: italic; }&lt;br /&gt;  .typ { color: #404; font-weight: bold; }&lt;br /&gt;  .lit { color: #044; }&lt;br /&gt;  .pun { color: #440; }&lt;br /&gt;  .pln { color: #000; }&lt;br /&gt;  .tag { color: #006; font-weight: bold; }&lt;br /&gt;  .atn { color: #404; }&lt;br /&gt;  .atv { color: #060; }&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;span style="font-family: inherit;"&gt;Fidgeting around an assignment, my job was to retrieve contacts from GMail,using the Google Contacts API. First time i was using any Google APIs other playing around bit with GWT and Google App Engine earlier. Those who are also newbie to Google APIs please note that Google provides extensive range of APIs starting from Contacts to Calendar from Docs to Maps.Visit &lt;/span&gt;&lt;a href="http://code.google.com/"&gt;&lt;span style="font-family: inherit;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: inherit;"&gt; to witness the Google Diaspora of APIs and their adventure of code.&lt;/span&gt;&lt;/br&gt;&lt;/br&gt; &lt;span style="font-family: inherit;"&gt;I was working most on the Google contacts API, those who only want to just read or retrieve the contacts can use the Google Portable contacts API.I checked most of the code from &lt;/span&gt;&lt;a href="http://code.google.com/apis/contacts/docs/2.0/developers_guide_java.html"&gt;&lt;span style="font-family: inherit;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: inherit;"&gt;.This link describes how through Java one can call the Contacts API and perform several operations on it. Google has AUTH apis through which one must authorize to access the details through APIs.&lt;/span&gt;&lt;/br&gt;&lt;/br&gt; &lt;span style="font-family: inherit;"&gt;There are two flavours of AUTH apis if i may say, one for the Web app related thing which caters to multi user environment and other one for the stand alone app where only one use can log in through.I was using the second one and for this&amp;nbsp; i needed to use &lt;/span&gt;&lt;a href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html"&gt;&lt;span style="font-family: inherit;"&gt;ClientLogin&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: inherit;"&gt; APIs. I logged in and then retrieved the contacts using ContactsService.$getFeed() API which returns the response or the ContactsFeed object.Remember all the contacts api calls are rest calls and then i displayed the information in an SWT table.Full code can be found below. &lt;/span&gt; &lt;/br&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;package org.google.contacts;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.net.URL;&lt;br /&gt;import org.eclipse.swt.SWT;&lt;br /&gt;import org.eclipse.swt.layout.GridData;&lt;br /&gt;import org.eclipse.swt.layout.GridLayout;&lt;br /&gt;import org.eclipse.swt.widgets.Display;&lt;br /&gt;import org.eclipse.swt.widgets.Shell;&lt;br /&gt;import org.eclipse.swt.widgets.Table;&lt;br /&gt;import org.eclipse.swt.widgets.TableItem;&lt;br /&gt;import com.google.gdata.client.contacts.ContactsService;&lt;br /&gt;import com.google.gdata.data.contacts.ContactEntry;&lt;br /&gt;import com.google.gdata.data.contacts.ContactFeed;&lt;br /&gt;import com.google.gdata.data.contacts.GroupMembershipInfo;&lt;br /&gt;import com.google.gdata.data.extensions.Email;&lt;br /&gt;import com.google.gdata.data.extensions.ExtendedProperty;&lt;br /&gt;import com.google.gdata.data.extensions.Im;&lt;br /&gt;import com.google.gdata.util.AuthenticationException;&lt;br /&gt;import com.google.gdata.util.ServiceException;&lt;br /&gt;&lt;br /&gt;public class TestClass {&lt;br /&gt;/**&lt;br /&gt;* @param args&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;public static void main(String[] args) {&lt;br /&gt;ContactsService myService = new ContactsService("contactsclientapp");&lt;br /&gt;try {&lt;br /&gt;myService.setUserCredentials("xyz@gmail.com",&lt;br /&gt;"password");&lt;br /&gt;&lt;br /&gt;//printAllContacts(myService);&lt;br /&gt;&lt;br /&gt;displayAllContacts(myService);&lt;br /&gt;&lt;br /&gt;} catch (AuthenticationException e) {&lt;br /&gt;// TODO Auto-generated catch block&lt;br /&gt;&lt;br /&gt;e.printStackTrace();&lt;br /&gt;&lt;br /&gt;} catch (ServiceException e) {&lt;br /&gt;&lt;br /&gt;// TODO Auto-generated catch block&lt;br /&gt;&lt;br /&gt;e.printStackTrace();&lt;br /&gt;&lt;br /&gt;} catch (IOException e) {&lt;br /&gt;&lt;br /&gt;// TODO Auto-generated catch block&lt;br /&gt;&lt;br /&gt;e.printStackTrace();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static void printAllContacts(ContactsService myService)&lt;br /&gt;&lt;br /&gt;throws ServiceException, IOException {&lt;br /&gt;&lt;br /&gt;// Request the feed&lt;br /&gt;&lt;br /&gt;URL feedUrl = new URL(&lt;br /&gt;&lt;br /&gt;"http://www.google.com/m8/feeds/contacts/xyz@gmail.com/full");&lt;br /&gt;&lt;br /&gt;ContactFeed resultFeed = myService.getFeed(feedUrl, ContactFeed.class);&lt;br /&gt;&lt;br /&gt;// Print the results&lt;br /&gt;&lt;br /&gt;System.out.println(resultFeed.getTitle().getPlainText());&lt;br /&gt;&lt;br /&gt;for (int i = 0; i &amp;lt; resultFeed.getEntries().size(); i++) {&lt;br /&gt;&lt;br /&gt;ContactEntry entry = resultFeed.getEntries().get(i);&lt;br /&gt;&lt;br /&gt;System.out.println("\t" + entry.getTitle().getPlainText());&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System.out.println("Email addresses:");&lt;br /&gt;&lt;br /&gt;for (Email email : entry.getEmailAddresses()) {&lt;br /&gt;&lt;br /&gt;System.out.print(" " + email.getAddress());&lt;br /&gt;&lt;br /&gt;if (email.getRel() != null) {&lt;br /&gt;&lt;br /&gt;System.out.print(" rel:" + email.getRel());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (email.getLabel() != null) {&lt;br /&gt;&lt;br /&gt;System.out.print(" label:" + email.getLabel());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (email.getPrimary()) {&lt;br /&gt;&lt;br /&gt;System.out.print(" (primary) ");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;System.out.print("\n");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System.out.println("IM addresses:");&lt;br /&gt;&lt;br /&gt;for (Im im : entry.getImAddresses()) {&lt;br /&gt;&lt;br /&gt;System.out.print(" " + im.getAddress());&lt;br /&gt;&lt;br /&gt;if (im.getLabel() != null) {&lt;br /&gt;&lt;br /&gt;System.out.print(" label:" + im.getLabel());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (im.getRel() != null) {&lt;br /&gt;&lt;br /&gt;System.out.print(" rel:" + im.getRel());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (im.getProtocol() != null) {&lt;br /&gt;&lt;br /&gt;System.out.print(" protocol:" + im.getProtocol());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (im.getPrimary()) {&lt;br /&gt;&lt;br /&gt;System.out.print(" (primary) ");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;System.out.print("\n");&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System.out.println("Groups:");&lt;br /&gt;&lt;br /&gt;for (GroupMembershipInfo group : entry.getGroupMembershipInfos()) {&lt;br /&gt;&lt;br /&gt;String groupHref = group.getHref();&lt;br /&gt;&lt;br /&gt;System.out.println(" Id: " + groupHref);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;System.out.println("Extended Properties:");&lt;br /&gt;&lt;br /&gt;for (ExtendedProperty property : entry.getExtendedProperties()) {&lt;br /&gt;&lt;br /&gt;if (property.getValue() != null) {&lt;br /&gt;&lt;br /&gt;System.out.println(" " + property.getName() + "(value) = "&lt;br /&gt;&lt;br /&gt;+ property.getValue());&lt;br /&gt;&lt;br /&gt;} else if (property.getXmlBlob() != null) {&lt;br /&gt;&lt;br /&gt;System.out.println(" " + property.getName()&lt;br /&gt;&lt;br /&gt;+ "(xmlBlob)= " + property.getXmlBlob().getBlob());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;String photoLink = entry.getContactPhotoLink().getHref();&lt;br /&gt;&lt;br /&gt;System.out.println("Photo Link: " + photoLink);&lt;br /&gt;System.out.println("Contact's ETag: " + entry.getEtag());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public static void displayAllContacts(ContactsService myService)&lt;br /&gt;&lt;br /&gt;throws ServiceException, IOException {&lt;br /&gt;URL feedUrl = new URL(&lt;br /&gt;&lt;br /&gt;"http://www.google.com/m8/feeds/contacts/saurav.sarkar1@gmail.com/full");&lt;br /&gt;ContactFeed resultFeed = myService.getFeed(feedUrl, ContactFeed.class);&lt;br /&gt;&lt;br /&gt;Display display = new Display();&lt;br /&gt;Shell shell = new Shell(display);&lt;br /&gt;shell.pack();&lt;br /&gt;shell.open();&lt;br /&gt;shell.setText("Contacts of Mail id");&lt;br /&gt;shell.setLayout(new GridLayout(1, true));&lt;br /&gt;&lt;br /&gt;GridData gridData=new GridData(GridData.FILL_BOTH);&lt;br /&gt;Table contactsTable=new Table(shell, SWT.BORDER);&lt;br /&gt;contactsTable.setLayoutData(gridData);&lt;br /&gt;contactsTable.setLinesVisible(true);&lt;br /&gt;for (int i = 0; i &amp;lt; resultFeed.getEntries().size(); i++) {&lt;br /&gt;TableItem eMailItem=new TableItem(contactsTable, SWT.BORDER);&lt;br /&gt;ContactEntry entry = resultFeed.getEntries().get(i);&lt;br /&gt;eMailItem.setText(entry.getTitle().getPlainText());&lt;br /&gt;}&lt;br /&gt;shell.setSize(400, 400);&lt;br /&gt;&lt;br /&gt;while (!shell.isDisposed()) {&lt;br /&gt;if (!display.readAndDispatch()) {&lt;br /&gt;// If no more entries in event queue&lt;br /&gt;display.sleep();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;display.dispose();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;printAllContacts() method in the above code prints all the data in the console, the second method displayAllData()&amp;nbsp; displays all the data in a SWT table.&lt;br /&gt;Pretty quickfire code i must say and then&amp;nbsp;i shall proceed with my bigger assignment.&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Saurav&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-5609043309038924139?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/5609043309038924139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=5609043309038924139' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5609043309038924139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5609043309038924139'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/08/contact-google-apis-through-java-and.html' title='Contact Google APIs through Java and RCP'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-5901803941409241915</id><published>2010-07-12T04:34:00.000-07:00</published><updated>2010-07-12T04:34:06.992-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Helios'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>The Juggernaut of Eclipse Helios arrives</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_f8qPsCVykEE/TDr8QK-BY3I/AAAAAAAAAL8/gyORQjG76ho/s1600/helios.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" rw="true" src="http://2.bp.blogspot.com/_f8qPsCVykEE/TDr8QK-BY3I/AAAAAAAAAL8/gyORQjG76ho/s320/helios.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;This is that time of year, when the Eclipse community comes up with its brand new release.Last year i wrote about &lt;a href="http://codifyit.blogspot.com/2009/06/galielo-makes-my-life-easier.html"&gt;Galileo&lt;/a&gt;, this time much awaited Helios comes into the limelight.&lt;/div&gt;&lt;br /&gt;So time for some new and noteworthy features to be told about.All in all 39 projects were worked upon..&lt;br /&gt;Few of the features have been listed below.&lt;br /&gt;&lt;br /&gt;(1)&amp;nbsp;&lt;strong&gt;&lt;em&gt; EMF on the Web&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;In Last few months, i have digged into RAP and its internals.As we know Single sourcing is the wonderful concept RAP has come up with, you write code once and run it on your preferred runtime (web or desktop).&lt;br /&gt;In Helios RAP and EMF team came up with the EMF Edit UI support in RAP as they famously say 'EMF on Web'.Two new RAP specific plug-ins were introduced named 'org.eclipse.emf.rap.common.ui' and 'org.eclipse.emf.rap.edit.ui' .Please follow the Helios in Action link&amp;nbsp;&amp;nbsp;&lt;a href="http://live.eclipse.org/node/925"&gt;EMF on Web&lt;/a&gt;&amp;nbsp;for more details.&lt;br /&gt;&lt;br /&gt;(2) &lt;strong&gt;&lt;em&gt;Other RAP Improvements&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Other significant RAP improvements include support for DnD&amp;nbsp;,&amp;nbsp;much awaited support for GraphicsContext and also integration with &lt;a href="http://www.eclipse.org/riena/"&gt;Riena&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;(3) &lt;strong&gt;&lt;em&gt;Eclipse Marketplace&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There was always the Eclipse marketplace available in the web.But now this time the Eclipse Marketplace&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_f8qPsCVykEE/TCylOo5jPKI/AAAAAAAAALk/Twd0ct9xw8o/s1600/EMP.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="117" rw="true" src="http://4.bp.blogspot.com/_f8qPsCVykEE/TCylOo5jPKI/AAAAAAAAALk/Twd0ct9xw8o/s200/EMP.png" width="200" /&gt;&lt;/a&gt;has been integrated with the IDE.Clicking on it lists down all the&amp;nbsp;thirdparty&amp;nbsp;plug-ins of eclipse available in the marketplace.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(4) &lt;strong&gt;&lt;em&gt;JSDT Improvments&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;JavaScript Development toolkit is the other project which i have used extensively both as an user and as an extender.I keep on awaiting on new JSDT features everytime.&lt;br /&gt;&lt;br /&gt;JSDT Debug provides a base implementation of JSDI in the form of Rhino debug support. This includes Rhino connector,Rhino Debug Client to enable remote debugging,Breakpoint participants and Rhino console as one of the major features.Other things i noticed was a Quick outline view on the Java Script and CSS editor, quite an useful feature.&lt;br /&gt;&lt;br /&gt;(5) &lt;strong&gt;&lt;em&gt;Resources Improvements&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Resources is another front where i feel there have been substantial improvements.&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;a href="http://4.bp.blogspot.com/_f8qPsCVykEE/TDB0IkjXQXI/AAAAAAAAALs/op6eaJrHb8g/s1600/VirtualResources.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" rw="true" src="http://4.bp.blogspot.com/_f8qPsCVykEE/TDB0IkjXQXI/AAAAAAAAALs/op6eaJrHb8g/s200/VirtualResources.png" width="167" /&gt;&lt;/a&gt;Virtual folder scenario can now be observed in Helios.Virtual folders are actually the resources which do not exist and any resources under it has to be linked and with permission management under it. I feel this a nice little feature.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Now an Eclipse resource can be opened from&amp;nbsp;command line also.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;Other significant features has been Git support in Eclipse as eGit project, p2 API and b3 Aggregator.&lt;br /&gt;Folks who work on migration side from 3.5 to 3.6. can get few tips&amp;nbsp;here &lt;a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.platform.doc.isv/porting/3.6/incompatibilities.html?view=co"&gt;migration&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;With the Eclipse community getting more and more vibrant, resulting more &lt;a href="http://wiki.eclipse.org/Eclipse_DemoCamps_Helios_2010"&gt;Democamps of Helios&lt;/a&gt; being organized all over the world. I am really expecting cutting technologies from the Eclipse community in the future.The next generation release of Eclipse e4 is already creating news everywhere.&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;Watchout this space for more Eclipse talks.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-5901803941409241915?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/5901803941409241915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=5901803941409241915' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5901803941409241915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5901803941409241915'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/07/juggernaut-of-eclipse-helios-arrives.html' title='The Juggernaut of Eclipse Helios arrives'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_f8qPsCVykEE/TDr8QK-BY3I/AAAAAAAAAL8/gyORQjG76ho/s72-c/helios.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6746073373706010950</id><published>2010-07-06T10:45:00.000-07:00</published><updated>2010-07-06T10:45:33.865-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Importing a Rational Rose file into an EMF Project</title><content type='html'>As we trade through my last posts about EMF.We conclude that the source for the EMF model could be a XSD,Annotated Java interfaces or a Rational Rose UML file.&lt;br /&gt;&lt;br /&gt;Lets see what is the motivation behind keeping this option.For Desginers or Modelers surely this is a boon.Model the application in UML and then generate the corresponding code for it keeping all the relations between the model elements intact.Woo you have the model and the generated code ready.So EMF tools provide an option to import the model from a Rational Rose (.mdl ) file.Follow the simple steps below to achieve the same.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_f8qPsCVykEE/TDNqVy0x7cI/AAAAAAAAAL0/Xz7eXNGSAF8/s1600/EMF_RR_Importer.png" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="315" rw="true" src="http://2.bp.blogspot.com/_f8qPsCVykEE/TDNqVy0x7cI/AAAAAAAAAL0/Xz7eXNGSAF8/s320/EMF_RR_Importer.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;1. Create an EMF Project -&amp;gt; Enter the name of the project -&amp;gt; Select the Model Importer as Rose Class Model as shown in the figure in the right.&lt;br /&gt;&lt;br /&gt;2. Mention the URI from where the .mdl file should be loaded.&lt;br /&gt;&lt;br /&gt;3. If required mention the symbol location.Symbol may actually point to the relative location.Make the symbol point to the actual location on the file system.&lt;br /&gt;&lt;br /&gt;4. Once done.Select next and then finish.&lt;br /&gt;&lt;br /&gt;5. You should have an .ecore and one .genmodel file being generated under the model pakcage of the project.&lt;br /&gt;&lt;br /&gt;So above simple steps mention how to import a model from the Rational rose file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6746073373706010950?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6746073373706010950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6746073373706010950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6746073373706010950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6746073373706010950'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/07/importing-rational-rose-file-into-emf.html' title='Importing a Rational Rose file into an EMF Project'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_f8qPsCVykEE/TDNqVy0x7cI/AAAAAAAAAL0/Xz7eXNGSAF8/s72-c/EMF_RR_Importer.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6007586148943311087</id><published>2010-06-28T06:14:00.000-07:00</published><updated>2010-06-28T06:14:30.967-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Frameworks'/><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Flexing your brain</title><content type='html'>This one will be for Flex.I Will write about howmuchever i have learnt Flex during last week for developing a very simple application.Rich Internet applications(RIA) as we know is the technology which enables the user to experience the desktop like features on the web.Adobe Flex,Java FX ,MS Silverlight are few flag bearers in this segment.&lt;br /&gt;&lt;br /&gt;My tryst with Adobe Flex started with a very small application which made me aware of basic Flex concepts.We know Flash is actually the runtime of Adobe Flex.Flex SDK are the APIs to the flash runtime.Adobe provides Flex builder to create your flash based applications and it provides useful tools to develop your applications whithin a very less time.&lt;br /&gt;&lt;br /&gt;Usually an Adobe Flex project contains application which may contain several components.These applications are converted into swf binaries which are actually downloaded to the client and they run in the flash runtime.So as i said There can be Flex Applications-&amp;gt; It can contain mulitple resusable Flex components.&lt;br /&gt;&lt;br /&gt;Flex presentation layer is handled by MXML and the main programming stuff is perfromed in the ActionScript files.ActionScript is an implementation by the Adobe over the ECMA script.An MXML file can contain action scripts or actionscripts can independently exsist to be called by the mxml or any as file.In HTML world MXML can be thought of as HTML and the ActionScirpt could be compared with JavaScript.&lt;br /&gt;&lt;br /&gt;Flex provides rich array of UIs like DataGrid,ColorPicker etc to be used in the code.Flex builder has a nice view consist of both Source and Design, where Desing tab gives the Visual Studio like behaviour and enables the user to Model the UI.&lt;br /&gt;&lt;br /&gt;Once the coding has been done, the flex source is then compiled into swf files which could then be deployed onto the server.Flex SDK also&amp;nbsp;very simple APIs for Web service,HTTPServices etc to be easily consumed into the application.&lt;br /&gt;Fascinating experience i must say.I just rambled about few drops out of the Adobe Flex Ocean.Adobe provides very user intuitive code snippets/documents to enable a developer getting easily ramped up on Flex topics.Give it a try i must say.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6007586148943311087?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6007586148943311087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6007586148943311087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6007586148943311087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6007586148943311087'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/06/flexing-your-brain.html' title='Flexing your brain'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4491243420924731766</id><published>2010-06-05T05:28:00.000-07:00</published><updated>2010-06-05T05:28:46.676-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Learn the EMF</title><content type='html'>So i decided to write this blog as i come from an basic EMF training.Writing has always helped my learning's to be persisted.&lt;u&gt;Eclipse Modeling framework&lt;/u&gt; (EMF) has been one of the top projects of Eclipse for long time.Its versatility and usefulness has been grasped by people with both hands.Many successful projects have been implemented on EMF for the past years.&lt;br /&gt;&lt;br /&gt;EMF on basic terms is all about your model.Model is nothing but the structural representation of your business domain and hence each model must have its metadata so to call 'The Metamodel'.More information on &lt;u&gt;Model Driven Architecture&lt;/u&gt; (MDA) could be found here.&lt;a href="http://en.wikipedia.org/wiki/Model-driven_architecture"&gt;MDA&lt;/a&gt;.My initial post about EMF is here .&lt;a href="http://codifyit.blogspot.com/2010/01/setting-up-emf.html"&gt;Setting up EMF&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So moving ahead.EMF provides two files once you generate a model.The .ecore file and .genmodel file. The genmodel file is the Platform dependent file (By Platform i meant Eclipse and Java). The ecore file is the platform independent one.The model starts with a root and then all the Objects.Objects then have the properties and the opeations.From the ecore file the model classes are generated from the clicking the option 'Generate Model Code'.&lt;br /&gt;Please Note: it has other options like 'Generate Test Code','Generate Editr code'.May be i will take other things further later.&lt;br /&gt;&lt;br /&gt;All EMF model object derive from EObject.EObject instances has references to EAttributes,EReferences and EOpeartions.&lt;br /&gt;EAttributres correspond to the Java native type properties of the class .EReference correspond to the Custom properties of the class.EOperations are actually the methods.Attributes and Operations could be added to the Model from the ecore file.&lt;br /&gt;Along with the Object instacnes it EMF also generates files Package and Factory classes.Factory class as by the name is the factory for creation of all the model object instances.Package class contains references for all the Objects and their attributes.It also generates Adapter Factory and Switch classes.Adapter Factory is used heavily in the EMF edit code. Usages of above of two classes i will mention in the other posts.&lt;br /&gt;EMF provides APIs for creation of Objects as well as accessing those objects reflectively.Like eSet(EStructuralFeature).I have personally seen how these APIs reduce code duplication.&lt;br /&gt;&lt;br /&gt;So what else.We know the model will be changed and then the UI depending on the model must react to that.i.e. the UI must refresh.So the EObject instance also acts as a notifier of the events to the observers.In this case the UIs act as Observers to the Model.So the application developer does not have to think about the Notification and all.Then after all this comes the &lt;u&gt;persistence&lt;/u&gt; of the model.EMF provides the concepts of ResourceSets and Resource and then persisting them as an XML file.So it has the API for the serializing as well as Deserializing.&lt;br /&gt;EMF provides a &lt;u&gt;Validation framework&lt;/u&gt;.The validation framework helps to validate the model correctness.Validation could be done on a live or batch basis.&lt;br /&gt;We learnt about &lt;u&gt;change recording&lt;/u&gt;.EMF provides API where an object changes are recorded and can be applied and reveresed.The important thing is the API getChangedObjects() which contains what was changed and not.This Change recording is useful in the Transaction Management.Same stuff could be achieved by Command stack.EMF Command stack has all the commands used to change the object like SetCommand,Create Command etc. These Commands internally take care of Notification,Undo ,Redo stuff.These commands are very useful when the EMF model is edited by the Eclipse &lt;a href="http://codifyit.blogspot.com/2010/04/eclipse-editor-part-1.html"&gt;editors&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There is a concept of &lt;u&gt;Dynamic EMF&lt;/u&gt;. By Dynamic EMF APIs the metamodel could be created programmaticaly on the runtime.In this case no ecore and genmodel files are generated.Interesting and useful thing i must say.&lt;br /&gt;&lt;br /&gt;All in all some major concepts of EMF were covered.I took out a lot from the training and really want to apply my knowledge on some real stuff.&lt;br /&gt;EMF related documentation could be found &lt;a href="http://www.eclipse.org/modeling/emf/"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4491243420924731766?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4491243420924731766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4491243420924731766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4491243420924731766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4491243420924731766'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/06/learn-emf.html' title='Learn the EMF'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-1533812543721732681</id><published>2010-05-04T02:38:00.000-07:00</published><updated>2010-05-04T02:38:23.789-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Plug-in'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse Plug-in</title><content type='html'>Let us recoil back to some basics.Would do some ranting about what a plug-in is.Older days there used to be monolithic applications and frameworks.There developers only job was to work on the specified requirement he did not use to look further into other aspects of applications like&amp;nbsp;Scalability,Portability,&amp;nbsp;Extensibility&amp;nbsp;etc.&lt;br /&gt;Concept of plug-in comes from the Extensibility angle.Now a days a developer always has to keep in mind the facade of extensibility, where it is not only done to create an application it is also to think how it can be extended.It can be extended by him or by somebody else.&lt;br /&gt;&lt;br /&gt;So now he started making the frameworks/applications extensible and then it was extended by the extenders providing the plug-ins into the framework.By the word plug-in i really mean the de facto&amp;nbsp;behavior&amp;nbsp;of 'Plug and Play'.Just plug it and watch the fun.&lt;br /&gt;&lt;br /&gt;Eclipse prior to 3 releases used to employ the same fundae.Eclipse has a framework and the framework is itself in the form of Plug-ins.Anyone else who wishes to extend/contribute might write his own plug-in and follow some &amp;nbsp;lucid steps to get the desired&amp;nbsp;behavior&amp;nbsp;plugged into the Eclipse.With the evoulution of OSGI Eclipse itself moved to OSGI framework, the very same concept of Plug-in became bundles.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Inter Plug-in communications&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;Then came the very&amp;nbsp;pertinent&amp;nbsp;question how the plug-ins interact which each other.Ther are majorly two ways to do so.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Extension Points&lt;/li&gt;&lt;li&gt;Adding dependencies on the Plug-ins.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Extensions and Extension&amp;nbsp;points&amp;nbsp;:- A Plug-in can expose extension and other plug-ins can contribute to it through extension points.Good part about this is the Dependent plug-in need not add the parent plug-in in the&amp;nbsp;dependencies&amp;nbsp;page.So the Dependent plug-in while loading does not require the other plug-ins to be loaded.&lt;br /&gt;&lt;br /&gt;Adding&amp;nbsp;dependencies&amp;nbsp;is just the usual way of referring and putting the plug-in as a dependency and let the Plug-in class loader know about the other plug-ins.&lt;br /&gt;&lt;br /&gt;A Plug-in is first installed, activated and then if required deactivated.&lt;br /&gt;&lt;br /&gt;This was pretty much of the evolution of Eclipse Plug-ins /Bundles as tried to capture the way an Eclipse Plug-in behaves.Reader please put your comments.&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Saurav&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-1533812543721732681?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/1533812543721732681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=1533812543721732681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1533812543721732681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1533812543721732681'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/05/eclipse-plug-in.html' title='Eclipse Plug-in'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-671629931114158990</id><published>2010-04-26T00:40:00.000-07:00</published><updated>2010-04-28T12:18:47.561-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='Resource Plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse tips -Part 2</title><content type='html'>&lt;div&gt;&lt;/div&gt;&lt;br /&gt;Sometimes tiny things overlooked can prove fatal or resolving them result to time consuming affair.In my Eclipse tips series i try to check the small things which can prove very pertinent.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Right Alignment of actions on the toolbar&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Today i got a small requirement to align the toolbar actions to right side of the toolbar.I defintely thought there should be some style bits in the SWT class which would help me to achieve the same.I looked for SWT.RIGHT and SWT.RIGHT_TO_END, both did not work.Then reading a java docs i found about SWT.END (as again one take away from the &lt;a href="http://www.eclipseday.in/"&gt;Eclipse day &lt;/a&gt;was to always read the javadocs).So I already have a composite on which the layout was applied, but it the layout data was not fully taking the horizonatal space.Below is the code&lt;br /&gt;&lt;code&gt;GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).grab(true, false).applyTo(toolbar); &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;where toolbar is the instance of the toolbar created.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Eclipse Resource&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now some useful things on the Eclipse resource framework.&lt;br /&gt;We know a resource which is not not under the Eclipse worksapce can not get a handle for IFile and EFS understands IFile.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Eclipse Plug-in's Metadata location&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;All Eclipse plug-in have a metdata location which they can use to store some files.How do we get access to that metadata location.&lt;br /&gt;Get the instance of the active bundle, then apply this api bundle.getPlatformLocation().&lt;br /&gt;This returns the metadata location of the plug-in.&lt;br /&gt;&lt;b&gt;&lt;u&gt;Update of OutlineView on Tab change of MultipageEditor&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;OK.This was something i am enthralled after doing it.It was a good challenge at 12-30 A.M. i could finish it.I could also think this as an extension of My eclipse editor tutorial, but nevertheless.&lt;br /&gt;Will try to dig deep into &lt;a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/part/MultiPageEditor.html"&gt;MultipageEditor&lt;/a&gt; in other posts.Each editor as we know has an outline view attached to it and the outline view is attached as PartListener.So when the editorpart gets activated the part listeners react and create the control.Hence the attached OutlineView gets activated.&lt;br /&gt;Now lets come to &lt;a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/part/PageBook.html"&gt;PageBook&lt;/a&gt;. A PageBook is a container which enables the visibility of the page.For a MultipageEditor the Outline view is a pagebook and then use the pagebook API showPage(Control) to show the page(Outline).&lt;br /&gt;Find the code snippet below which helps to create the outlinepage.&lt;br /&gt;&lt;code&gt;public void setPageActive(IContentOutlinePage page) {&lt;br /&gt;&lt;br /&gt;this.currentPage = page;&lt;br /&gt;if (mPagebook == null) {&lt;br /&gt;// still not being made&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;Control control = page.getControl();&lt;br /&gt;if (control == null || control.isDisposed()) {&lt;br /&gt;// first time&lt;br /&gt;if (page instanceof IPageBookViewPage) {&lt;br /&gt;try {&lt;br /&gt;((IPageBookViewPage) page).init(getSite());&lt;br /&gt;} catch (PartInitException e) {&lt;br /&gt;e.printStrackTrace();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;page.createControl(mPagebook);&lt;br /&gt;control = page.getControl();&lt;br /&gt;}&lt;br /&gt;mPagebook.showPage(control); &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Above is the code which should be called when the page change happens such that for each of the pages the outlinepage is created.&lt;br /&gt;I Hope all the above tips were useful&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-671629931114158990?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/671629931114158990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=671629931114158990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/671629931114158990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/671629931114158990'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/04/eclipse-tips-part-2.html' title='Eclipse tips -Part 2'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2743434971990534350</id><published>2010-04-24T10:21:00.001-07:00</published><updated>2011-06-19T23:32:14.924-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SWT'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Dont block me</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Yes folks,This post comes from the session given by Lakshmi Priya which i attended from the Eclipse Day yesterday.&lt;br /&gt;&lt;br /&gt;To start with &lt;span style="color: #660000; font-size: 130%;"&gt;Eclipse Day&lt;/span&gt; was an amazing experience.Again kudos to &lt;a href="http://blog.ankursharma.org/"&gt;Ankur &lt;/a&gt;and &lt;a href="http://blog.eclipse-tips.com/"&gt;Prakash &lt;/a&gt;for pulling off one more classic event.It was really wonderful and exciting to meet other fellow Eclipse enthusiasts.There were lot of good presentations given by Industry experts.&lt;br /&gt;&lt;br /&gt;Now this post is about the SWT behavior and the concept of &lt;span style="color: #660000;"&gt;UI&lt;/span&gt; and &lt;span style="color: #660000;"&gt;Non-UI &lt;/span&gt;jobs.I knew most of the things but the presentation in the eclipse day made the things crystal clear.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #660000;"&gt;SWT &lt;/span&gt;represents the framework of Standard widgets used in the &lt;span style="color: #660000;"&gt;Rich Client Platform(RCP) &lt;/span&gt;applications.So it essentially defines the UI behavior of my application.In Eclipse UI can be only accessed from the UI thread.Eclipse follows the 'Apartment' threading or the Single Thread UI model.This Single thread is the starting thread which comes from PlatformUI class. The UI events are dispatched and put in the queue for the UI thread to work upon, So if the opeation takes long time to complete then it makes the UI unresponsive and blocks other events to be worked upon.&lt;br /&gt;&lt;br /&gt;So ideally the long running operations must not run in a UI thread, a separate thread should be forked.Then in that thread if a UI widget needs to be accessed, spawn a separate UI thread.In Eclipse it can be achieved through two ways.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;Display.syncExec(Runnable re) or Display.asyncExec(Runnable re)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Display is the foremost important class in the SWT.It manages the connection between SWT and underlying operatin system resources.Check the getDefault() and getCurrent() methods to get the instance of Display as needed.&lt;br /&gt;&lt;br /&gt;The first one keeps the callee thread suspended and until the called thread finishes it job it can not proceed.The other one as the name specifies proceeds in an asynchronous manner.&lt;br /&gt;&lt;br /&gt;There are&lt;span style="color: #660000;"&gt; UIJob&lt;/span&gt;s classes which runs the operations in the async way.UIJobs also have something a Scheduling rules which could be further specified&lt;br /&gt;&lt;br /&gt;One more important thing to note is that, any UI widget accessed within the display. methods need undergo through the Widget.isDisposed() method to check whether the widget is disposed or not.&lt;br /&gt;&lt;br /&gt;Pretty important things i must say.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-2743434971990534350?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2743434971990534350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2743434971990534350' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2743434971990534350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2743434971990534350'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/04/dont-block-me.html' title='Dont block me'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6400629189265391340</id><published>2010-04-18T00:04:00.000-07:00</published><updated>2010-04-19T21:47:54.224-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Image'/><title type='text'>Eclipse Tips-Part 1</title><content type='html'>&lt;div&gt;&lt;u&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Getting Images from the Plug-ins folder.&lt;/span&gt;&lt;br /&gt;&lt;/u&gt;&lt;br /&gt;The most simple and efficient way to create an ImageDescriptor and then the image out of it is to use the&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public static ImageDescriptor imageDescriptorFromPlugin(String pluginId,&lt;br /&gt;String imageFilePath)&lt;br /&gt;&lt;/code&gt;method of the AbstractUIPlugin class.&lt;br /&gt;&lt;br /&gt;It Creates and returns a new image descriptor for an image file located within the specified plug-in.&lt;br /&gt;&lt;strong&gt;&lt;u&gt;Clear the runtime workspace data&lt;/u&gt;&lt;/strong&gt;&lt;a href="http://3.bp.blogspot.com/_f8qPsCVykEE/S8v5ZlVvhdI/AAAAAAAAAKc/SgLAwpUcOfs/s1600/runtime_clear.jpg"&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_f8qPsCVykEE/S8v5ZlVvhdI/AAAAAAAAAKc/SgLAwpUcOfs/s1600/runtime_clear.jpg"&gt;&lt;/a&gt;&lt;u&gt; &lt;/u&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_f8qPsCVykEE/S8v5hXiYlcI/AAAAAAAAAKk/nX3EEJV5AX4/s1600/runtime_clear.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p align="left"&gt;&lt;a href="http://1.bp.blogspot.com/_f8qPsCVykEE/S8v6T9LYCyI/AAAAAAAAAK8/f92kKN8Voas/s1600/runtime_clear.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5461734193863592738" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 256px" alt="" src="http://1.bp.blogspot.com/_f8qPsCVykEE/S8v6T9LYCyI/AAAAAAAAAK8/f92kKN8Voas/s320/runtime_clear.jpg" border="0" /&gt;&lt;/a&gt;The diagram shows how the workspace could be cleared by checking the clear option. &lt;/p&gt;&lt;br /&gt;&lt;p align="left"&gt;It deletes the data created for the runtime.It asks the user before deleting the workspace data.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;u&gt;Working With Eclipse's Preference store&lt;br /&gt;&lt;/u&gt;&lt;/strong&gt;What is a preference store: A preference store is an Eclipse plug-ins persistent state.A plug-in can store any data which it wants to be persisted as a state.The state is stored as a key value pair.Lets see how the preference store for a plug-in can be retrieved.&lt;br /&gt;&lt;br /&gt;The AbstractUIPlugin class provides the method to retrieve the preference store like below&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public IPreferenceStore getPreferenceStore()&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I Hope the above three small tips would be useful.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6400629189265391340?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6400629189265391340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6400629189265391340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6400629189265391340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6400629189265391340'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/04/eclipse-tips-part-1.html' title='Eclipse Tips-Part 1'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_f8qPsCVykEE/S8v6T9LYCyI/AAAAAAAAAK8/f92kKN8Voas/s72-c/runtime_clear.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2563205888569775336</id><published>2010-04-14T04:26:00.000-07:00</published><updated>2010-04-15T10:05:21.650-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Editor'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse Editor-Part 1</title><content type='html'>&lt;div&gt;&lt;strong&gt;A post to describe the basic steps of creating an Eclipse editor&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;We know Eclipse workbench represents an instance of IWorkbenchPage and then that page constitutes of several IWorkbenchParts.An IWorkbenchPart can be anything from Editor to View.In this post i would like to describe how a simple Eclipse editor could be created and what are the basic things when you create Editor should be kept in mind.&lt;br /&gt;&lt;br /&gt;For the editor to be created it is important to extend the extension point org.eclipse.ui.editor.&lt;br /&gt;&lt;br /&gt;Below is an example how the org.eclipse.ui.editor extension point looks like&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span class="code SchemaTag"&gt;  &lt;extension point="&lt;/span"&gt;&lt;span class="code SchemaCstring"&gt;"org.eclipse.ui.editors"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;&gt;        &lt;editor id="&lt;/span"&gt;&lt;span class="code SchemaCstring"&gt;"com.xyz.XMLEditor"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;           name=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"Fancy XYZ XML editor"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;           icon=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"./icons/XMLEditor.gif"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;           extensions=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"xml"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;           class=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"com.xyz.XMLEditor"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;           contributorClass=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"com.xyz.XMLEditorContributor"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;           symbolicFontName=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"org.eclipse.jface.textfont"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;          default=&lt;/span&gt;&lt;span class="code SchemaCstring"&gt;"false"&lt;/span&gt;&lt;span class="code SchemaTag"&gt;&gt;        &lt;/span&gt;&lt;/editor&gt;     &lt;/span&gt;&lt;/extension&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;Please note the class attribute which is the instance that extends the EditorPart and provides the basic functionality of the editor.EditorPart has the method createPartControl(Composite parent) where the editor's UI is created.&lt;br /&gt;&lt;br /&gt;Always an editor is opened on a resource like File.So editor must have an input.So for File it will be IFileEditorInput.In the above example the editor can be only opened on a file of type .xml as mentioned in the extensions attribute.&lt;br /&gt;&lt;br /&gt;Other important aspects of Editor are the save,saveAs and the dirty state management.An editor is made dirty if the underlying resource undergoes some change.the isDirty() method returns a boolean to indicate whether the editor is dirty or not.&lt;br /&gt;The doSave() and doSaveAs() methods could be over-ridden to provide the behaviour when the save or ctrl+s is being pressed.&lt;br /&gt;Please note all the above methods discussed are part of the EditorPart class.&lt;br /&gt;&lt;br /&gt;More advanced topics of editor like How to launch an extenal editor,EditorMatchingStrategy and EditorbarContributor i would like to cover in the next post for the Eclipse editors.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-2563205888569775336?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2563205888569775336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2563205888569775336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2563205888569775336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2563205888569775336'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/04/eclipse-editor-part-1.html' title='Eclipse Editor-Part 1'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2497569172064413230</id><published>2010-03-10T21:19:00.000-08:00</published><updated>2010-03-12T23:56:39.499-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Web'/><category scheme='http://www.blogger.com/atom/ns#' term='Charts'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Hassles of Web</title><content type='html'>Web Development can be a problem if some basics are not correct.Things like Browser compatibilities, Java script anomalies etc can be a pain.&lt;br /&gt;Last week during my experimentation with YUI and Skinning had put me in front of these minor monsters.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Accessing local files in Firefox&lt;/span&gt; : Firefox by default does not allow any local links to be accessed for the security reasons.It can be enabled by using Firefox extensions like NoScript.NoScript installs a bar at the bottom of the desktop and provdies an user intuitive way to manage the access of links,scripts for your web page.Pretty good learning for me.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Folder Structure of the Web Application&lt;/span&gt;&lt;br /&gt;Now lest jump into the Folder structure desgin of the Web application.Haling from the Core Java and Eclipse PDE background, i have this unique itch of doing everything in a modular way. So at first i kept all of my files under separate folder and inside the WEB-INF.Then i came to know thanks to Rohitesh also that anythning apart from class files and configuration files can not be kept under WEB-INF because that is against the J2EE spec.One good reason i found on the net was the deploy and design files should be kept separately.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Usage of Chart APIs&lt;/span&gt;&lt;br /&gt;Had a basic look at the different Chart APIs.Was pondering about which OS chart APIs to use, YUI charts have a definitive advantage due to two reasons.&lt;br /&gt;&lt;br /&gt;(a) Already aware of the YUI working&lt;br /&gt;(b) Usage of Flex by the YUI chart APIs.&lt;br /&gt;&lt;br /&gt;Ulf Dittmer proposed me EastWood charts basically which is an implementation of GoogleCharts which is also worth a look.Others libraries like Dojox,FusionCharts are good.&lt;br /&gt;&lt;br /&gt;Happy programming folks.&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Saurav&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-2497569172064413230?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2497569172064413230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2497569172064413230' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2497569172064413230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2497569172064413230'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/03/hassles-of-web.html' title='Hassles of Web'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-696588822303502733</id><published>2010-03-10T05:42:00.000-08:00</published><updated>2010-03-10T05:48:21.357-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='YUI'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Moving ahead</title><content type='html'>Some good progress i could make in the last week, with my basic functionality up and working.Technical learnings which i could take away is certainly Spring MVC,Spring JDBC support and of course refreshing course on HTML.&lt;br /&gt;&lt;br /&gt;I gave some touch ups to make the UI on the web page to look handsome.&lt;br /&gt;Definitely few glitches still pending, like sorting out the working of the HSQLDB but all in all a quite satisfying experience.&lt;br /&gt;&lt;br /&gt;Next step involves taking UIs and diving into the alalytics of the application.&lt;br /&gt;Have had a quite good experience by using the YUI.Very intuitive documentation gave a very less ramp up time for me.&lt;br /&gt;Still facing some issues with the local file loading in the Mozilla firefox.Following up with the firefox support team.&lt;br /&gt;&lt;br /&gt;Now pondering the best analytics chart to use.YUI again running as favourite.My intention would be to use Dojo libraries somewhere.Right place right time would be the answer.&lt;br /&gt;&lt;br /&gt;Folks till then happy programming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-696588822303502733?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/696588822303502733/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=696588822303502733' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/696588822303502733'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/696588822303502733'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/03/moving-ahead.html' title='Moving ahead'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-448702634181041817</id><published>2010-03-04T21:16:00.000-08:00</published><updated>2010-03-04T21:23:43.873-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><title type='text'>The Escapist</title><content type='html'>Most of the programming languages has some characters who has to be rescued by some other characters to be understood by the engine.&lt;br /&gt;Pretty important stuff so thought of jotting them down in one place.&lt;br /&gt;&lt;br /&gt;Below is for Java&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Escape Sequences Escape Sequence Description &lt;br /&gt;\t  Insert a tab in the text at this point.  &lt;br /&gt;\b  Insert a backspace in the text at this point.  &lt;br /&gt;\n  Insert a newline in the text at this point.  &lt;br /&gt;\r  Insert a carriage return in the text at this point.  &lt;br /&gt;\f  Insert a formfeed in the text at this point.  &lt;br /&gt;\'  Insert a single quote character in the text at this point.  &lt;br /&gt;\"  Insert a double quote character in the text at this point.  &lt;br /&gt;\\  Insert a backslash character in the text at this point.  &lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this was useful&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-448702634181041817?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/448702634181041817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=448702634181041817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/448702634181041817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/448702634181041817'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/03/escapist.html' title='The Escapist'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4918349881680760238</id><published>2010-02-19T21:15:00.000-08:00</published><updated>2010-02-23T01:53:28.718-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>In the Groove-Spring MVC</title><content type='html'>Covered quite a distance in my app development from the last post.It can be figured as the basic setup being done.Demons of Spring and HSQL being conquered.&lt;br /&gt;So would like to catch couple of technical learnings in this post.&lt;br /&gt;&lt;br /&gt;I had earlier worked on Spring MVC but as they say you lose it if you dont practice it.&lt;br /&gt;So lets start with the basics of Spring MVC.&lt;br /&gt;MVC is again the famous Model View Controller pattern.Would not go into discussing the same.Spring has DispatcherServlet which acts as a FrontController ,it reads the configuration files and passes the HTTPRequest object to the defined Controller.&lt;br /&gt;Controller then takes the Request and Response class does the necessary processing and returns the View with a Model.Dispatcher Servlets reads it and then pass it to the corresponding view.&lt;br /&gt;Then the View is rendered.&lt;br /&gt;&lt;br /&gt;In Spring Controller can be of different types.ActionController and SimpleFormController to name a few.Would mention SimpleFormController as i have used that.&lt;br /&gt;&lt;br /&gt;The basic entry for the FormController in the configuration file looks like below.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&amp;lt bean &amp;gt&lt;br /&gt;&lt; name="TestBean" class="org.saurav.form.TestForm"&gt; &lt; name="sessionForm" value=""&gt;&lt;br /&gt;&lt; name="commandName" value="name"&gt;&lt;br /&gt;&lt; name="commandClass" value="org.saurav.domain.Test"&gt;&lt;br /&gt;&lt; name="formView" value="AddTest"&gt;&lt;br /&gt;&lt; name="successView" value="index.jsp"&gt;&lt;br /&gt;&lt; name="TestService" ref="testService"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/bean&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This is the standard way to define a Bean in a Spring configuration file.&lt;br /&gt;It starts with the bean name and the actuall class of that bean.&lt;br /&gt;Then comes the attributes or the properties of the bean.&lt;br /&gt;In the above example we are defining a Form bean.Necessary things to set the Form bean are the commandName,commandClass,formView and successView.&lt;br /&gt;&lt;br /&gt;(1) commandName -The name of the request object which will be available to the JSP to work upon.&lt;br /&gt;(2) commandClass - The type of the request object being hold.&lt;br /&gt;(3) formView- The view associated with the form.&lt;br /&gt;(4) successView- The view where the flow will go to once the successfull execution of the form happens.&lt;br /&gt;(5)sessionForm- by default is false.It determines whether the form is in session scope or not.&lt;br /&gt;&lt;br /&gt;Other properties like validator could also be used.Havent used it in my app.So would take it up once i use it.&lt;br /&gt;&lt;br /&gt;In the next post would try to focus on more on the JDBC support of the Spring frameworks.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;bean class="org.saurav.form.TestForm" name="/Test.htm"&gt;&lt;br /&gt;&lt;property name="sessionForm" value="true"&gt;&lt;br /&gt;&lt;property name="commandName" value="name"&gt;&lt;/property&gt;&lt;br /&gt;&lt;property name="commandClass" value="org.saurav.domain.Test"&gt;&lt;br /&gt;&lt;br /&gt;&lt;property name="formView" value="AddTest"&gt;&lt;br /&gt;&lt;property name="successView" value="index.jsp"&gt;&lt;/property&gt;&lt;br /&gt;&lt;property name="TestService" ref="testService"&gt;&lt;br /&gt;&lt;/property&gt;&lt;br /&gt;&lt;/property&gt;&lt;/property&gt;&lt;/property&gt;&lt;/bean&gt;&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/856092880743554053-4918349881680760238?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4918349881680760238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4918349881680760238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4918349881680760238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4918349881680760238'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/02/in-groove-spring-mvc.html' title='In the Groove-Spring MVC'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6806322214930437913</id><published>2010-02-16T04:18:00.000-08:00</published><updated>2010-02-16T04:24:44.049-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='YUI'/><category scheme='http://www.blogger.com/atom/ns#' term='new'/><category scheme='http://www.blogger.com/atom/ns#' term='HSQLDB'/><title type='text'>Development continues Part-2</title><content type='html'>Well now seemed to overcome the problem of HSQLDB, but to be candid i am still not enough confident or clear on the HSQLDB stuff.I Could write the basic functionality of my application with retrieving the records from the DB and displaying them on the web page.Now the modules following would be to generally add the records,delete and update it.That goes for the funcionalities.&lt;br /&gt;Now lets hover what i have learnt, apart from Normal Spring stuff i was able to procure some knowledge on the HSQLDB also.Long forgotten things of TLDs, JSP tags,Spring MVC are to name a few.&lt;br /&gt;Major next challenging thing would be to show the records in the Yahoo UI Data table.Yahoo UI has always fascinated me and i had always had the urge to use them.So this is my chance.In the next blog post will post more on the YUI Data table.&lt;br /&gt;&lt;br /&gt;Other things would definetely involve setting up the Build with Maven.Lets hope i could finish the modules mentioned above quite early and the integration with YUI also within my planned time.Till then happy development.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6806322214930437913?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6806322214930437913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6806322214930437913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6806322214930437913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6806322214930437913'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/02/development-continues-part-2.html' title='Development continues Part-2'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-5545924651944593703</id><published>2010-02-11T10:32:00.000-08:00</published><updated>2010-02-11T10:39:32.315-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='new'/><category scheme='http://www.blogger.com/atom/ns#' term='HSQLDB'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Development Continues-Part 1</title><content type='html'>Now this is going to be kind of novel.A serial novel where i will try to catch the experience i am having with my pet project.Not revealing much more the domain i would come to the technologies i would be using.&lt;br /&gt;My major motivation has always been to catch the Spring wave and try the associated technoglogies.After a great sabattical i tried my hands on the Web development with Spring.I must say with very minor hiccups i was able to run a basic MVC Spring application and could solve the problems on my own.&lt;br /&gt;&lt;br /&gt;I Always will ponder why Oracle DB is not an open source, so i stumbled upon HSQLDB which is a fully Java embedded DB.I downloaded Spring Tool suite and i was able to proceed with Spring development.(Still i see some major improvement areas for STS).&lt;br /&gt;&lt;br /&gt;My tryst with HSQLDB this time was a major problem, where i faced major obstacles.Still now i am facing, i hope by the next post i am able to solve my DB problems and would try to give a brief about the Spring JDBC support and my experience with the HSQLDB support.till then happy exploring&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-5545924651944593703?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/5545924651944593703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=5545924651944593703' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5545924651944593703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5545924651944593703'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/02/development-continues-part-1.html' title='Development Continues-Part 1'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-7759583648419447632</id><published>2010-01-14T20:26:00.000-08:00</published><updated>2010-01-21T21:01:03.849-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Meets'/><category scheme='http://www.blogger.com/atom/ns#' term='Technologies'/><title type='text'>A bag full</title><content type='html'>&lt;p&gt;This post was long time due.In November i got chances to mix with people of various technical backgrounds from diffrent organizations.I Could attend conferences of Eclipse (Hosted by IBM), Google and SAP, where in the last one yours truly was the presenter.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Eclipse hosted a demo camp, wherein people came and showcased their eclipse implementations.Hosted by IBM Bangalore this was a splendid event.There were demoes of various things from TWIST( a tool based on SWTBot), GEF 3d to e4( the next generation eclipse platform).Inspite of heavy pouring, attendees were able to join on time.(On time motto is religiously followed by Eclipse ).I could meet people from various organizations and had useful converstation with them.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After couple of days i attended the Google conference hosted by Google itself.Aniruddh Dewani and Rajdeep Dua of Google showcased the new offerings from Google.From Google App Engine to Docs.Useful session on Andriod was followed after that.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Last but not the least.The magnamious event hosted by SAP called SAP Tech Ed, which every year takes place at the four corners of the world.I presented the CE BPM at the demo pod alongwith couple of my colleagues.Tech Ed is the conference where people from all over the world come, it includes SAP partners,SAP Clients and other industry enthusiasts.It spans over three days and people take back huge learning and knowledge.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Must say the month of novemeber was a huge learning for me.Looking forward for these kind of oppurtunities where pots of learning flow.&lt;/p&gt;&lt;br /&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/856092880743554053-7759583648419447632?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/7759583648419447632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=7759583648419447632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/7759583648419447632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/7759583648419447632'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/01/bag-full.html' title='A bag full'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-5777755109253637359</id><published>2010-01-10T21:04:00.001-08:00</published><updated>2010-01-10T21:04:52.182-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='EMF'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Setting up EMF</title><content type='html'>Previous few days has been seen me doing one migration project and my ventures into EMF.Eclipse Modelling framework they say is a boon to developers.Folks experienced with using UML tools would be very easily able to grasp the concepts.Most of the UML tools can generate code from the UML diagram defined.EMF extended the same concept and made it generic.From EMF point of view, define any model in EMF standards, it will generate the code for you. Now here is the catch, the Model can be created or imported.It can be created majorly in two ways (1) Through Java code and (2) Through defining the XML schema.My divings included through the XML schema.EMF's own model represntation is called eCore. Now lets talk a little bit about the Object diagram of the EMF.EMF's base object is EObject (same as JDK's Object), which henceforth has EAttrtibute,EStructuralFeatures which would i try to write more on the coming blog posts.The EMF generator uses the eCore model converts into genmodel and generates the classes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-5777755109253637359?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/5777755109253637359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=5777755109253637359' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5777755109253637359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5777755109253637359'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/01/setting-up-emf.html' title='Setting up EMF'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-1328851619106681941</id><published>2010-01-05T20:04:00.000-08:00</published><updated>2010-01-05T20:15:11.012-08:00</updated><title type='text'>Control Decoration</title><content type='html'>Decorations are needed to put that extra information on the entity.An eclipse SWT Control can be decorated with the help of ControlDecoration.Find out the code below.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;ConrolDecoration controlDecoration = new ControlDecoration(&lt;br /&gt;swtcontrol, SWT.LEFT SWT.TOP);&lt;br /&gt;FieldDecoration fieldDecoration = FieldDecorationRegistry&lt;br /&gt;.getDefault().getFieldDecoration(&lt;br /&gt;FieldDecorationRegistry.DEC_ERROR);&lt;br /&gt;controlDecoration .setImage(fieldDecoration.getImage());&lt;br /&gt;controlDecoration .hide();&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The above code creates the Control Decoration.A SWT control needs to be passed alongwith the positioning of the marker.In this case it is the top left corner of the control.Field Through FieldDecoration ger the type of the image to be put on the Decoration, in this case it is an error marker.After that use the APIs hide() and show() to display the decoration on the basis of your logic.&lt;br /&gt;PS: I found a good blog on creation of instant SWT mockups.&lt;br /&gt;&lt;a href="http://in.relation.to/Bloggers/InstantMockupForEclipseSWTApplications"&gt;http://in.relation.to/Bloggers/InstantMockupForEclipseSWTApplications&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;cheers,&lt;br /&gt;Saurav&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-1328851619106681941?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/1328851619106681941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=1328851619106681941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1328851619106681941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1328851619106681941'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2010/01/decorate-them.html' title='Control Decoration'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4218577060264642291</id><published>2009-12-16T08:06:00.000-08:00</published><updated>2009-12-16T08:25:25.137-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resource Plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Set project nature on Eclipse Project</title><content type='html'>How to set the project nature for your Eclipse project.&lt;br /&gt;&lt;br /&gt;Lets dive as how to set the Project nature to the Eclipse project already created.&lt;br /&gt;A project typically has a IProjectDescription which has all the project meta data like builder,nature etc.IProjectDescription is used to set the nature of the project.&lt;br /&gt;&lt;br /&gt;An extension point is provided for the contributors to contribute their own nature.&lt;br /&gt;i.e. eclipse.core.resources.nature.&lt;br /&gt;&lt;br /&gt;Now lets see how the project nature is set programmatically.&lt;br /&gt;(a) Get the IProjectDescription from IProject$.getProjectDescription().&lt;br /&gt;(b) Get the nature ids associated with the project by calling IProjectDesciption$.getProjectNatureIds().It returns the array of project nature id as string.&lt;br /&gt;Check if already the nature id you are going to add is there, if not add the project nature to the array.Then set the array by calling IProjectDescription$.setNatureIds(String[] nature).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Check if the nature properly added to the project&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Open the .project file of the project and check if the nature is being added to the file.Once you verify it the nature has been added.&lt;br /&gt;&lt;br /&gt;For more details check this.&lt;br /&gt;http://www.eclipse.org/articles/Article-Builders/builders.html&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&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/856092880743554053-4218577060264642291?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4218577060264642291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4218577060264642291' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4218577060264642291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4218577060264642291'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/12/set-project-nature-on-eclipse-project.html' title='Set project nature on Eclipse Project'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-2222722393748737381</id><published>2009-12-15T05:57:00.000-08:00</published><updated>2009-12-15T21:30:57.586-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='new'/><category scheme='http://www.blogger.com/atom/ns#' term='trac'/><title type='text'>Configure your trac</title><content type='html'>This is my effort to write up how to install trac on windows in 3 easy steps.&lt;br /&gt;1. Download Python.Trac runs on Python environment.&lt;br /&gt;2. Download Trac exe for windows.&lt;br /&gt;3. Download Mod Python and configure on your httpd server.&lt;br /&gt;&lt;br /&gt;Startup the tracd daemon from the command prompt.&lt;br /&gt;&lt;br /&gt;type http://localhost:8080/ to test the page.Once the available projects appears you are sure the tracd has been configured properly.&lt;br /&gt;&lt;br /&gt;Now the steps come to create the projects.&lt;br /&gt;&lt;br /&gt;Type trac-admin ~/trac/myproject initenv..command and enter the necessary details and make sure you get the message of project created successfully.&lt;br /&gt;&lt;p&gt;Then start the project by tracd command.&lt;/p&gt;&lt;p&gt;$ python tracd --port 8000 /path/to/project/env&lt;/p&gt;&lt;p&gt;Test the project by typing localhost:&lt;port&gt;//projectname&lt;/p&gt;&lt;p&gt;You can add your plug-ins thereafter according to your needs.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;I will add more as i keep learning trac&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&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/856092880743554053-2222722393748737381?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/2222722393748737381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=2222722393748737381' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2222722393748737381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/2222722393748737381'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/12/configure-your-trac.html' title='Configure your trac'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-541647225222306022</id><published>2009-12-14T00:36:00.000-08:00</published><updated>2010-01-21T22:35:34.262-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Resource Plugin'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse resources</title><content type='html'>&lt;p&gt;Resources are an important part of any software or any framework.Most of the programs have to retort to work with the underlying file system.Eclipse provides its own abstraction of file system, as what we call Eclipse file system.I would just write out some basic concepts and the simple usages of the API required for daily work.&lt;/p&gt;&lt;p&gt;EFS has its own object model where IResource instance is the parent, all other resource types are extensions of it like IFile,IFolder,IProject etc. A resource wiil always have its parent or container.For example a file, the folder of the file will be its parent /container.&lt;/p&gt;&lt;p&gt;Lets find out how a developer can get access to the underlying resources.Each Workspace is represented by the instance of IWorkspace.Root has to be retrived from the Workspace.&lt;br /&gt;From the root the project with the given name can be retrieved.&lt;/p&gt;&lt;br /&gt;&lt;code&gt;&lt;p&gt;IWorkspaceRoot workspaceRoot=ResourcesPlugin.getWorkspace().getRoot();&lt;/p&gt;&lt;p&gt;workspaceRoot.getProject(String projectName); workspaceRoot.findMember()&lt;/p&gt;&lt;p&gt;&lt;/code&gt;findMember() is a very important API call.It is called on the container/parent to find out if the specified resource is under it or not.The relative path of the resource to the container/parent has to be passed otherwise the null is returned.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Any resource in a project can be found like this&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;/p&gt;&lt;/code&gt;&lt;p&gt;&lt;code&gt;IFolder folder=project.getFolder(String folderName);&lt;/code&gt;&lt;/p&gt;&lt;code&gt;&lt;p&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;any file in a folder&lt;/p&gt;&lt;p&gt;&lt;code&gt;IFile file=folder.getFile(String fileName);&lt;/code&gt; &lt;/p&gt;&lt;p&gt;Eclipse Resouce concepts are itself a very big topic to cover in one post.I would post more entries later depicting the more useful things and certain scenarios.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/code&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&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/856092880743554053-541647225222306022?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/541647225222306022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=541647225222306022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/541647225222306022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/541647225222306022'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/12/eclipse-resources.html' title='Eclipse resources'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6632313108000629014</id><published>2009-06-29T03:32:00.001-07:00</published><updated>2009-06-29T22:01:01.427-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Galileo makes my life easier</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_f8qPsCVykEE/SkiYac7pR6I/AAAAAAAAAEo/kBJ597EPASo/s1600-h/here.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5352695737340217250" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 320px; CURSOR: hand; HEIGHT: 42px" alt="" src="http://1.bp.blogspot.com/_f8qPsCVykEE/SkiYac7pR6I/AAAAAAAAAEo/kBJ597EPASo/s320/here.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;It is been like a new Fifa version for which we wait eagerly and passionately, Like EA sports, Eclipse foundation comes up with dazzling features with its every release. I had the fortunate chance to upgrade my tool to Eclipse 3.5 from 3.4.&lt;br /&gt;&lt;br /&gt;In this way I had a chance to look into the new features and the API changes.I worked more on the API side, but would also like to highlight the new features.&lt;br /&gt;&lt;br /&gt;I have written few JUnit test plugins, now Eclipse 3.5 comes with JUnit 4.5 and allows you to run the tests in Non-UI thread. Advantage lies behind is that if the UI resources are not needed i am free to run my tests in Non UI thread, which saves a lot of performance issues.&lt;br /&gt;&lt;br /&gt;On API side I had worked lot on tabbed properties; I floundered while navigating the tabs in the tabbed property view. But again when the new APIs for selecting, retrieving the tabs were introduced I found ground under my feet. I can now use the API for navigation of the tabs. It does again help me in writing JUnit test cases. As I navigate through all the tabs and test each of them. Continuing on the tabbed properties, we can open two tabbed property views and can pin one of them.&lt;br /&gt;&lt;br /&gt;As a user of tools, I used to get irritated with the tabs of the multipage editor not being able to switched with keyboard shortcuts. In Gallileo this huge accessibility issue is being taken care of. Alt+PageUp and Alt+PageDown helps to switch between the the pages of multipage editors.&lt;br /&gt;&lt;br /&gt;In JDT, Call Hierarchy now shows the constructors, which again I think is a very useful feature to be given to the Java developer.&lt;br /&gt;&lt;br /&gt;Many places we do require toString () to be overridden, as it is pretty important. Now the automatic generator generates the toString () method for you.&lt;br /&gt;&lt;br /&gt;When a colleague first showed me the Plug-in spy, I thought wow this is the kind of thing I was looking for. But context menus were not deciphered through this tool. But this time to my greater relief we have the facility to diagnose the context menu items.&lt;br /&gt;&lt;br /&gt;I have to work with lots of code lines and hence the heterogeneous update sites. 3.5 have the target platform editor improved which helps me to work with different update sites in a better way. It also has the target platform to be added as a feature based, so I may change the version of my choice for the feature and test the code against it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Now coming back to the projects released, all in all 33 projects are released.&lt;br /&gt;I would just touch down upon couple of the projects.&lt;br /&gt;&lt;br /&gt;Mylyn for developer like us has been a great tool all along. Developers like us want everything to be done inside the IDE.We had to log our work in JIRA, so we thought why to have two tools. Then we integrated with Mylyn and life was so easy. In this release with the advent of wiki text, it increases its usability more.&lt;br /&gt;&lt;br /&gt;New RAP (Rich Ajax platform) look and feel is also considered as one the best features of this release. Since I haven’t worked on RAP, won’t be able to divulge more information on this.&lt;br /&gt;&lt;br /&gt;Would keep on adding more to my coming posts as i keep my exploring eye open in the coming days. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6632313108000629014?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6632313108000629014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6632313108000629014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6632313108000629014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6632313108000629014'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/06/galielo-makes-my-life-easier.html' title='Galileo makes my life easier'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_f8qPsCVykEE/SkiYac7pR6I/AAAAAAAAAEo/kBJ597EPASo/s72-c/here.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4749553794674544837</id><published>2009-04-02T04:32:00.000-07:00</published><updated>2009-04-02T04:33:20.662-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Legacy'/><category scheme='http://www.blogger.com/atom/ns#' term='Middleware'/><title type='text'>The Middle Man</title><content type='html'>Middleware to me has been one of the most interesting as well as one of the most mysterious things.It has appealed to me like nothing else.&lt;br /&gt;Let me give an small example where middleware fits in.Suppose I have a Mainframe application which does some processing for the UI application developed.So the data has to flow from the web app to the Mainframe.Now this involves loads of things here.&lt;br /&gt;&lt;br /&gt;First of all the data which I am sending has to be secure,such that no one else can decipher that.Secondly the format in which data is understood by the Mainframe would be different from the data sent by the web app.So a special care has to be taken care for the conversion of data.In Simple words the herterogeneous worlds should unify.&lt;br /&gt;&lt;br /&gt;Now loads of middleware apps were there at the time I was involved in that .First of all whole suite provided by IBM involves MQ series as the bus.BEA has its own middleware solutions.I delved into the solution provided by Tibco in collaboration with the Mitem corporation for the data conversion between mainframe and the web app.&lt;br /&gt;&lt;br /&gt;Middleware in turn could have its own workflow management or can use general workflow management systems.Tibco used to have its own In forms of Tibco Integration Manager and Tibco Inconcert.&lt;br /&gt;&lt;br /&gt;Working on Tibco has given lots of exposure to me.Initial days definitely could not get much of it, but slowly started getting into groove.Would carry on with this&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4749553794674544837?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4749553794674544837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4749553794674544837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4749553794674544837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4749553794674544837'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/04/middle-man.html' title='The Middle Man'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-157416888604704522</id><published>2009-04-01T23:33:00.000-07:00</published><updated>2009-04-01T23:34:29.748-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Legacy'/><title type='text'>Earlier Days</title><content type='html'>These series of posts will be quite different from my earlier ones.Here  I would like to capture what I have learnt during early years as a software developer.&lt;br /&gt;First 2 and half years I have again worked  a lot on different things focusing on Java.&lt;br /&gt;I would start here with a simple web application in which I worked.It was not a simple though by any means.It had Content Management,Workflow Management,Middleware component attached to it.&lt;br /&gt;Fortunately I had a chance to work on each of these components separately along with the usual web related things,&lt;br /&gt;&lt;br /&gt;As very well known the rendering on the browser is done by html which in turn is coded in JSP.JSP or Java server pages is the technology given by Sun to code for the view part of the application.Business Logic would be written in Java that might take the form of EJB or simple POJOs.&lt;br /&gt;&lt;br /&gt;Initial days involved lot of working on JSPs.Ideally JSPs had to be lightweight which means the actual logic in the JSP should be moved to Java files wherein the JSP should only focus on the UI part.&lt;br /&gt;Several Java scripts used to be there alongwith the CSSs.I found those JSPs without retorting to any frameworks like Struts because they were written much earlier than when Struts was conceived.&lt;br /&gt;&lt;br /&gt;Later posts I would converge how the different component worked and how my learning shaped.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-157416888604704522?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/157416888604704522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=157416888604704522' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/157416888604704522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/157416888604704522'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/04/earlier-days.html' title='Earlier Days'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4079272848679358153</id><published>2009-03-31T00:30:00.001-07:00</published><updated>2009-03-31T00:30:57.365-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tests'/><title type='text'>Testing times</title><content type='html'>My tenure as coder has taught me one big lesson, i.e. to write tests for the code I write.&lt;br /&gt;This gives several advantages as I would describe later.&lt;br /&gt;&lt;br /&gt;In this post I would advocate about test driven development or TDD which would mean I write the test for the code first. The process would generally be write the test, have it failed, write the code and have it passed.&lt;br /&gt;Tests always give me the safety for my code. I can assume if I have good test written my functionality is working fine. The part of code which I have written is full proof.&lt;br /&gt;&lt;br /&gt;TDD again helps you to write your code properly, automatically helps you to refactor your code such that you fall in the patterns by serendipity&lt;br /&gt;&lt;br /&gt;In real world the common scenario is like this, the code which I am writing might take data from some outside entity, process it and then pass it to the external entity. Our endeavor should be such that my code is working fine, such that the external entities depending on me get the right data.&lt;br /&gt;&lt;br /&gt;The tests which I write are basically JUnits with the help of frameworks like JMocks which help you to give Mock objects.&lt;br /&gt;&lt;br /&gt;There are several open source code coverage tools like provided by eclemma.org which helps you to get the coverage of the code being written.&lt;br /&gt; In my view a mature developer should always go for TDD.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4079272848679358153?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4079272848679358153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4079272848679358153' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4079272848679358153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4079272848679358153'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/03/testing-times.html' title='Testing times'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-362400282212508674</id><published>2009-03-20T06:29:00.000-07:00</published><updated>2009-03-20T06:31:12.909-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Frameworks'/><title type='text'>Common Navigator</title><content type='html'>Lately my work has been involved lot in Common Navigator framework.CNF for me has been an architectural breakthrough.Screaming over decoupling gives me this poewerful weapon.&lt;br /&gt;&lt;br /&gt;Multiple content providers from different plugins can be plugged into one CNF main view and then through the help of extension points of CNF, other viewer related components like action providers,drag and drop enablement.&lt;br /&gt;&lt;br /&gt;From CNF point of view, there is one main view which gets contributions from different content providers.So first a view part has to be defined first.Then view part will get the content for different models through the help of extension points.&lt;br /&gt;Now I am trying to see if the global actions on the tool bar can be provided with respect to the click of content providers.I would update the blog if I am able to find it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-362400282212508674?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/362400282212508674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=362400282212508674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/362400282212508674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/362400282212508674'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/03/common-nabigator.html' title='Common Navigator'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-4601810630316979921</id><published>2009-03-19T03:05:00.000-07:00</published><updated>2009-03-19T03:10:30.344-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Architecture'/><title type='text'>Finite Group of Components</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_f8qPsCVykEE/ScIZsNAjYEI/AAAAAAAAAEg/bxUOW_toXN4/s1600-h/Component.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5314838757447524418" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 230px; CURSOR: hand; HEIGHT: 182px" alt="" src="http://4.bp.blogspot.com/_f8qPsCVykEE/ScIZsNAjYEI/AAAAAAAAAEg/bxUOW_toXN4/s320/Component.png" border="0" /&gt;&lt;/a&gt; Componentization or lets say a unit which can holds the power of having scalability, interoperability and portability. The unit which should be understood by my infrastructure, my developer, my user and whoever wants to peep into my world.&lt;br /&gt;&lt;br /&gt;Lets what it translates to when I say a component in Java. I would say it would be a class. A class can be scaled up i.e. by many ways like extending that class and making a subclass of that class, adding methods to that class, increasing the scope of that class.&lt;br /&gt;&lt;br /&gt;A class can be portable i.e. the class file is understood by JVM and can be run anywhere.&lt;br /&gt;A class has various modifiers for its children like it gives the modifier as public to its child when it wants other class or components to use its child or behavior.&lt;br /&gt;&lt;br /&gt;Componentization helps in decoupling. Decoupling for me is now the need of the hour, wherein my one component should be decoupled from other. That would mean development of one component should not involve change in another component.&lt;br /&gt;&lt;br /&gt;In my architectural learning through the OSGI concepts I have learnt to do things in a decoupled way. I had mistakes where I had a lot of coupling in my code. But now my one of the foremost endeavor is to decouple my code from each other.&lt;br /&gt;&lt;br /&gt;I would really dig deeper into componentization more, its real and usage and how abstraction can be achieved through componentization.&lt;br /&gt;&lt;br /&gt;How UML diagrams talk about the Componentization will be also taken later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-4601810630316979921?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/4601810630316979921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=4601810630316979921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4601810630316979921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/4601810630316979921'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/03/finite-group-of-components.html' title='Finite Group of Components'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_f8qPsCVykEE/ScIZsNAjYEI/AAAAAAAAAEg/bxUOW_toXN4/s72-c/Component.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6698871586277128432</id><published>2009-03-17T11:56:00.000-07:00</published><updated>2009-03-17T11:57:03.943-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Enterprise Apps'/><title type='text'>Enterprise is a prized one</title><content type='html'>&lt;p class="MsoNormal"&gt;Enterprise Application development is the major thing now to be done. An enterprise application needs to have loads of thing into it, like concurrency management, transaction management etc as described in my earlier posts.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now how to do develop an enterprise application. It ideally would have an user interface and a business logic to it. Now primarily these two things could have additional things like portal involvement where in the views can be seen as portlets.It could have a workflow management associated with.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;So primarily I can divide the development of the enterprise application into 3-4 discreet layers like portal, workflow, ui and business logic which in turn can have further granularity.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;My work has lately involved in working similar kind of tool. We all have wanted to work something very concise and simple to understand. I think this tool fits the bill. We used to have different tools for different layers. This amazing tool integrated all the different tool sets into one. Now other toolsets can be accessed separately as well from the integrated tool.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Wonderful thing is the architecture what amazes me, the toolsets are like plugged into the integrated toolset.So,if I have new toolset tomorrow that one can be just plugged into it with very minimal changes in the main toolset. This powerful capability can be achieved by OSGI’s bundle concept.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I think the best architecture should be the one which has got the maximum decoupling between its components.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6698871586277128432?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6698871586277128432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6698871586277128432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6698871586277128432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6698871586277128432'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/03/enterprise-is-prized-one.html' title='Enterprise is a prized one'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-9091394891408626532</id><published>2009-03-17T03:18:00.000-07:00</published><updated>2009-03-17T11:54:11.303-07:00</updated><title type='text'>Learning through Learning</title><content type='html'>Long time I have not written on this blog.&lt;br /&gt;But definitely learnt a lot during this time.Really I ventured into more and more technical ,did immense coding with apt quality.I can say I am satisfied with the kind of work I have done both online and offline.&lt;br /&gt;&lt;br /&gt;From last April my domain has been purely techinal.I learnt the notion of Model Driven architecture and emphasizing more on MVC pattern.&lt;br /&gt;&lt;br /&gt;I majorly moved from web based development to core java, where I started working on Eclipse IDE.The major architectural learning from Eclipse architecture is that it works on OSGI runtime, i.e. on the concept of bundles.&lt;br /&gt;&lt;br /&gt;Eclipse provides support for whole gamut of technologies from SWT to Graphical Editor framework, from Web tools platform (WTP) to EMF, eclipse has it all.&lt;br /&gt;&lt;br /&gt;It has been a superb learning curve.My product is based on the Eclipse IDE, we have our own build infrastructure,own deploying mechanism, separate runtime.&lt;br /&gt;My further posts will cover each learning I am getting each day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-9091394891408626532?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/9091394891408626532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=9091394891408626532' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/9091394891408626532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/9091394891408626532'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2009/03/learning-throguh-learning.html' title='Learning through Learning'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-5002454347908001596</id><published>2007-12-03T07:29:00.000-08:00</published><updated>2007-12-03T07:31:49.023-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Mind your Business please</title><content type='html'>Riding on the Spring Wave, heres the new post.&lt;br /&gt;&lt;br /&gt;Lets dive today into the Business Layer of Spring framework.Before starting let me give you the update that interface21 is now Spring source.&lt;br /&gt;&lt;br /&gt;Business means the logic which we are supposed to write to acheive our results.Spring business layer  is centered around the IoC container(a lightweight container).We have always struggled to write complex EJBs ( hey i am retrospective to the beast called EJB2.0...entity beans huh..).The IoC container  simplifies my qualms, it allows me to use POJOs to inject the enterprise level services at runtime.Here comes the concept of Dependency Injection where the main mantra is resolving the dependencies.&lt;br /&gt;&lt;br /&gt;So here i am practically eliminating the need for an application container or a server.All the enterprise level services like persistence,transaction,security,web services etc can be provided by apna IoC container.&lt;br /&gt;&lt;br /&gt;IoC container can be basically achieved by two interfaces Bean Factory and ApplicationContext.Bean Factory’s superset is the ApplicationContext, i.e. all the services provided by BeanFactory will be also provided by the ApplicationContext.But i may need BeanFactory in case i am very much worried about my memory and other resources.&lt;br /&gt;Both the containers have their specific implementations.Ifi may say POJO+Configuration is taken by the container and produces the desired result.The configuration can be provided in any thing like XML file or Property file.&lt;br /&gt;&lt;br /&gt;So my POJOs are powerful here and i am able to get my business logic through the above two things.Definely i am concerned about much things other than my business here.&lt;br /&gt;&lt;br /&gt;Lets  barge into the Persistence layer in my next post&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-5002454347908001596?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/5002454347908001596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=5002454347908001596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5002454347908001596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/5002454347908001596'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2007/12/mind-your-business-please.html' title='Mind your Business please'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-1439612067720499006</id><published>2007-10-30T11:42:00.000-07:00</published><updated>2007-10-30T11:46:52.269-07:00</updated><title type='text'>Open Source</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_f8qPsCVykEE/Ryd7ikF0CtI/AAAAAAAAABw/yUo2W1VPr-0/s1600-h/logo.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5127202534518426322" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_f8qPsCVykEE/Ryd7ikF0CtI/AAAAAAAAABw/yUo2W1VPr-0/s320/logo.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Open Source&lt;br /&gt;&lt;br /&gt;They say there is nothing free.Open source does defies that to some extent.&lt;br /&gt;Open Source revolution has taken the world by storm, since the Linux days.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Big conglomerates like IBM,Google,SAP all have understood the power of Open source and have plunged into the nitty gritties of Open Source.Open source is a huge topic and as i am actively involved into it i can talk for hours on it.&lt;br /&gt;Java has been revelation since the time it has come.Java has allowed Open Source communities like Apache,Jboss,Java.net to explore and expand and thus inspired many developers to expand their horizon.&lt;br /&gt;As my last post dwelves much into the one of the much prominent faces of Open Source, the Spring framework.It cites many such examples which are accepted worldwide now like moreover Hibernate,Apache Commons etc.Open Source app servers like Jboss,Tomcat and who can forget the open source O.S. Linux.&lt;br /&gt;So who are the people who put their feet into this amazing inruiging world of innovation.Its no one but some highly motivated individuals who love technology , who want technology as domain.As reading in some other blog ‘Code Monkeys’. These guys are not code monkeys.&lt;br /&gt;Now a days Open Source is the need of the hour.Different people have now different motives behind Open Source, but the most ironical thing is whoever with whatever motives digs into the Open source comes out as a winner.Isnt it a Strange thing?....as how there can be an entity where no one loses.Yes it is that kind of thing.Why dont you try it once.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-1439612067720499006?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/1439612067720499006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=1439612067720499006' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1439612067720499006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/1439612067720499006'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2007/10/open-source-they-say-there-is-nothing.html' title='Open Source'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_f8qPsCVykEE/Ryd7ikF0CtI/AAAAAAAAABw/yUo2W1VPr-0/s72-c/logo.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-856092880743554053.post-6272649471716301808</id><published>2007-10-28T10:54:00.000-07:00</published><updated>2007-10-28T10:55:00.788-07:00</updated><title type='text'>The Spring wave</title><content type='html'>At last thought of cheering myself up with what i am liking most.After many setbacks and sorrow&lt;br /&gt;Paths.I have decided to go for pleasure giving path.So, decided to Plunge into technical blogging other my canyoureadit.blogspot.com where i capture other spheres of life.&lt;br /&gt;Did an engineering in Computer Science, did not study at that time.I think that has become a cliche for college students now a days.But now i am trying to recover the technical things in however the way i can.&lt;br /&gt;Two of my latest passions now a days is Spring Framework and Documentum.&lt;br /&gt;Spring specially has taken me with a new wave of Spring.Spring for me has become a new way of xploring the enterprise level application architecture.It covers each and every aspect of an Enterprise based framework should cover.&lt;br /&gt;I have had the oppurtunity to read the blogs of David Risberg,listening to the presentations by the Rod Johnson.I have had the oppurtunity to interact with other Spring gurus in the Spring forum like Martin Danium,Viraj and many others.Thanks to everyone on Spring forum for helping me out.&lt;br /&gt;&lt;br /&gt;Lets Start with by defining what is a framework.A framework in layman terms means a basic structure is which is being followed by mass to construct or build some thing.It may be a set of rules.&lt;br /&gt;It is a well defined and universally followed rules.Spring similarly is a framework, which conjurers up and integrates different technologies of Java together to present an universal approach for developing enterprise based applications.&lt;br /&gt;Basically an Enterprise application is based on 3-4 things.&lt;br /&gt;&lt;br /&gt;1.Presentation Layer&lt;br /&gt;2. Business Layer&lt;br /&gt;3. Persistence Layer&lt;br /&gt;4. Database or EIS.&lt;br /&gt;Spring somehow provides its own specification or its own specified simplication to the above 3 layers.&lt;br /&gt;I will follow up later in my other posts and describe each of the layers in Spring in brief.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/856092880743554053-6272649471716301808?l=codifyit.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codifyit.blogspot.com/feeds/6272649471716301808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=856092880743554053&amp;postID=6272649471716301808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6272649471716301808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/856092880743554053/posts/default/6272649471716301808'/><link rel='alternate' type='text/html' href='http://codifyit.blogspot.com/2007/10/spring-wave.html' title='The Spring wave'/><author><name>Saurav</name><uri>http://www.blogger.com/profile/03782822163533795578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://bp0.blogger.com/_f8qPsCVykEE/R25H2HIwzLI/AAAAAAAAACc/W7P0yjlDXb8/S220/saurav.JPG'/></author><thr:total>0</thr:total></entry></feed>
