<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Accidental Patterns</title>
	<atom:link href="http://rishikdhar.com/accidentalpatterns/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://rishikdhar.com/accidentalpatterns</link>
	<description>It&#039;s Singleton, not Simpleton...dummy!</description>
	<lastBuildDate>Fri, 09 Apr 2010 18:54:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Deep Linking:Restore State of Flex Application</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=43</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=43#comments</comments>
		<pubDate>Fri, 09 Apr 2010 18:31:13 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Deep Linking]]></category>
		<category><![CDATA[Flashplayer]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Restore flex application to last view state]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=43</guid>
		<description><![CDATA[Dear Dummy Friends,
I know I have been keeping quite tight lipped for a long time and the reason for that is either I didn&#8217;t have anything to say or whatever I wanted to say was not coming out pretty well. However, when I discovered this feature I really hit myself on the head for not [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Dummy Friends,</p>
<p>I know I have been keeping quite tight lipped for a long time and the reason for that is either I didn&#8217;t have anything to say or whatever I wanted to say was not coming out pretty well. However, when I discovered this feature I really hit myself on the head for not having read the documentation thoroughly before and felt an urgent need of sharing it with you guys.</p>
<p><strong><em>Have you ever wondered why flex application couldn&#8217;t be started from the last state that user closed the browser in?</em></strong></p>
<p><span><span>Prepare to be liberated. Flex supports a feature called deep linking.</span></span></p>
<p><strong>What is deep linking?</strong></p>
<p>Deep linking is a method of making the flash application aware of the browser url and vice versa.</p>
<p>The first thing that we learn while writing flex application is that there is no need to navigate over pages in browser while using a flashplayer based applications. So, it is often miconstrued that flashplayer or the flex framework shouldn&#8217;t or doesn&#8217;t care about to providing any bridge between the state of the application and the state of the browser.</p>
<p>It is quite natural to believe that and treat it to be a constraint while developing flex applications. However, the truth is that flex framework does care about this comaptibility between the browser navigation and in-flex navigation. And you can see it by looking at the elaborate API the flex framework offers. [Article: <a href="http://cookbooks.adobe.com/post_Deep_Linking_in_Flex-9563.html">Deep Linking in Flex</a>,LiveDocs: <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=deep_linking_2.html">About Deep Linking</a>]</p>
<p><strong>Advantage</strong></p>
<p>This feature will add more of a backward compatibility for the old-school browser dependent generation that still thinks it is cool to navigate using only the back-forward buttons. I might add that I belong to that school of thought too.</p>
<p><strong>A Cool Use Case</strong></p>
<p>Apart from navigation it allows you to bookmark certain screens in a flex application. So that might actually be a cool feature to be used in application that provide <a href="http://www.scribd.com/ipaper?PHPSESSID=596ccff8637617e6c363d2dc5f73e0d9">iPaper</a> like functionality. Say you were reading a book online on Scribd or any equivalent site. And suddenly you have to leave but you don&#8217;t want to leave your computer on and would rather have it turned off. Yet you sill want to be able to come back to the same page you were reading on the eBook. The flex based eBooks can support bookmarking to give it a real life feel.</p>
<p><strong>Caution</strong></p>
<p>Restoring the state only applies to the visible part of the application not to the other hidden portions of the application. Which means there should be some extra effort put in to ensure that the browser dependent navigation can be accurately captured and that it triggers all the state restoration in the same manner as if the application was going through its normal flow.</p>
<p><strong>Before you leave!</strong></p>
<p>There are various pitfalls in using this feature, so I would recommend strongly that you read the docs thoroughly and weigh the advantages over disadvantages before you support browser navigation.</p>
<p><strong>Point to be noted</strong></p>
<p>Good application only differs from average application in terms of setting the right expectations and meeting them consistently.</p>
<p>Happy Coding!</p>
<p> <img src='http://rishikdhar.com/accidentalpatterns/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=43</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Tip: Stop CSS from getting heavy!</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=24</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=24#comments</comments>
		<pubDate>Fri, 27 Nov 2009 22:09:58 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Embedded Fonts]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Builder 3]]></category>
		<category><![CDATA[Long Compile Time]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=24</guid>
		<description><![CDATA[Remember friends, if you are using flex builder 3 and trying out various fonts for your widgets, everytime you select a font, it gets embedded into your CSS and that makes your SWF heavier. You would have noticed that with time it takes longer and longer to compile.
To get rid of this problem, ensure that [...]]]></description>
			<content:encoded><![CDATA[<p>Remember friends, if you are using flex builder 3 and trying out various fonts for your widgets, everytime you select a font, it gets embedded into your CSS and that makes your SWF heavier. You would have noticed that with time it takes longer and longer to compile.</p>
<p>To get rid of this problem, ensure that you uncheck the Embedded checkbox right next to your font selection drop down. Everytime you see it checked, just uncheck it if you don&#8217;t want the font to be embedded.</p>
<p>Usually there are standard fonts that do not require embedding and usually they suffice for most of the business UIs.</p>
<p>So, if you don&#8217;t know what you are doing to make your flex design view become slower in applying style changes, you take a look at the fonts embedded to the CSS, <strong>accidentally</strong>.</p>
<p>Have fun with Flex and keep it simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=24</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Video Stream Filtering &#8211; B&amp;W, Brightness, Contrast and More&#8230;</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=20</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=20#comments</comments>
		<pubDate>Thu, 26 Mar 2009 17:16:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[Alpha]]></category>
		<category><![CDATA[Capture]]></category>
		<category><![CDATA[Channel Filtering]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex 3.3]]></category>
		<category><![CDATA[Flex Builder 3]]></category>
		<category><![CDATA[Flex Camera]]></category>
		<category><![CDATA[RGBA]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[VideoDisplay]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=20</guid>
		<description><![CDATA[Dear Dummy Friends,
I am back with some more trivia, just in case you have been struggling with attaching a video stream to your application, capturing images, changing the color (filtering), or manipulating the results of a video stream capture, here are some tips for you.
First things that you need to know in order to begin [...]]]></description>
			<content:encoded><![CDATA[<p>Dear Dummy Friends,</p>
<p>I am back with some more trivia, just in case you have been struggling with attaching a video stream to your application, capturing images, changing the color (filtering), or manipulating the results of a video stream capture, here are some tips for you.</p>
<p>First things that you need to know in order to begin the video or image filtering are:
<ul>
<li>An image or a video can be thought of as a layer of colors (red, green, blue and opacity).</li>
<li>The layers can be transformed using Matrix Transformation (ordinary mathematics)</li>
<li>Transparency, Brightness, Contrast and Other properties if an image or a video can be handled by applying these transformations. (This is known as filtering.)</li>
</ul>
<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.webwasp.co.uk/tutorials/218/images/myColorMatrix.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 318px; height: 179px;" src="http://www.webwasp.co.uk/tutorials/218/images/myColorMatrix.gif" alt="" border="0" /></a><span style="font-weight: bold;font-size:78%;" >(Courtesy: <a href="http://www.webwasp.co.uk/tutorials/218/03.php">Tutorial</a>)</span></div>
<p>It is highly recommended that you visit the following links to know better about the concept of image processing:</p>
<ul>
<li><a href="http://www.webwasp.co.uk/tutorials/218/01.php">Image Transformation Tutorial </a></li>
<li><a href="http://www.codeproject.com/KB/GDI-plus/colormatrix.aspx">Simple Color Adjustments</a></li>
</ul>
<p>I am going to talk more about applying these transformations or filtering on Video and Images in Flex 3.3 programming.</p>
<p>Keep tuned and get yourself ready with the understanding of color matrix.</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project KENAI and Drishta</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=19</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=19#comments</comments>
		<pubDate>Thu, 19 Feb 2009 17:53:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[Collaboration Platform]]></category>
		<category><![CDATA[Drishta]]></category>
		<category><![CDATA[Kenai]]></category>
		<category><![CDATA[Open Source Products Development]]></category>
		<category><![CDATA[Social Dev Platform]]></category>
		<category><![CDATA[Sun Tech Days]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=19</guid>
		<description><![CDATA[I have just returned from the Second day of Sun Tech Days 2009, Hyderabad. In the last few hours the first thing I decided to do was to look up Project Kenai, a platform for collaborative, open source product development with a host of Social Networking features and Web 2.0 style website that looks cool [...]]]></description>
			<content:encoded><![CDATA[<p>I have just returned from the Second day of Sun Tech Days 2009, Hyderabad. In the last few hours the first thing I decided to do was to look up <a href="http://kenai.com/">Project Kenai</a>, a platform for collaborative, open source product development with a host of Social Networking features and Web 2.0 style website that looks cool and feels cool too (and I am not referring to the color blue that is the theme color for the website). There are various things that might not appear quite user friendly to a Useability expert but for a developer who is trying to build a product in collaboration with the whole community of java developers the features are just about right to get started.</p>
<p>I have registered on the website and have been granted the permission to host my own project called <a href="http://kenai.com/projects/drishta09"><span style="font-style: italic;">Drishta</span></a>. I am going to talk more about my project and the idea behind it in the following posts, but for now what I am very excited about is that I have finally decided to reignite this initiative that has been lying dormant in my TODO list for nearly a decade.</p>
<p>I have liked the idea of Kenai so far. It is simple. Straightforward. And easy to use. I would recommend giving it a fair try and making your own impression of this useful platform.</p>
<p>Keep tuned for <span style="font-style: italic;">Drishta</span>!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resource Update: GoF Design Patterns &#8211; Only notations, no text!</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=18</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=18#comments</comments>
		<pubDate>Fri, 30 Jan 2009 12:27:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Design Patterns Illustrations]]></category>
		<category><![CDATA[Gang of Four]]></category>
		<category><![CDATA[GoF]]></category>
		<category><![CDATA[OOPS]]></category>
		<category><![CDATA[Object Oriented Design]]></category>
		<category><![CDATA[Textfree Design Patterns]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=18</guid>
		<description><![CDATA[Sometimes, a picture is indeed worth a thousand words. Especially I always felt that the Design Patterns book was quite verbose and distracting in its approach. It would have been great if the examples had been a little more simplified and did not clutter the space. Also, a bit of comparative study of these patterns [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, a picture is indeed worth a thousand words. Especially I always felt that the Design Patterns book was quite verbose and distracting in its approach. It would have been great if the examples had been a little more simplified and did not clutter the space. Also, a bit of comparative study of these patterns could allow one to appreciate the subtle nuances and the differences between these patterns, which look quite alike to a newbie.</p>
<p>Finally, I struck gold when I found this link. Some old site that contains the pictorial or PepperSeed images showcasing the Design Patterns. The notations are quite similar to UML notations. And There is astoundingly no text, whatsoever!</p>
<p>I find this a very essential 5 minute referesher that the Architects should keep handy for reference, whenever a moment of uncertainty, while designing a complex application, renders them actionless.</p>
<p>This is the link to the site. <a href="http://www.tml.tkk.fi/%7Epnr/GoF-models/html/">Gang of Four Design Patterns</a></p>
<p>Here is a sample of Adapter Pattern and Bridge Pattern, when placed side by side once can see the subtle difference so clearly, and without any textual clutter around it.</p>
<div style="text-align: center;"><span style="font-size:180%;">Adapter Pattern</span></div>
<p>
<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_6nPRzI2len0/SYL6CaYvJKI/AAAAAAAAACA/Nky7-6IB_iM/s1600-h/Adaptor_Pattern.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 185px;" src="http://1.bp.blogspot.com/_6nPRzI2len0/SYL6CaYvJKI/AAAAAAAAACA/Nky7-6IB_iM/s400/Adaptor_Pattern.gif" alt="" id="BLOGGER_PHOTO_ID_5297071031090881698" border="0" /></a></div>
<p><span style="font-size:180%;"><br /></span><br /><span style="font-size:180%;"></p>
<p></span>
<div style="text-align: center;"><span style="font-size:180%;">Bridge Pattern</span></div>
<p>
<div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_6nPRzI2len0/SYL6QvL9D7I/AAAAAAAAACI/MqDnmHGEq80/s1600-h/Bridge_Pattern.gif"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 197px;" src="http://4.bp.blogspot.com/_6nPRzI2len0/SYL6QvL9D7I/AAAAAAAAACI/MqDnmHGEq80/s400/Bridge_Pattern.gif" alt="" id="BLOGGER_PHOTO_ID_5297071277192581042" border="0" /></a></div>
<p>I hope you appreciate the essence of text less GoF Design Patterns!</p>
<p>P.S. The images were stolen from <a href="http://www.tml.tkk.fi/%7Epnr/GoF-models/html/">Gang of Four Design Patterns</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=18</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulky Data Transfer with Single Hit vs Light Data Transfer with Multiple Hits</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=17</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=17#comments</comments>
		<pubDate>Mon, 24 Nov 2008 08:35:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Asynchronous Application]]></category>
		<category><![CDATA[Bulky Data]]></category>
		<category><![CDATA[Front End Back End Conversation]]></category>
		<category><![CDATA[Multiple Requests]]></category>
		<category><![CDATA[Single Fetch vs. Multiple Fetch]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=17</guid>
		<description><![CDATA[This is a classic dilemma. What is a better model for browser based clients and back-end services to interact? Should there be as little dialogue as possible with maximum data transfer or as much dialogue as possible with minimum data transfer in each exchange of request-response. The problem is not as simple to solve as [...]]]></description>
			<content:encoded><![CDATA[<p>This is a classic dilemma. What is a better model for browser based clients and back-end services to interact? Should there be as little dialogue as possible with maximum data transfer or as much dialogue as possible with minimum data transfer in each exchange of request-response. The problem is not as simple to solve as the problem statement makes it sound.</p>
<p>There are various parameters that need to be considered for answering this question. And the solution varies as per the requirements.</p>
<p>Let&#8217;s start with considering a revolutionary example: Gmail!</p>
<p>As we are aware, Google employed the AJAX philosophy and created the first ever AJAX based email application that changed the paradigm of web mails, by increasing the performance of reading, composing and sending emails over the internet. The browsers were same as before, the bandwidth was the same but the application architecture had changed drastically, making more possible with the same set of resources.</p>
<p>However, it was not just about using a new technology but identifying the appropriate problem that this technology could solve. In an email type web application, a user generally performs units of tasks with every click.
<ul>
<li>Open a mail for reading, </li>
<li>Compose a mail/reply, </li>
<li>Add / Remove the attachments and</li>
<li>Send the mail. </li>
</ul>
<p>It never happens that a user is reading a mail that is being modified by the sender simultaneously. So, there is no real time change in an email&#8217;s content.</p>
<p>If at all there is a modification required to the content of an email that was already sent/delivered, one needs to re-send the mail with the modifications. In this scenario, fetching each mail&#8217;s content as and when the header of the mail is clicked makes sense, and doing it asynchronously (i.e. without refreshing the whole page) makes the usability far more intuitive and elegant.</p>
<p>On the other hand, is an application that shows data that is highly likely to be modified at the same time when a user is viewing the information, such a model of conversation may not really work.</p>
<p>Say, you have an application that displays data in the grid where rows and columns are collapsible and contain levels of information (something like a hierarchical data set). See the example.</p>
<p>The grid&#8217;s cells don&#8217;t enjoy absolute independence from the other rows and columns of data surrounding it. In other words, each cell of information is not just an atomic information in itself, but also forms a part of the information that is at a level higher than it. For instance, Physical Supply of 100 could mean there is a PO of 50, POK of 30 and TO of 20, which are all displayed as the child levels of Physical Supply. Now, in case there was a new PO of 20 created by some user, while the data mentioned above is on display in the SCP, by showing an additional 20 for PO i.e. PO of 70 would not be enough to represent the actual state of Supply Chain because, the sum of quantities for different Documents (70+30+20 = 120) would be incosistent with the total being shown for the Physical Supply (50+30+20 = 100).</p>
<p>With this problem at hand the requirement would be to update all the cells in the row and column that contain the modified cell, as part of calculating the summary for that row and column respectively. This requirement in turn requires us to keep a track of all the cells in the grid because the probability of any cell getting modified at any given time is almost equal, therefore any row and column could be required to be refreshed with the latest data.</p>
<p>Essentially, each cell update leads to an update of almost all the cells in that section (sections here refer to the parent rows viz. Demand, Suppply, Recommendations etc.) We could therefore limit the updates of a cell leading to the update of just the section in which it lies. This in turn would lead to a different kind of inconsistency. For instnace, a Demand of 30 and a Supply or 20 leads to a Recommendation of 10 and a Projected Inventory of -10. This means that even the sections within the SCP grid are interdependent therefore any cell that has to show updated data, would require all the other cells in the grid to update the data, directly or indirectly.</p>
<p>So, it is pretty clear that the data in the entire grid has to be treated as a whole in order to view a consistent information in the Supply Chain Profile at any given time. The rendering of data, however, doesn&#8217;t need to happen in a single shot because like viewing a section or a particular row or column or a cell in particular, is quite similar to checking one&#8217;s inbox for a specific email. And once that email is located, all one cares about is reading the information within. Similarly, a user will only follow a single path for drilling down information about the SCP at any given time. This in turn leads to a simple requirement of rendering data (cells, rows, columns) only for the particular paths.</p>
<p>The conclusion or the solution for our problem is to fetch the entire data in a Single Hit to the server, and then use selective and efficient rendering of the data based on where user clicks on the UI. We can and have tried to make the cell specific information (which is shown in the pop-ups) asynchronous, but that leads to holding the state of the data object that was transported to the client earlier. This leads to additional memory and state management requirements on the back end. Therefore, we chose to send the information in a bulk to the front end. This might be slightly slower but it represents the state of SCP accurately and consistently always and everytime.<br />
<input id="gwProxy" type="hidden"><!--Session data--><br />
<input onclick="jsCall();" id="jsProxy" type="hidden">
<div id="refHTML"></div>
<input id="gwProxy" type="hidden"><!--Session data--><br />
<input onclick="jsCall();" id="jsProxy" type="hidden">
<div id="refHTML"></div>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calendar getDisplayName() JDK 6.0 vs JDK 1.5.0</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=16</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=16#comments</comments>
		<pubDate>Wed, 05 Nov 2008 09:40:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Incompatibility]]></category>
		<category><![CDATA[JDK 1.5.0]]></category>
		<category><![CDATA[JDK 1.5.0 vs JDK 6.0]]></category>
		<category><![CDATA[JDK 5.0 vs JDK 6.0]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Version]]></category>
		<category><![CDATA[getDisplayName]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=16</guid>
		<description><![CDATA[If you have somehow used jdk6.0 while developing your application that uses Calendar API of java.util.Calendar, and have used getDisplayName method to extract the display names for fields of the calendar, specific to your desired style and locale, and then had to compile your application with jdk1.5.0 only to realize that compiler spits swear words [...]]]></description>
			<content:encoded><![CDATA[<p>If you have somehow used jdk6.0 while developing your application that uses <tt>Calendar</tt> API of <tt>java.util.Calendar</tt>, and have used <tt>getDisplayName</tt> method to extract the display names for fields of the calendar, specific to your desired style and locale, and then had to compile your application with jdk1.5.0 only to realize that compiler spits swear words at you&#8230;Here is quick fix for you!</p>
<p>This is what you did in jdk6.0:<br /><code><br />//get your application locale<br />Locale userLocale = getContext().getLocale();</p>
<p>//define a calendar<br />Calendar calendarInstance = Calendar.getInstance();</p>
<p>//Extract the month name in SHORT format (viz. "Jan","Feb" etc.) for the context locale.<br />calendarInstance.getDisplayName(calendarInstance.get(Calendar.MONTH),Calendar.SHORT,userLocale);<br /></code></p>
<p>Here is what you can do to achieve the same <tt>getDisplayName</tt> functionality in jdk 5.0:<br /><code><br />//import the following class<br />import java.text.DateFormatSymbols;</p>
<p>//declare variable.<br />DateFormatSymbols dateFormatSymbols = new DateFormatSymbols();</p>
<p>//Get the short names for months in a Calendar<br />String[] months = dateFormatSymbols.getShortMonths();</p>
<p>//Use the month field of Calendar to fetch the short name of month for cell label.<br />months[calendarInstance.get(Calendar.MONTH)];</p>
<p></code></p>
<p>Once you acquire the SHORT name for the field, you can use it for your labels, or column headers etc. based on where you require it.</p>
<p>Ideally, you shouldn&#8217;t have to fall back on the previous version of jdk, yet sometimes the project requirements can&#8217;t be altered even for better things in life.</p>
<p>Hope this tip helps!</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=16</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Builder 3 &#8211; LiveCycle Data Services &#8211; Libs</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=15</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=15#comments</comments>
		<pubDate>Wed, 23 Apr 2008 05:36:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[1172]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Builder 3]]></category>
		<category><![CDATA[Flex fo Dummies]]></category>
		<category><![CDATA[LCDS]]></category>
		<category><![CDATA[Live Cycle Data Services]]></category>
		<category><![CDATA[flex/libs]]></category>
		<category><![CDATA[mx.data:IManaged]]></category>
		<category><![CDATA[mx.data:Managed]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=15</guid>
		<description><![CDATA[I would never have been writing this post in addition to so many others that are already there talking about how to build, compile, deploy, run your flex applications that use Live Cycle Data Service, had I not spent last five days trying to figure out why my application wouldn&#8217;t compile when I was following [...]]]></description>
			<content:encoded><![CDATA[<p>I would never have been writing this post in addition to so many others that are already there talking about how to build, compile, deploy, run your flex applications that use Live Cycle Data Service, had I not spent last five days trying to figure out why my application wouldn&#8217;t compile when I was following all the steps mentioned everywhere.</p>
<p>I might be dumb for not having known something that was obvious; that one must know in order to build applications in flex, so I concede. However, there might be my other dumb brethren out there who might be struggling with the same things, so this one is for you fellas!</p>
<p>After migrating the flex app that was built on Flex Builder 2 by my associate, some time last year, around October/November, I was facing a few issues in getting the application to compile.</p>
<p>Some of the errors were as follows:</p>
<p>Type 1:<br />1172: Definition mx.data.utils:Managed could not be found.<br />or<br />1172: Definition mx.data:IManaged could not be found.</p>
<p>Type 2:<br />Unable to resolve resource bundle &#8220;data&#8221; for locale &#8220;en_US&#8221;.</p>
<p>Now first of all when you start Googling, you  come across the following links (that are relevant):
<p class="MsoNormal"><span style=";font-family:Arial;font-size:78%;color:black;"   ><span style=";font-family:Arial;font-size:9;color:black;"   ><a title="http://bugs.adobe.com/jira/browse/ASC-2815" href="http://bugs.adobe.com/jira/browse/ASC-2815"><span class="Hyperlink2" title="http://bugs.adobe.com/jira/browse/ASC-2815"><u title="http://bugs.adobe.com/jira/browse/ASC-2815"><span title="http://bugs.adobe.com/jira/browse/ASC-2815"  style="color:blue;">http://bugs.adobe.com/jira/browse/ASC-2815</span></u></span></a><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style=";font-family:Arial;font-size:78%;color:black;"   ><span style=";font-family:Arial;font-size:9;color:black;"   ><a title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38973.html" href="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38973.html"><span class="Hyperlink2" title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38973.html"><u title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38973.html"><span title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38973.html"  style="color:blue;">http://www.mail-archive.com/flexcoders@yahoogroups.com/msg38973.html</span></u></span></a><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style=";font-family:Arial;font-size:78%;color:black;"   ><span style=";font-family:Arial;font-size:9;color:black;"   ><a title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg66002.html" href="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg66002.html"><span class="Hyperlink2" title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg66002.html"><u title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg66002.html"><span title="http://www.mail-archive.com/flexcoders@yahoogroups.com/msg66002.html"  style="color:blue;">http://www.mail-archive.com/flexcoders@yahoogroups.com/msg66002.html</span></u></span></a><o:p></o:p></span></span></p>
<p>And even though these have been written with the intention to help out the newbies in the flex world, they don&#8217;t really shed light on what might be the cause of this problem and/or how to fix it. The problem is indeed far simpler than the complicated discussions on the &#8220;Known Issues&#8221; and &#8220;Hot Fixes&#8221;.</p>
<p>All I need to know is, where is that goddamn <span style="font-style: italic;">missing library</span> that I could include in my build path to resolve these issues.</p>
<p>If you have been following the instructions elsewhere, you probably already have gone through all the treacheries that I have gone through so you can relate to the frustration I am talking out of.</p>
<p>Well having said and done all that I have, here is what you need to do in order to get those libraries into your classpath.</p>
<p>The location where you installed your Live Cycle Data Services, let&#8217;s call it [lcds-install-path].</p>
<p>Under [lcds-install-path] you will find a war file called <span style="font-weight: bold;">samples.war</span>.  If you can&#8217;t see it, download the Data Services afresh from an <a href="http://labs.adobe.com/wiki/index.php/LiveCycle_Data_Services#Downloads">authentic source</a> and install it.</p>
<p>Now the reason I referred to this <span style="font-weight: bold;">samples</span> guy was because I wanted to make sure if anybody had ever tried to accomplish what I had set out for with the Flex SDK3.0 and Data Services. (I realized later that what I was trying to do was not something that was rarely used, but something that is used so often that it is taken for granted that people who can&#8217;t get it right, like me, are just too dumb to work on Flex Applications.)</p>
<p>Procedure for alleviation:
<ol>
<li>Create the following directory [lcds-install-path]/flex/libs</li>
<li>Create the following directory [lcds-install-path]/flex/locale</li>
<li>Create the following directory [lcds-install-path]/flex/jars **</li>
<li>Expand or explode (suit yourself) [lcds-install-path] /samples.war to [lcds-install-path]/samples</li>
<li>Go to [lcds-install-path]/samples/WEB-INF/flex/libs and copy everything.</li>
<li>Paste the files copied into [lcds-install-path]/flex/libs</li>
<li>Go to [lcds-install-path]/samples/WEB-INF/flex/locale and copy everything.</li>
<li>Past the files copied into [lcds-install-path]/flex/locale</li>
<li>Go to [lcds-install-path]/samples/WEB-INF/flex/jars and copy everything. **</li>
<li>Past the files copied into [lcds-install-path]/flex/jars **</li>
<li>Go to flex builder, and edit the build-path.</li>
<li>Add [lcds-install-path]/flex/libs as an SWC folder.</li>
<li>Add [lcds-install-path]/flex/locale as an SWC folder.</li>
<li>Add [lcds-install-path]/flex/locale/en_US/fds_rb.swc as an SWC</li>
<li>And now your application should compile!</li>
</ol>
<p>** &#8211; optional for now, may be needed for something in future, who knows?</p>
<p>If this doesn&#8217;t work still, you need to take a break and hire someone smarter to help you out.</p>
<p>The reason I copied all the files to a custom location was that it will keep me aware of where I need to make changes in future and also might give some hint to Adobe Team to include a separate folder in the LCDS distribution that contains all the mandatory libraries.</p>
<p>Hope that help you my dumb-friends. If it doesn&#8217;t you can mail me at remotemethod@gmail.com and I will try to help you out with some more &#8220;Flex for Dummies&#8221; tips if I can.</p>
<p>Here are some related links that might help:<br />http://www.adobe.com/devnet/coldfusion/articles/data_app.html</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=15</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Pitfalls In Java Development and More</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=14</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=14#comments</comments>
		<pubDate>Wed, 16 Apr 2008 08:35:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=14</guid>
		<description><![CDATA[Hi guys, here is a super cool blog recently launched by my friends and colleagues at Pramati.
 http://pitfalls.wordpress.com
The blog is named as Pitfalls in Java Development, but it doesn&#8217;t limit the content or the description to just the pitfalls; there are amazingly new and refreshing facts about Java Technology and all its associated open source [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys, here is a super cool blog recently launched by my friends and colleagues at Pramati.</p>
<p> http://pitfalls.wordpress.com</p>
<p>The blog is named as Pitfalls in Java Development, but it doesn&#8217;t limit the content or the description to just the pitfalls; there are amazingly new and refreshing facts about Java Technology and all its associated open source technologies.</p>
<p>You will also find quite a few interesting debates on DOs and NOT TO DOs in the Application Development world of Open Source and Java/J2EE. All of the authors on the blog are experts in their respective domains and technologies and share the most recent issues they encounter while working on their current assignments.</p>
<p>In less than two weeks since it was launched, it has reached a hit count of 3000 approx. Which in itself is an indication of how techies about the value of information shared by this blog. And to those of you for whom it matters, the CTO at Spring Source <a href="http://www.springsource.com/" rel="external nofollow">Adrian Colyer</a>   has already commented on one of the posts on this blog.</p>
<p>I am sure you are going to learn a lot from this single link. So check it out now!</p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=14</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript 2.0 &#8211; A New Avatar</title>
		<link>http://rishikdhar.com/accidentalpatterns/?p=10</link>
		<comments>http://rishikdhar.com/accidentalpatterns/?p=10#comments</comments>
		<pubDate>Sat, 23 Jun 2007 16:02:00 +0000</pubDate>
		<dc:creator>rishikdhar</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript 2.0]]></category>
		<category><![CDATA[Object Oriented JavaScript]]></category>
		<category><![CDATA[Rich Internet Applications]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://rishikdhar.com/accidentalpatterns/?p=10</guid>
		<description><![CDATA[Java Script for objects: Brought to you by ECMA.
Now this is something that was pending for a long time now. Twelve years since the birth of JavaScript and no major or minor updates to the language. Imagine how much of value it must have offered to the entire web developer community to have survived in [...]]]></description>
			<content:encoded><![CDATA[<p>Java Script for objects: Brought to you by ECMA.</p>
<p>Now this is something that was pending for a long time now. Twelve years since the birth of JavaScript and no major or minor updates to the language. Imagine how much of value it must have offered to the entire web developer community to have survived in the software world without changing for twelve years.</p>
<p>As the creator of JavaScript and currently the CTO of Mozilla Foundation , Brendan Eich said,&#8221;It is not a revolution, just an evolution of existing capabilities.&#8221;  It sure has been long due now. Especially, with the AJAX and Web2.0 taking WWW to a different paradigm altogether. Making it essential that the foundation of the new web be stronger and reinforced with as much steel as possible.</p>
<p>I would be looking forward to see how it evolves. The primary challenges would be to keep it as simple as it has been and still provide an OO environment for building RIA.</p>
<p>Packaging and scoping are some of the mandatory requirements for the JavaScript 2.0 to  keep it rolling.  And another challenge is the ascertain that the JavaScript loaded on the browser is not a security risk for the computer, because the internet browsers, as we know them today, don&#8217;t provide proper sandbox environment  like a JVMs do.</p>
<p>There is a lot that would be expected out JS2.0 and I am sure, like before, it is going to deliver.</p>
<p>You can track the progress of JavaScript 2.0 or as the project Code name says ECMAScript from this link. <a href="http://www.ecmascript-lang.org/">ECMAScript</a></p>
]]></content:encoded>
			<wfw:commentRss>http://rishikdhar.com/accidentalpatterns/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
