<?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-28715187</id><updated>2012-02-15T23:20:18.402-08:00</updated><title type='text'>@Age XXXIV</title><subtitle type='html'>&lt;pre&gt;
GET /thoughts HTTP/1.1
Host: Sriki
&lt;/pre&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28715187.post-1299699037532889364</id><published>2012-02-06T02:38:00.000-08:00</published><updated>2012-02-06T02:38:43.831-08:00</updated><title type='text'>Analytical Reasoning With Prolog</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Last year, I solved the following analytical reasoning problem by hand. Post learning Prolog, I think this is a good problem to solve using a computer! I had a interesting experience doing so.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;u&gt;Facts:&lt;/u&gt;&lt;/div&gt;&lt;div&gt;1: There are 5 &lt;span class="il"&gt;villas&lt;/span&gt; in 5 different colors&amp;nbsp;&lt;/div&gt;&lt;div&gt;2: In each villa lives a person with a different nationality.&amp;nbsp;&lt;/div&gt;&lt;div&gt;3: These 5 owners drink a certain beverage, smoke a certain brand of cigar and keep a certain pet.&amp;nbsp;&lt;/div&gt;&lt;div&gt;4: No owner has the same pet, smoke the same brand of cigar or drink the same drink.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;Hints:&lt;/u&gt;&lt;/div&gt;&lt;div&gt;1: The British lives in a red villa.&amp;nbsp;&lt;/div&gt;&lt;div&gt;2: The Swede keeps dogs as pets&amp;nbsp;&lt;/div&gt;&lt;div&gt;3: The Dane drinks tea&amp;nbsp;&lt;/div&gt;&lt;div&gt;4: The green villa is on the left of the white villa (it also means they are next door to each other)&amp;nbsp;&lt;/div&gt;&lt;div&gt;5: The green villa owner drinks coffee&amp;nbsp;&lt;/div&gt;&lt;div&gt;6: The person who smokes Pall Mall rears birds&amp;nbsp;&lt;/div&gt;&lt;div&gt;7: The owner of the yellow villa smokes Dunhill&amp;nbsp;&lt;/div&gt;&lt;div&gt;8: The man living in the villa right in the center drinks milk&amp;nbsp;&lt;/div&gt;&lt;div&gt;9: The Norwegian lives in the first villa&amp;nbsp;&lt;/div&gt;&lt;div&gt;10: The man who smokes Blend lives next to the one who keeps cats&amp;nbsp;&lt;/div&gt;&lt;div&gt;11: The man who keeps horses lives next to the man who smokes Dunhill&amp;nbsp;&lt;/div&gt;&lt;div&gt;12: The owner who smokes Blue Master drinks beer&amp;nbsp;&lt;/div&gt;&lt;div&gt;13: The German smokes Prince&amp;nbsp;&lt;/div&gt;&lt;div&gt;14: The Norwegian lives next to the blue villa&amp;nbsp;&lt;/div&gt;&lt;div&gt;15: The man who smokes Blend has a neighbor who drinks water.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i style="background-color: white;"&gt;&lt;span style="color: blue;"&gt;The question is: who keeps the fish?&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Prolog Solution:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The following is what i could come up with after serval iterations through code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;script src="http://gist.github.com/1751301.js?file=5villas.prolog"&gt;&lt;/script&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Answer to Puzzle:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Following is the output of the prolog program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;1,norwegian,yellow,water,dunhill,cat&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;2,dane,blue,tea,blend,horse&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;3,british,red,milk,pallmall,birds&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;4,german,green,coffee,prince,fish&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;5,swede,white,beer,bluemaster,dog&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hence the answer is &lt;span style="color: blue;"&gt;&lt;i&gt;German keeps the fish&lt;/i&gt;&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&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/28715187-1299699037532889364?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/1299699037532889364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=1299699037532889364' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1299699037532889364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1299699037532889364'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2012/02/analytical-reasoning-with-prolog.html' title='Analytical Reasoning With Prolog'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-2198445657618451809</id><published>2011-12-26T03:34:00.000-08:00</published><updated>2011-12-27T08:33:58.728-08:00</updated><title type='text'>C#: Timer, Deferred Evaluation &amp; GC</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div style="text-align: left;"&gt;Following is the snippet of benign (at least by appearance) code that had been cause one of the bugs we faced recently.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;script src="http://gist.github.com/1520952.js?file=TimerDeferredEval.cs"&gt;&lt;/script&gt;The class schedules the given jobs on a timer. The start time for the jobs is around 10 hours from the point the scheduler &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Start&lt;/span&gt; is executed. The timer fires every 24 hrs periodically.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;i&gt;As unexpected, the timer never fired, not even once in production.&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;We did not face any issue related to this code in development environment, the only difference was that the delay time and period for the timer were shorter in the unit test.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Key suspect in such code behavior is GC. GC has high&amp;nbsp;probability&amp;nbsp;of execution in a long running process than a short running unit test.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;The issue was indeed GC, the timer was being garbage collected hence the timer callback was not being executed.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;Here is the detailed analysis of the code.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&amp;nbsp;The &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Loc 1&lt;/span&gt; in the code is a &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Select&lt;/span&gt;&lt;span style="font-family: inherit;"&gt;&amp;nbsp;&lt;/span&gt;expression which is implemented &amp;nbsp;by deferred execution.&lt;/li&gt;&lt;li&gt;&amp;nbsp;The&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; Loc 2&lt;/span&gt; in the code exists to ensure the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Select&lt;/span&gt;&lt;span style="font-family: inherit;"&gt; &lt;/span&gt;is executed and timer is created/scheduled.&lt;/li&gt;&lt;li&gt;&amp;nbsp;The key issue with the code is &lt;b&gt;&lt;i&gt;no reference&lt;/i&gt;&lt;/b&gt; to the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Timer&lt;/span&gt; object created is retained. &amp;nbsp;Hence, the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Timer&lt;/span&gt; object is garbage collected.&lt;/li&gt;&lt;li&gt;Even though the&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; Loc 1&lt;/span&gt; seems to indicate that the reference to the Timer is assigned to the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_timers&lt;/span&gt; field, it's not so. The &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_timers&lt;/span&gt; field holds the reference to the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Select&lt;/span&gt; iterator. In other words, the lambda code itself.&lt;/li&gt;&lt;/ul&gt;&lt;blockquote class="tr_bq"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;GetType()&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; on _timers &lt;/span&gt;&lt;span style="font-family: inherit;"&gt;will return&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;System.Linq.Enumerable+WhereSelectListIterator`2 [System.Threading.TimerCallback,System.Threading.Timer]&lt;/span&gt;&lt;/blockquote&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;If the timer is garbage collected, what is the observed behavior in the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Dispose&lt;/span&gt;&lt;span style="font-family: inherit;"&gt; &lt;/span&gt;method of the&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;JobScheduler&lt;/span&gt;&amp;nbsp;?&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote class="tr_bq"&gt;The &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;foreach&lt;/span&gt;&lt;span style="font-family: inherit;"&gt; &lt;/span&gt;loop actually creates new timers as a result of &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Select&lt;/span&gt;&lt;span style="font-family: inherit;"&gt; &lt;/span&gt;execution again and disposes them.&amp;nbsp;&lt;/blockquote&gt;&lt;ul style="text-align: left;"&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;So the current situation with the code is&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Timer&lt;/span&gt;&amp;nbsp;will not be fired if the GC runs.&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Timer&lt;/span&gt; created will never be stopped by &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Dispose&lt;/span&gt;&lt;span style="font-family: inherit;"&gt; &lt;/span&gt;if the GC does not collect it.&lt;/li&gt;&lt;/ul&gt;The solution is to convert the output of the &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Select&lt;/span&gt; iterator using &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;toList()&lt;/span&gt;or an equivalent method&amp;nbsp;. This method not only forces eager evaluation but also creates a proper enumerable list of &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;Timer&lt;/span&gt; objects -&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;System.Collections.Generic.List`1[System.Threading.Timer]&lt;/span&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;This is the &lt;a href="http://gist.github.com/1520952" target="_blank"&gt;Gist&lt;/a&gt;&amp;nbsp;of the the complete program to observe the issue/code behavior.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&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/28715187-2198445657618451809?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/2198445657618451809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=2198445657618451809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/2198445657618451809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/2198445657618451809'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2011/12/c-timer-deferred-evaluation-gc.html' title='C#: Timer, Deferred Evaluation &amp; GC'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-3865826283298902684</id><published>2011-12-11T08:27:00.001-08:00</published><updated>2011-12-17T21:32:30.770-08:00</updated><title type='text'>Prolog: List Difference</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Today I was implementing a Prolog program to find the difference between two lists.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the problem statement and the expected output.&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus([1,2,3,4],[1,3],W).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;W=[2,4]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;yes&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a beginner in Prolog, I tend use the &lt;i&gt;accumulator&lt;/i&gt; based approach to find the solution. Here is what I came up with spending some significant time at the Prolog interpreter and debugger.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minusAcc(L,[],_,L) :- !.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minusAcc([],_,A,A) :- !.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minusAcc([H|T],SL,A,W) :- \+memberchk(H,SL),!,&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&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; append([H],A,AL),&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&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; minusAcc(T,SL,AL,W).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minusAcc([_|T],SL,A,W) :- minusAcc(T,SL,A,W).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus(L,SL,W) :- minusAcc(L,SL,[],W).&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This program gives the expected output but does not preserve the order. It actually gives the output in the reverse order because of the inherent recursion in the program. &amp;nbsp;Following is output generated by this program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus([1,2,3,4],[1,3],W).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;W=[4,2]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;yes&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since, I wrote this routine for use in list sorting, the order did not matter and I decided to live with this program.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Meanwhile, I had a look at the implementation available on the web for the same purpose and I found the following program on &lt;a href="http://stackoverflow.com/questions/1523172/prolog-list-difference-routine" target="_blank"&gt;stackoverflow&lt;/a&gt; very interesting.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus(L,[],L) :- !.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus([],_,[]) :- !.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus([H|T],SL,W) :- memberchk(H,SL),!,minus(T,SL,W).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;minus([H|T1],SL,[H|T2]) :- minus(T1,SL,T2).&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This program gives the expected output and preserves the order too. This program also uses the classic accumulator (unlike mine) based approach, but here the result itself is the accumulator. I had to trace it on debugger for about 10 mins (this is my 2nd day on prolog) to understand the control flow. It was totally worth it!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Gem of a program! Made my weekend!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;BTW, here is the &lt;a href="https://gist.github.com/1455663" target="_blank"&gt;gist &lt;/a&gt;of my Day 2 of Prolog using &lt;a href="http://pragprog.com/book/btlang/seven-languages-in-seven-weeks" target="_blank"&gt;Seven Languages in Seven Weeks&lt;/a&gt;!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&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/28715187-3865826283298902684?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/3865826283298902684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=3865826283298902684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/3865826283298902684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/3865826283298902684'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2011/12/prolog-list-difference.html' title='Prolog: List Difference'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-2539709017672737485</id><published>2011-11-13T05:03:00.000-08:00</published><updated>2011-11-13T05:21:46.514-08:00</updated><title type='text'>Installing Io on Snow Leopard</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Started on &lt;a href="http://pragprog.com/book/btlang/seven-languages-in-seven-weeks" target="_blank"&gt;Seven Languages in Seven Weeks&lt;/a&gt;&amp;nbsp;. Interesting set of 7 languages. Y'day reached Io - Day One. Had to do some googling around to get Io working on OS X.&lt;br /&gt;&lt;br /&gt;In case you intend to do the same, here is the gist of the steps required to get going&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;/div&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;Download Io source from git-repo&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sudo git clone git://github.com/stevedekorte/io.git&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;ul&gt;&lt;li style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Next step is to run the &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;build.sh&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt; file in the cloned git &amp;nbsp;io directory. You might get the following error&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;~/software/io/libs/iovm/source/IoObject_inline.h:322: error: ‘always_inline’ function could not be inlined in call to ‘IoObject_rawGetSlot_’: recursive inlining&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;You need to modify the file &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;~/software/io/libs/basekit/source/Common_inline.h&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;change&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#define NS_INLINE static __inline__ __attribute__((always_inline))&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;in the section&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#if defined(__APPLE__) &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;to&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#define NS_INLINE static inline&lt;/span&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Now run the&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;build.sh&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;file again. &amp;nbsp;Io binary will be ready for use!&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Here is the Vim plugin for Io:&amp;nbsp;&lt;a href="http://www.vim.org/scripts/script.php?script_id=2116"&gt;http://www.vim.org/scripts/script.php?script_id=2116&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&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/28715187-2539709017672737485?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/2539709017672737485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=2539709017672737485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/2539709017672737485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/2539709017672737485'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2011/11/installing-io-on-snow-leopard.html' title='Installing Io on Snow Leopard'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-1318015788197384334</id><published>2011-04-15T04:16:00.000-07:00</published><updated>2011-04-15T04:54:39.074-07:00</updated><title type='text'>Trying REBOL</title><content type='html'>&lt;a href="http://www.rebol.com/"&gt;REBOL&lt;/a&gt; was the language I wanted to explore. Today I thought of writing a timezone converter application using REBOL.&lt;br /&gt;&lt;br /&gt;The application  should be able to convert time from Indian timezone to Munich and Boston timezone. This conversion is related to my current project.&lt;br /&gt;&lt;br /&gt;With this weird requirement, I decided to use the most weird way to convert time. I decided to use the &lt;a href="http://www.timeanddate.com/worldclock/converter.html"&gt;timeanddate.com timezone converter&lt;/a&gt; to do the conversion. As a result, the application has to make an &lt;code&gt;HTTP GET&lt;/code&gt; call to this link and parse the resulting web page to find the converted time.&lt;br /&gt;&lt;br /&gt;Summarizing the Approach:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Write a REBOL UI application that takes the Indian time as input&lt;/li&gt;&lt;li&gt;On click of &lt;code&gt;Convert&lt;/code&gt;, makes an &lt;code&gt;HTTP&lt;/code&gt; call to the website with input given by the user.&lt;/li&gt;&lt;li&gt;Parse the resulting web page and find the converted time.&lt;/li&gt;&lt;li&gt;Show the converted time on the UI !!&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Here is the REBOL code for the application.&lt;br /&gt;&lt;pre&gt;This is a REBOL code for timezone convertor&lt;br /&gt;&lt;br /&gt;REBOL&lt;br /&gt;[&lt;br /&gt;Title: "Timezone Convertor IN to BOS &amp;amp; MUN"&lt;br /&gt; Author: "Srikanth Seshadri" &lt;br /&gt;]&lt;br /&gt;&lt;br /&gt;t-time: to-string now/time&lt;br /&gt;&lt;br /&gt;time-get: func [inp-time tz] [&lt;br /&gt;page: reform [&lt;br /&gt;"http://www.timeanddate.com/worldclock/converted.html?hour="inp-time/hour"&amp;amp;min="inp-time/minute"&amp;amp;sec="inp-time/second"&amp;amp;p1=438&amp;amp;p2="tz]&lt;br /&gt;tzurl: to-url page&lt;br /&gt;tz-text: load/markup tzurl&lt;br /&gt;zone-found: false tg-time: now&lt;br /&gt;foreach item tz-text [&lt;br /&gt;if all [string? item zone-found ] [ tg-time: item  break]&lt;br /&gt;if all [string? item any[ find item "(U.S.A" find item "(Germ"] ]  [zone-found: true]&lt;br /&gt;]&lt;br /&gt;tg-time&lt;br /&gt;]&lt;br /&gt;&lt;br /&gt;gui: layout [&lt;br /&gt;backdrop effect [gradient 0x1 white]&lt;br /&gt;across&lt;br /&gt;h3 "Timezone Converter IN -&amp;gt; BOS &amp;amp; MUN" black return&lt;br /&gt;lab "Indian Time"&lt;br /&gt;t-time: field t-time 60x24 return&lt;br /&gt;tab&lt;br /&gt;button "Convert Time" [&lt;br /&gt;inp-time: (to-time t-time/text)&lt;br /&gt;if inp-time&lt;br /&gt;[&lt;br /&gt; boslbl/text: reform ["Time in Boston: " time-get inp-time 43]&lt;br /&gt; munlbl/text: reform ["Time in Munich: " time-get inp-time 83]&lt;br /&gt; show boslbl&lt;br /&gt; show munlbl&lt;br /&gt;]&lt;br /&gt;] keycode [#"^m"] return&lt;br /&gt;boslbl: h4 "[---------------------------------------------------------------------]" return&lt;br /&gt;munlbl: h4 "[---------------------------------------------------------------------]" return&lt;br /&gt;]&lt;br /&gt;view center-face gui&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and the output&lt;br /&gt;&lt;img src="http://1.bp.blogspot.com/-P5aVGs2S6p0/TaguL_Y7pVI/AAAAAAAAAE0/2fNaROuTJRA/s200/tz_rebol.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5595773320537285970" /&gt;&lt;br /&gt;This is most strange way to do timezone conversion, but the learnings and development was fun; all the effort was worth it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-1318015788197384334?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/1318015788197384334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=1318015788197384334' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1318015788197384334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1318015788197384334'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2011/04/trying-rebol.html' title='Trying REBOL'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-P5aVGs2S6p0/TaguL_Y7pVI/AAAAAAAAAE0/2fNaROuTJRA/s72-c/tz_rebol.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-8809760993446249843</id><published>2010-09-06T08:23:00.000-07:00</published><updated>2010-09-06T21:27:56.925-07:00</updated><title type='text'>World War II + India + Java</title><content type='html'>&lt;div&gt;While exploring Java timezone related API, it was a surprise to me that during the World War II, India(being colony of England) had Daylight Saving Time !&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This timezone was in effect from &lt;span class="Apple-style-span"&gt;1-Sept-1942&lt;/span&gt; to&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"&gt;15-Oct-1945&lt;/span&gt;. Interestingly, this DST is supported by Java date time API.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: helvetica, arial, freesans, clean, sans-serif; font-size: 11px; line-height: 14px; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; line-height: 1.4em; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; "&gt;&lt;div class="line" id="LC1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;DateFormat&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;indiaDtFmt&lt;/span&gt; &lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;=&lt;/span&gt; &lt;span class="k" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;new&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;"dd/MM/yyyy HH'h'mm"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC2" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;DateFormat&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;gmtDtFmt&lt;/span&gt; &lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;=&lt;/span&gt; &lt;span class="k" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;new&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;SimpleDateFormat&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;"yyyy-MM-dd HH:mm:ss"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC3" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="line" id="LC4" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;indiaDtFmt&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;setTimeZone&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;TimeZone&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;getTimeZone&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;"Asia/Calcutta"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC5" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;gmtDtFmt&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;setTimeZone&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;TimeZone&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;getTimeZone&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;"GMT"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC6" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="line" id="LC7" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;Date&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;worldWarIIDate&lt;/span&gt; &lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;=&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;indiaDtFmt&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;parse&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;"02/02/1944 06h30"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC8" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;Date&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;nonWorldWarIIDate&lt;/span&gt; &lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;=&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;indiaDtFmt&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;parse&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;"02/02/2006 06h30"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC9" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="line" id="LC10" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;System&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;err&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;println&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;gmtDtFmt&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;format&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;worldWarIIDate&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;)&lt;/span&gt; &lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;+&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;" GMT"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC11" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;System&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;err&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;println&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;gmtDtFmt&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;.&lt;/span&gt;&lt;span class="na" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 128, 128); "&gt;format&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;(&lt;/span&gt;&lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;nonWorldWarIIDate&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;)&lt;/span&gt; &lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;+&lt;/span&gt;&lt;span class="s" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(221, 17, 68); "&gt;" GMT"&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The above code produces the following output.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: helvetica, arial, freesans, clean, sans-serif; font-size: 11px; line-height: 14px; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; line-height: 1.4em; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; "&gt;&lt;div class="line" id="LC13" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;1944&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;-&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;02&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;-&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;02&lt;/span&gt; &lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;00&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;:&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;00&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;:&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;00&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;GMT&lt;/span&gt;&lt;/div&gt;&lt;div class="line" id="LC14" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;2006&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;-&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;02&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;-&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;02&lt;/span&gt; &lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;01&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;:&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;00&lt;/span&gt;&lt;span class="o" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; font-weight: bold; "&gt;:&lt;/span&gt;&lt;span class="mi" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; color: rgb(0, 153, 153); "&gt;00&lt;/span&gt; &lt;span class="n" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.4em; "&gt;GMT&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the during the World War II, India was in the timezone &lt;i&gt;+4.30 GMT&lt;/i&gt;  compared to the normal timezone of &lt;i&gt;+5.30 GMT&lt;/i&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This also mean the horoscopes of the people born in India during the World War II need to take this DST into consideration. These people include celebrities like &lt;i&gt;Ilaiyaraaja&lt;/i&gt;,&lt;i&gt;Azim Premji&lt;/i&gt;,&lt;i&gt;Amitabh Bachchan &lt;/i&gt;etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Obviously this well known to Astrologers.Here is one of  the links for &lt;a href="http://tinyurl.com/india-dst"&gt;war-time correction for horoscopes.&lt;/a&gt; Another link for &lt;a href="http://tinyurl.com/india-dst-1"&gt;war time correction&lt;/a&gt; across the world.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: helvetica, arial, freesans, clean, sans-serif; font-size: 11px; line-height: 14px; "&gt;&lt;pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font: normal normal normal 12px/normal Monaco, 'Courier New', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; line-height: 1.4em; font-family: 'Bitstream Vera Sans Mono', Courier, monospace; "&gt;&lt;div class="line" id="LC1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 1em; line-height: 1.4em; "&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&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/28715187-8809760993446249843?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/8809760993446249843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=8809760993446249843' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/8809760993446249843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/8809760993446249843'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2010/09/world-war-ii-india-java.html' title='World War II + India + Java'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-454053553844874829</id><published>2010-07-31T03:21:00.000-07:00</published><updated>2010-08-02T05:22:45.424-07:00</updated><title type='text'>Auto Fare Converter</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_lbwjjmTvrvk/TFP_fcnnDFI/AAAAAAAAADI/2W9bOCOKUX8/s1600/fare.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 155px; height: 200px;" src="http://2.bp.blogspot.com/_lbwjjmTvrvk/TFP_fcnnDFI/AAAAAAAAADI/2W9bOCOKUX8/s200/fare.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5500020485672864850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;New Auto fare in Bangalore is in effect from Aug 1, 2010. But, Autos have been given 2 month time period to change their meters. &lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;As a result, commuters are expected to know the fare conversion from old to new. Either trust the Auto Driver or have a print of the fare conversion table published.&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;So I quickly wrote a mobile application to do the conversion. I wrote 2 versions, one android version and other Java ME (MIDP 2.0) application.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://3.bp.blogspot.com/_lbwjjmTvrvk/TFP9wWzA4gI/AAAAAAAAADA/YB0lRBzf_FI/s400/java_me_auto.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 188px; height: 214px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5500018577144603138" /&gt;&lt;/td&gt;&lt;td&gt;&lt;img src="http://1.bp.blogspot.com/_lbwjjmTvrvk/TFP9wNXjbKI/AAAAAAAAAC4/b-PQiAl1VqQ/s400/android_auto_fare.png" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 200px; height: 200px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5500018574613507234" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are the links to the application installables&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Java Me (MIDP 2.0) App:  &lt;a href="http://sriki77-blog.googlegroups.com/web/AutoFareMe.jar"&gt;http://sriki77-blog.googlegroups.com/web/AutoFareMe.jar&lt;/a&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;2. Android App: &lt;a href="http://sriki77-blog.googlegroups.com/web/AutoFareDroid.apk"&gt; http://sriki77-blog.googlegroups.com/web/AutoFareDroid.apk&lt;/a&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;b&gt;Application Usage:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Enter the current fare in the meter.&lt;/li&gt;&lt;li&gt;Click Convert button.&lt;/li&gt;&lt;li&gt;The amount you need to pay, the new fare, will be shown.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&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/28715187-454053553844874829?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/454053553844874829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=454053553844874829' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/454053553844874829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/454053553844874829'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2010/07/auto-fare-mobile-app.html' title='Auto Fare Converter'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_lbwjjmTvrvk/TFP_fcnnDFI/AAAAAAAAADI/2W9bOCOKUX8/s72-c/fare.png' height='72' width='72'/><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-8546168997446899911</id><published>2010-07-26T09:33:00.000-07:00</published><updated>2010-07-27T19:31:55.826-07:00</updated><title type='text'>BMTC Bus Ticket Cost Calculation</title><content type='html'>In a recent travel through BMTC  bus  to my office, I was involved in a big fight between another software engineer and the bus conductor on - how the ticket price was calculated?  The software engineer did not know Kannada and the bus conductor could explain in the English. I served as the translator in that heated argument :)... here is the info how the ticket price is calculated.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Note:&lt;/span&gt; &lt;span style="font-style: italic;"&gt;The calculation is performed by the ticketing machine given to the bus conductor so the conductor cannot cheat you!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;BMTC divides the routes into stages. Following is the '&lt;span style="font-style: italic;"&gt;Fare Table&lt;/span&gt;' of BMTC Bus No 45. You can get the '&lt;span style="font-style: italic;"&gt;Fare Table&lt;/span&gt;' for your route from the conductor....Please Ask!&lt;br /&gt;&lt;style type="text/css"&gt;.nobrtable br { display: none }&lt;/style&gt;&lt;br /&gt;&lt;div class="nobrtable"&gt;&lt;br /&gt;&lt;table&gt;&lt;br /&gt;&lt;tbody&gt;&lt;tr style="font-weight: bold;" align="center"&gt;&lt;td colspan="3"&gt;FARE TABLE-010&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td style="font-weight: bold; text-align: center;"&gt;Stage&lt;/td&gt;&lt;td style="font-weight: bold; text-align: center;"&gt;Name&lt;/td&gt;&lt;td style="font-weight: bold; text-align: center;"&gt;Fare&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td style="text-align: left;"&gt;KAMAKYA&lt;/td&gt;&lt;td style="text-align: right;"&gt;0.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td style="text-align: left;"&gt;KATTRIGUPPE&lt;/td&gt;&lt;td style="text-align: right;"&gt;5.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td style="text-align: left;"&gt;HOSAKERE HALLI&lt;/td&gt;&lt;td style="text-align: right;"&gt;9.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td style="text-align: left;"&gt;BANK COLONY&lt;/td&gt;&lt;td style="text-align: right;"&gt;10.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td style="text-align: left;"&gt;GANESH BHAVAN&lt;/td&gt;&lt;td style="text-align: right;"&gt;13.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;6&lt;/td&gt;&lt;td style="text-align: left;"&gt;CHAMARAJPET&lt;/td&gt;&lt;td style="text-align: right;"&gt;15.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td style="text-align: left;"&gt;GOODS ROAD&lt;/td&gt;&lt;td style="text-align: right;"&gt;16.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;8&lt;/td&gt;&lt;td style="text-align: left;"&gt;KBS&lt;/td&gt;&lt;td style="text-align: right;"&gt;16.00&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now the stage you climb the bus is the &lt;span style="font-style: italic;"&gt;Stage 1 for you &lt;/span&gt;and of course the stage you get off is the last stage for you. Lets see the following examples of fare calculation with the previous assumption.&lt;br /&gt;&lt;br /&gt;Fare from&lt;br /&gt;&lt;br /&gt;&lt;ul style="font-style: italic;"&gt;&lt;li&gt;KAMAKYA to KBS = Stage 8 - Stage 0 = 8 Stages crossed = Rs 16&lt;/li&gt;&lt;li&gt;BANK COLONY to GOODS Road = Stage 7 - Stage 4 = 3 Stages Crossed =  Rs 9&lt;/li&gt;&lt;li&gt;GOODS ROAD to KBS = Stage 8 - Stage 7 = 1 Stage crossed = Rs 5&lt;/li&gt;&lt;/ul&gt;Algorithmically,&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;List stageList=[KAMKYA...KBS]&lt;br /&gt;List fareList=[0..16]&lt;br /&gt;int start= stageList.indexOf[&lt;span style="font-style: italic;"&gt;YOUR START STAGE]&lt;/span&gt;&lt;br /&gt;int end = stageList.indexOf[&lt;span style="font-style: italic;"&gt;YOUR END STAGE]&lt;/span&gt;&lt;br /&gt;Fare= fareList[end-start]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Hope the calculation is clear!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-8546168997446899911?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/8546168997446899911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=8546168997446899911' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/8546168997446899911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/8546168997446899911'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2010/07/bmtc-bus-ticket-cost-calculation.html' title='BMTC Bus Ticket Cost Calculation'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-5946258634600916637</id><published>2010-05-29T20:47:00.000-07:00</published><updated>2010-05-29T21:09:53.593-07:00</updated><title type='text'>Reading Java Concurrency</title><content type='html'>The j.u.c package added to Java in 1.5 introduced me to the world of Concurrency research itself.  Somehow i never thought of looking to this package beyond &lt;span style="font-style: italic;"&gt;Executors &lt;/span&gt;class.&lt;br /&gt;&lt;br /&gt;Here is the study plan for that worked for me...&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Locks, Conditions And Fairness&lt;/li&gt;&lt;li&gt; Understanding the Java Memory Model and its fix by JSR 133&lt;/li&gt;&lt;li&gt;Happens-Before and volatile.&lt;/li&gt;&lt;li&gt;LL/SC, CAS concepts&lt;/li&gt;&lt;li&gt;Atomic package&lt;/li&gt;&lt;li&gt;Concurrent Data Structures &amp;amp; Synchronizers&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Executors,Futures and other threading concepts.&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;"&gt;People &amp;amp; Forums:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Articles by &lt;a href="http://www.briangoetz.com/"&gt;Brian Goetz&lt;/a&gt;, &lt;a href="http://g.oswego.edu/"&gt;Doug Lea&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://gee.cs.oswego.edu/dl/concurrency-interest/"&gt;Java concurrency Interest group&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Two useful books:&lt;/span&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Concurrent-Programming-Java-TM-Principles/dp/0201310090"&gt;Concurrent Programming In Java&lt;/a&gt; by Doug Lea.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601"&gt;Java Concurrency in Practice&lt;/a&gt; By Brian Goetz&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-5946258634600916637?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/5946258634600916637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=5946258634600916637' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/5946258634600916637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/5946258634600916637'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2010/05/reading-java-concurrency.html' title='Reading Java Concurrency'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-4500170877302032963</id><published>2010-01-30T18:25:00.000-08:00</published><updated>2010-01-30T18:36:13.673-08:00</updated><title type='text'>rmToMp3.pl</title><content type='html'>Here is the perl script to convert &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;.rm&lt;/span&gt; files to .&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;mp3&lt;/span&gt; format on linux. Needed this script since my DVD player cannot play &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;.rm&lt;/span&gt; files. Script needs the following software to work&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Perl &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;mplayer&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;lame&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;wget&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;The script can download rm or ram files  and then process the download &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;.rm&lt;/span&gt; files to produce the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;.mp3&lt;/span&gt; file.&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;pre&gt;#!/usr/bin/perl -w&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;BEGIN{&lt;br /&gt;$\="\n";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;amp;usage if @ARGV!=1;&lt;br /&gt;my $fileName=shift;&lt;br /&gt;&amp;amp;usage if ($fileName !~ m#\.(ram|rm)$#);&lt;br /&gt;&amp;amp;process_ram($fileName) if ($fileName =~ m|\.ram$|);&lt;br /&gt;&amp;amp;process_rm($fileName) if ($fileName =~ m|\.rm$|);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sub usage(){&lt;br /&gt;print STDERR "&lt;b&gt;usage: $0 filename.rm/ram&lt;/b&gt;&lt;filename.rm/ram&gt;\n";&lt;br /&gt;exit 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub process_ram(){&lt;br /&gt;my $fileName=shift;&lt;br /&gt;$fileName=&amp;amp;processUrl($fileName);&lt;br /&gt;open RAM_FILE, $fileName || die "Failed To Process File: $!";&lt;br /&gt;while(&lt;ram_file&gt;){&lt;br /&gt; chomp;&lt;br /&gt; chop if ~ m/\r$/;&lt;br /&gt; $_ = &amp;amp;processUrl($_);&lt;br /&gt; &amp;amp;convertToMp3($_);&lt;br /&gt;}&lt;br /&gt;close RAM_FILE;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub process_rm(){&lt;br /&gt;my $fileName=shift;&lt;br /&gt;$fileName=&amp;amp;processUrl($fileName);&lt;br /&gt;&amp;amp;convertToMp3($fileName);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub convertToMp3(){&lt;br /&gt;my $fileName=shift;&lt;br /&gt;chomp($fileName);&lt;br /&gt;chop($fileName) if $fileName =~ m/\r$/;&lt;br /&gt;print "Processing File...$fileName";&lt;br /&gt;my ($dirName,$baseName)=&amp;amp;dirname($fileName);&lt;br /&gt;$baseName =~ s/\.rm/.mp3/;&lt;br /&gt;die "Invalid File: ${fileName}" unless(-e $fileName);&lt;br /&gt;`mplayer $fileName -ao pcm 2&gt;/dev/null`;&lt;br /&gt;`lame -h -b 128 audiodump.wav $dirName/$baseName`;&lt;br /&gt;`rm audiodump.wav`;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub dirname(){&lt;br /&gt;return (".",$_[0]) unless $_[0] =~ m|^/|;&lt;br /&gt;return $_[0]=~ m|(.*/)(.*)$|;&lt;br /&gt;}&lt;br /&gt;sub processUrl(){&lt;br /&gt;my $fileName=shift;&lt;br /&gt;chomp($fileName);&lt;br /&gt;if(&amp;amp;isUrl($fileName)){&lt;br /&gt; &amp;amp;download($fileName);&lt;br /&gt; return $fileName =~ m|.*/(.*)$|,$1;&lt;br /&gt;}&lt;br /&gt;return $fileName;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub isUrl(){&lt;br /&gt;$_[0] =~ m/^http.*/;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub download(){&lt;br /&gt;print "Downloading File...$_[0]";&lt;br /&gt;system("wget -c $_[0]")==0 || die "Failed to download file: $_[0]";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/ram_file&gt;&lt;/filename.rm/ram&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&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/28715187-4500170877302032963?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/4500170877302032963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=4500170877302032963' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/4500170877302032963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/4500170877302032963'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2010/01/rmtomp3pl.html' title='rmToMp3.pl'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-5915338106904269508</id><published>2009-11-03T18:19:00.000-08:00</published><updated>2009-11-03T18:34:09.102-08:00</updated><title type='text'>Encroachers Hammering Project</title><content type='html'>&lt;p class="MsoNormal"&gt;Recent anti-encroachment drive of Mysore is an example of admirable planning and execution. The drive was directed and managed by the MCC commissioner K. S Raykar.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;Planning Phase:&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;Almost 6 months &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;a) to get approvals from higher ups including district minister Shobha Karandlaje &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;b) to develop project execution plan.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;Departments Involved: &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;MCC, MUDA, Mysore Police (KSRP, CAR, DAR...etc), Telecom Department&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;Project Leads: &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;K.S Raykar( MCC Commissioner), Manivannan (DCP), &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;Sunil Agarwal (Police Commissioner)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;Project Team Structure/Resourcing:&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;Commanded by&lt;/i&gt;:&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;2 teams of MUDA and MCC&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;Executed By&lt;/i&gt;:&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;27 teams of workers!!!&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;The team organization and composition of each team is shown below.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_lbwjjmTvrvk/SvDlQ4HX6qI/AAAAAAAAACc/M-rZg8LlvQs/s1600-h/demo_team.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 420px; height: 384px;" src="http://1.bp.blogspot.com/_lbwjjmTvrvk/SvDlQ4HX6qI/AAAAAAAAACc/M-rZg8LlvQs/s320/demo_team.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5400068031321205410" /&gt;&lt;/a&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_lbwjjmTvrvk/SvDlQ4HX6qI/AAAAAAAAACc/M-rZg8LlvQs/s1600-h/demo_team.png"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); -webkit-text-decorations-in-effect: none; "&gt;&lt;/span&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_lbwjjmTvrvk/SvDlQ4HX6qI/AAAAAAAAACc/M-rZg8LlvQs/s1600-h/demo_team.png"&gt;click to enlarge&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Risks/ Risk Mitigation:&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;Stay Order from Court: &lt;/i&gt;&lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;The operation was started on a Sunday, early in the morning - no court is open at that time.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;Influence from elected representatives:&lt;/i&gt;&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;All the phone lines, land line and mobile, were jammed with help of Telecom providers - physical presence required for any kind of influence.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;i&gt;People gathering to protest:&lt;/i&gt; Jamming of phone lines prevent mobilization of people. Also, 500 policemen providing security would deter anyone raising voice.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Result: &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;More than 450 encroachments cleared by noon!&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Issues Encountered: &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;There was protest by the elected representatives at the demolition site. The threat of arrest, and few arrests, by the police was enough to diffuse the crowd.&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;Post Execution: &lt;span class="Apple-style-span" style="font-weight: normal; "&gt;MCC Commissioner goes on a 3 day sick leave from Monday – leaving all the encroachers and their supporters with the rubble!&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-5915338106904269508?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/5915338106904269508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=5915338106904269508' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/5915338106904269508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/5915338106904269508'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/11/encroachers-hammering-project.html' title='Encroachers Hammering Project'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_lbwjjmTvrvk/SvDlQ4HX6qI/AAAAAAAAACc/M-rZg8LlvQs/s72-c/demo_team.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-7365887726884419836</id><published>2009-07-13T00:01:00.000-07:00</published><updated>2009-07-13T03:09:34.987-07:00</updated><title type='text'>A Geyser Weekend</title><content type='html'>This weekend has been a Geyser weekend. All the weekend I was hunting for a geyser to buy. I realized this is not an easy task considering the kind of stuff you need to look for. Here is a small checklist of stuff you need to be aware for buying a geyser in India.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Capacity&lt;/span&gt;: 25-15 liters Storage -  This is enough for a bathroom geyser in most household of 4 to 6 ppl. The decision in this case has to be based on the requirement since the cost difference between a 25 ltr and 15 ltr model is Rs 400.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Plastic Body (ABS)&lt;/span&gt;   Acrylonitrile Butadiene Styrene (C&lt;sub&gt;8&lt;/sub&gt;H&lt;sub&gt;8&lt;/sub&gt;• C&lt;sub&gt;4&lt;/sub&gt;H&lt;sub&gt;6&lt;/sub&gt;•C&lt;sub&gt;3&lt;/sub&gt;H&lt;sub&gt;3&lt;/sub&gt;N)&lt;sub&gt;n&lt;/sub&gt; plastic has very good electrical insulation properties.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Copper Drum&lt;/span&gt; - Copper has special anti corrosive properties that prolongs the life of the water heater. This is useful for hard water areas.The heat retention in Copper Drum is more than that of stainless steel.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Pressure &lt;/span&gt;- It is recommended to select a heater with pressure withstanding capacity of 6 Kg/cm&lt;sup&gt;2&lt;/sup&gt; and above in case of high rise apartments where the pressure can build-up due to water inlet. This might be due to a pressure pump used for water or water gushing down from the overhead tank.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Adjustable Temperature&lt;/span&gt; - Ideal water temperature for a bath is 40- 45 degrees. This would save some money the electric bill!!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Thermal Cut-out&lt;/span&gt; - A fail-safe device to prevent over heating and boiling&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Pressure cum vacuum release&lt;/span&gt;–prevents build up of excessive pressure (by releasing water) or vacuum (sucking in air) inside the tank.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Semi return device &lt;/span&gt;– prevents dry heating of the element by cutting off flow from the tank- ensuring that element is always immersed in water.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2-in-1 pressure cum release valve&lt;/span&gt; - Ensures positive and negative pressure is not created inside the tank&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ceramic Heating Element&lt;/span&gt; - No electric shock. It is a cartridge type element that is not in contact with water. Also the heat transfer is over a much larger surface area. The result- longer elements, life, lower salt deposits, hence ideal for hard water areas, easier to replace without draining the water.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PUF Insulation&lt;/span&gt; - Poly Urethene Foam prevents heat loss, retains heat longer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Certifications &amp;amp; Warranty&lt;/span&gt;&lt;br /&gt;ISI/BIS certification - A must india.&lt;br /&gt;Warranty period for 5 years.&lt;br /&gt;IEC international certification .&lt;br /&gt;And of course 5 star energy rating!!&lt;br /&gt;&lt;br /&gt;I happened to select a water heater with most of theses specifications - 2 years down the line i will be evaluating these criteria :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-7365887726884419836?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/7365887726884419836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=7365887726884419836' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/7365887726884419836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/7365887726884419836'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/07/geyser-weekend.html' title='A Geyser Weekend'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-9098409294714421752</id><published>2009-06-18T21:52:00.000-07:00</published><updated>2009-06-18T22:32:10.164-07:00</updated><title type='text'>Solving a Linear Programming Problem</title><content type='html'>&lt;div style="text-align: justify;"&gt;Operations Research (OR) is one of the key constituents of analytics. Solving a Linear Programming Problem (LPP) is core to OR. In one of my projects we have used a Simplex solver to choose an optimal solution from a set of available solutions. Its quite interesting to see a real life LPP.&lt;br /&gt;&lt;br /&gt;We use the &lt;a href="https://projects.coin-or.org/SYMPHONY"&gt;SYMPHONY&lt;/a&gt; an open source generic MILP (Mixed-Integer Linear Programs) solver from COIN-OR.&lt;br /&gt;&lt;br /&gt;This solver takes two inputs&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Problem model file:&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;The Problem Model file contains the formulation of the LPP to be solved. The file uses &lt;a href="http://www.gnu.org/software/glpk/"&gt;GMPL&lt;/a&gt; (a subset of &lt;a href="http://www.ampl.com/"&gt;AMPL&lt;/a&gt;) a modeling language for Mathematical Programming.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style="text-align: justify;"&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Input data file:&lt;/span&gt;This file contains the input data of the problem to be solved.&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;Equipped with this information I decided to solve one of the 6th Semester Engineering LPP problems.(I still have my 6th Sem OR notes!!)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Problem Statement:&lt;/span&gt;&lt;br /&gt;A small scale hardware production plant produces Nuts, Bolts and Rivets. A box of Nuts fetches a profit of Rs 20 per fortnight. Profit per fortnight from a box of Bolts and Rivets is Rs 6 and Rs 8 respectively. A box of Nuts requires 8 hrs of Milling, 2 hrs of lathe time and 4 hrs of threading time. A box of Bolts requires 2 hrs of Milling, and 4 hrs of threading time. A box of Rivets requires 3 hrs of milling and 1 hr of lathe time. Further milling, threading and lathe can operate 250 hrs, 150hrs and 50hrs per fortnight.  Find an optimal solution to maximize the profit per fortnight of production plant.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Mathematical Formulation:&lt;/span&gt;&lt;br /&gt;Lets formulate the problem to be solved. Let x&lt;sub&gt;1&lt;/sub&gt;, x&lt;sub&gt;2&lt;/sub&gt;, x&lt;sub&gt;3&lt;/sub&gt; represent the optimal quantities of production of the Nuts, Bolts and Rivets per fortnight.&lt;br /&gt;&lt;br /&gt;The objective and constraints formulated can be easily derived from the problem statement.&lt;br /&gt;&lt;br /&gt;&lt;div  style="text-align: center;font-family:courier new;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-style: italic;"&gt;Objective: &lt;/span&gt; Maximize 20 x&lt;sub&gt;1&lt;/sub&gt; + 6 x&lt;sub&gt;2&lt;/sub&gt; + 8 x&lt;sub&gt;3&lt;/sub&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Milling Constraints: &lt;/span&gt;&lt;br /&gt;8 x&lt;sub&gt;1&lt;/sub&gt; + 2x&lt;sub&gt;2&lt;/sub&gt; + 3x&lt;sub&gt;3&lt;/sub&gt; &lt;= 250&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Threading Constraints:&lt;/span&gt;&lt;br /&gt;4 x&lt;sub&gt;1&lt;/sub&gt; + 3x&lt;sub&gt;2&lt;/sub&gt; + 0x&lt;sub&gt;3&lt;/sub&gt; &lt;= 150    &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;Lathe Constraints:&lt;/span&gt;&lt;br /&gt;2 x&lt;sub&gt;1&lt;/sub&gt; + 0x&lt;sub&gt;2&lt;/sub&gt; + 1x&lt;sub&gt;3&lt;/sub&gt; &lt;= 50&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;Model File:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:georgia;"&gt;Now we have to represent our mathematical formulation in way the Symphony solver can understand. Following is the formulation of the same problem in GMPL format.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-style: italic;"&gt;Filename: HardwarePlant.mod&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;/*Input Data we need to Solve*/&lt;br /&gt;&lt;br /&gt;/* Input Set of products */&lt;br /&gt;set products;&lt;br /&gt;&lt;br /&gt;/* Gains of the product */&lt;br /&gt;param gain{i in products};&lt;br /&gt;&lt;br /&gt;/* Milling Requirements of the product */&lt;br /&gt;param milling{i in products};&lt;br /&gt;&lt;br /&gt;/* Lathe Requirements of the product */&lt;br /&gt;param lathe{i in products};&lt;br /&gt;&lt;br /&gt;/* Threading Requirements of the product */&lt;br /&gt;param thread{i in products};&lt;br /&gt;&lt;br /&gt;/* Milling Limit*/&lt;br /&gt;param millingLimit;&lt;br /&gt;&lt;br /&gt;/* Threading Limit*/&lt;br /&gt;param threadLimit;&lt;br /&gt;&lt;br /&gt;/* lathe Limit*/&lt;br /&gt;param latheLimit;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*Variable Declarations*/&lt;br /&gt;var x{i in products}, &gt;= 0;&lt;br /&gt;&lt;br /&gt;/*Objective*/&lt;br /&gt;maximize profit: sum{i in products} gain[i]*x[i];&lt;br /&gt;&lt;br /&gt;/*Constraints*/&lt;br /&gt;subject to millingMachine: sum{i in products} milling[i]*x[i] &lt;= millingLimit;  &lt;br /&gt;&lt;br /&gt;subject to latheMachine: sum{i in products} lathe[i]*x[i] &lt;= latheLimit;  &lt;br /&gt;&lt;br /&gt;subject to threadMachine: sum{i in products} thread[i]*x[i] &lt;= threadLimit;  &lt;br /&gt;&lt;br /&gt;end;  &lt;span style="font-family:georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;At first we take as input a set of products. Then we need the gain for each of the products. Next, we need the milling, threading and lathe requirements for the product. We also need the limits for each of the machines. Thats all the input we need to find an optimal solution. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;We define a variable set x representing the quantities of each of the product. We need to determine the values of x.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="font-size:100%;"&gt;Further we define the objective and constraints to choose the optimal solution.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Input Data File:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Following is the input data file from our problem statement to be used with the model file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Filename: HardwarePlant.dat &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;data;&lt;br /&gt;&lt;br /&gt;set products:= Nuts Bolts Rivets;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;param gain:=Nuts 20&lt;br /&gt;     Bolts 6&lt;br /&gt;           Rivets 8 ; &lt;br /&gt;&lt;br /&gt;param milling:=Nuts 8&lt;br /&gt;              Bolts 2&lt;br /&gt;              Rivets 3;&lt;br /&gt;&lt;br /&gt;param thread:=Nuts 4&lt;br /&gt;             Bolts 3&lt;br /&gt;             Rivets 0;&lt;br /&gt;&lt;br /&gt;param lathe:=Nuts 2&lt;br /&gt;            Bolts 0&lt;br /&gt;            Rivets 1;&lt;br /&gt;&lt;br /&gt;param millingLimit  := 250;&lt;br /&gt;param threadLimit   := 150;&lt;br /&gt;param latheLimit    := 50;&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-family: georgia;font-size:100%;" &gt;First we provide the input set of products. This can be strings representing the name of the products.&lt;/span&gt;&lt;span style="font-family: georgia;font-size:100%;" &gt;Name of the product acts as an index for the rest of the parameters&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;font-size:100%;" &gt;Next we specify the gain per fortnight. From the model file its evident that we need gain for every product. We specify the name of the product and gain. As mentioned above the name serves as an index into the gain set.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;font-size:100%;" &gt;We use the similar approach as above and specify the values for milling, threading and lathe requirements.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: georgia;font-size:100%;" &gt;Finally, we specify the scalar values for the limits.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;font-size:100%;" &gt;&lt;span style="font-family: georgia;"&gt;Execution:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: georgia;"&gt;Using the model and input file, Symphony solver can be executed as follows&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;symphony -F HardwarePlant.mod  -D HardwarePlant.dat&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-size:100%;"&gt;The execution produces the following output (only the relevant part shown&lt;/span&gt;)&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;Solution Cost: 700.000&lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;Column names and values of nonzeros in the solution&lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;x[Bolts]     50.000&lt;br /&gt;x[Rivets]     50.000&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold;"&gt;Analyzing the output:&lt;/span&gt;&lt;br /&gt;The solver is recommending for production of 50 bolts, 50 rivets and no nuts in a fortnight. And the optimal profit is Rs 700 per fortnight.&lt;br /&gt;This is answer that matches the hand solved solution in my notes!!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-9098409294714421752?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/9098409294714421752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=9098409294714421752' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/9098409294714421752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/9098409294714421752'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/06/solving-linear-programming-problem.html' title='Solving a Linear Programming Problem'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-2063307794849650194</id><published>2009-05-26T23:51:00.000-07:00</published><updated>2009-05-27T00:04:39.731-07:00</updated><title type='text'>SOA Layering</title><content type='html'>The following links from Bill Poole is a must read for the SOA developers and architects.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bill-poole.blogspot.com/2008/05/layered-service-models-are-bad.html" target="_blank"&gt;http://bill-poole.blogspot.&lt;wbr&gt;com/2008/05/layered-service-&lt;wbr&gt;models-are-bad.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bill-poole.blogspot.com/2008/05/layered-service-models-are-bad_20.html" target="_blank"&gt;http://bill-poole.blogspot.&lt;wbr&gt;com/2008/05/layered-service-&lt;wbr&gt;models-are-bad_20.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Very impressive arguments. Thanks to &lt;a href="http://blog.sriramnarayan.com/"&gt;Sriram&lt;/a&gt; for sending me these links.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-2063307794849650194?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/2063307794849650194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=2063307794849650194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/2063307794849650194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/2063307794849650194'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/05/soa-layering.html' title='SOA Layering'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-1658808897418807173</id><published>2009-05-20T09:41:00.000-07:00</published><updated>2009-05-21T07:48:51.961-07:00</updated><title type='text'>ESB - Does my project need it?</title><content type='html'>A key component of the SOA architecture is ESB. Most often ESB is used as  silver bullet to clean-up the Enterprise integration mesh.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;br /&gt;I came across quite an interesting perspective after a brief session with &lt;a href="http://jim.webber.name/"&gt;Jim Webber&lt;/a&gt;, an advocate of Guerilla SOA.&lt;br /&gt;&lt;br /&gt;From my past experience following are some of the key reasons for using an ESB.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;ESB cleans-up the integration mesh (or mess)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lbwjjmTvrvk/ShQ2y0UBPkI/AAAAAAAAABg/dt2x7Fp-fwM/s1600-h/ESB.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 127px;" src="http://3.bp.blogspot.com/_lbwjjmTvrvk/ShQ2y0UBPkI/AAAAAAAAABg/dt2x7Fp-fwM/s320/ESB.png" alt="" id="BLOGGER_PHOTO_ID_5337951705004850754" border="0" /&gt;&lt;/a&gt;A typical diagram of ESB based transformation is as shown above. In reality all the mesh gets into the ESB itself; ESB encapsulates the mesh. Subsequent to the ESB based solution implementation, enterprises would have to setup teams  to manage the ESB and deal with the governance around the ESB usage.&lt;br /&gt;&lt;br /&gt;Eventually there is a possibility of the mesh outgrowing the ESB and spilling over; taking the integration back to where it started. Only difference this time is that the ESB will be part of the mesh.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_lbwjjmTvrvk/ShVbzeNamOI/AAAAAAAAABo/5KfXTago4yk/s1600-h/ESB_FUt.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 158px;" src="http://3.bp.blogspot.com/_lbwjjmTvrvk/ShVbzeNamOI/AAAAAAAAABo/5KfXTago4yk/s320/ESB_FUt.png" alt="" id="BLOGGER_PHOTO_ID_5338273873158379746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ESB is good for business process orchestration&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is one of major feature that attracts a lot of developers. As a result, the business process gets into the ESB. The ESB now contains the critical business process of the enterprise, apart being just an integration back bone. This makes whole system extra complex with business logic spread all over.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Other ESB vices&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In general usage of ESB results in vendor lock in. Business process is always wired in using vendor specific languages.&lt;br /&gt;&lt;br /&gt;Performance hit with ESB is significant. More dollars are spent scaling this beast.&lt;br /&gt;&lt;br /&gt;Occasionally project requires development custom adapter/data transformers to be used with ESB - additional effort for the development team with already strict time lines.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Is ESB useless?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No, its not; but ESB is not a silver bullet.&lt;br /&gt;&lt;br /&gt;ESB assists the project in meeting the data transformation and communication requirements. Its a good candidate for dealing with disparate protocols (FTP, IIOP, and SOAP) between the interacting systems&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;How do I deal my integration mess?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Business Chaos Modeling&lt;/span&gt;!!&lt;br /&gt;&lt;br /&gt;As I understand, Guerrilla SOA advocates modeling the SOA integration based on the real world business process. This is an interesting perspective.&lt;br /&gt;&lt;br /&gt;As we all know traditional software that models the business domain is the one best meeting the business requirement. Why can't we extend this to SOA?&lt;br /&gt;&lt;br /&gt;Just model the business interactions between services. If thats a mesh, so be it. The business itself is running with so many interactions.&lt;br /&gt;&lt;br /&gt;If a clean-up is required, then the change should originate from the business domain. This business domain change will percolate and would warrant a change in the SOA model.&lt;br /&gt;&lt;br /&gt;I feel this is idea of modeling the business chaos among the services is so much in line with the philosophy of SOA which promotes the alignment of software systems in line with the business.&lt;br /&gt;&lt;br /&gt;ESB can definitely not clean-up the so called chaos that originates in the business domain.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Business Process Orchestration&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Business process is just business logic; why treat the process as a special entity? Implement the process like any other business logic. Such an implementation would ensure the entire business logic remains as a single unit and is more manageable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Managing Chaos&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Manageability of the solution/system post implementation is critical to any client. Although we model the business domain mesh in our system, it critical that the mesh be manageable. Monitoring and control interfaces to manage interactions are essential.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Summary&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A manageable business integration (SOA), with thoughtful ESB usage would definitely make the client happy and align the implementation with business!!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Hmm...quite a change of ideas in me after getting to know about Guerrilla SOA!!&lt;/span&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/28715187-1658808897418807173?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/1658808897418807173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=1658808897418807173' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1658808897418807173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1658808897418807173'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/05/esb-does-my-project-need-it.html' title='ESB - Does my project need it?'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_lbwjjmTvrvk/ShQ2y0UBPkI/AAAAAAAAABg/dt2x7Fp-fwM/s72-c/ESB.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-4889788244646490769</id><published>2009-03-07T21:24:00.000-08:00</published><updated>2009-03-07T21:41:59.817-08:00</updated><title type='text'>REST/ROA - UNIX File System</title><content type='html'>I have been trying to understand the differences between REST and ROA. It seems they are useful only when they are coupled together. Specifically, they complement each other in terms the ground rules they lay down!!&lt;br /&gt;&lt;br /&gt;REST advocates uniform interface for the system. ROA divides the entire system into resources. Everything in the system is a resource and accessed using a similar interface.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The following idea might be a little far-fetched or I might be completely wrong in understanding ROA/REST and UNIX file system!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;REST/ROA concepts might be new to enterprise application design. However, I feel such concepts have been in use in system design; though they are not referred to by the same name.&lt;br /&gt;&lt;br /&gt;I feel UNIX file system is a good example of application of REST/ROA principles. Everything in the file system is a file  any device, hard disk, console etc. are considered as files. So in the file system, &lt;span style="font-style: italic;"&gt;file&lt;/span&gt; is the resource and access/usage to this resource is consistent across. Most of the operations that can be performed with a regular file can be done with any type of file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-4889788244646490769?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/4889788244646490769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=4889788244646490769' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/4889788244646490769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/4889788244646490769'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/03/restroa-unix-file-system.html' title='REST/ROA - UNIX File System'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-1685372315044737129</id><published>2009-02-26T04:35:00.000-08:00</published><updated>2009-02-26T04:58:24.230-08:00</updated><title type='text'>Variadic Macros - Quite Cool!!</title><content type='html'>For the past few days, I have been doing C/CUDA based development. A good break from the the regular Java programming.&lt;br /&gt;&lt;br /&gt;CUDA does not support &lt;span style="font-style: italic;"&gt;printf&lt;/span&gt; function in &lt;span style="font-style: italic;"&gt;non-device emulation mode&lt;/span&gt;. During development we used to switch between emulation and non-emulation mode frequently. The switch was done using a compile time flag.&lt;br /&gt;&lt;br /&gt;We needed a way to remove the all the &lt;span style="font-style: italic;"&gt;printf&lt;/span&gt; calls in non-emulation mode and have them execute in the emulation mode. The solution was to use &lt;span style="font-style: italic;"&gt;Variadic Macro &lt;/span&gt;&lt;span style="font-size:85%;"&gt;(Thanks to my friend who found the existence of such a macro)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Finally our solution was:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#ifdef EMU&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int log(char*msg, ...) {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    va_list args;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    va_start(args, msg);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    return vprintf(msg, args);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#define log(msg, ...)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#endif&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;We used the &lt;span style="font-style: italic;"&gt;log&lt;/span&gt;  variadic macro in our code. Nice learning!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-1685372315044737129?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/1685372315044737129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=1685372315044737129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1685372315044737129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1685372315044737129'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2009/02/variadic-macros-quite-cool.html' title='Variadic Macros - Quite Cool!!'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-1157972428633117664</id><published>2008-12-02T08:38:00.000-08:00</published><updated>2009-07-28T02:02:26.618-07:00</updated><title type='text'>Easy Mock 2.3 on J2SE 1.4</title><content type='html'>Easy Mock 2.x versions provide better API than Easy Mock 1.x versions. But the 2.x versions do not run on J2SE 1.4 versions.&lt;br /&gt;&lt;br /&gt;My current project uses J2SE 1.4. So i had no option but to use Easy Mock 1.2 for testing. Over a weekend i decided to port Easy Mock 2.3 onto J2SE 1.4.&lt;br /&gt;&lt;br /&gt;I have successfully ported EasyMock 2.3 onto J2SE 1.4. I have also added a new &lt;span style="font-weight: bold; font-style: italic;font-family:courier new;" &gt;EasyMockTestCase&lt;/span&gt; to compensate for the lack of static imports in Java 1.4.&lt;br /&gt;&lt;br /&gt;I have hosted the ported code on &lt;a href="http://code.google.com/p/easymock23onjdk14/"&gt;http://code.google.com/p/easymock23onjdk14/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-1157972428633117664?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/1157972428633117664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=1157972428633117664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1157972428633117664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/1157972428633117664'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2008/12/easy-mock-23-on-j2se-14.html' title='Easy Mock 2.3 on J2SE 1.4'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-7555949583762034664</id><published>2008-11-22T18:24:00.000-08:00</published><updated>2008-11-22T20:27:48.224-08:00</updated><title type='text'>Oracle XE "Processes" Parameter</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;Oracle XE is an excellent lightweight substitute for the real Oracle database during development. A good database to run on every developer machine.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;One of the common issues with XE is that the &lt;/span&gt;&lt;span style="font-style: italic;font-family:lucida grande;" &gt;connection refused&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; exceptions  generated when a project test suite consisting of significant number of  database tests is run. This is also true for any database intensive, connection pool application running on Oracle XE.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;This is primarily due to the XE initialization parameter "processes".&lt;br /&gt;&lt;br /&gt;Following is the definition of this parameter as mentioned in the Oracle documentation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3  style="font-style: italic;font-family:courier new;" class="sect2"&gt;&lt;span style="font-size:85%;"&gt;Specifying the Maximum Number of Processes&lt;/span&gt;&lt;/h3&gt; &lt;p  style="font-style: italic;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;The &lt;code&gt;PROCESSES&lt;/code&gt;&lt;a id="sthref410" name="sthref410"&gt;&lt;/a&gt;&lt;a id="sthref411" name="sthref411"&gt;&lt;/a&gt; initialization parameter determines the maximum number of operating system processes that can be connected to Oracle Database concurrently. The value of this parameter must be a minimum of one for each background process plus one for each user process. The number of background processes will vary according the database features that you are using. For example, if you are using Advanced Queuing or the file mapping feature, you will have additional background processes. If you are using Automatic Storage Management, then add three additional processes.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:lucida grande;"&gt;In short the "processes" parameter controls the maximum number of concurrent connections to the database. By default this is set to 50. Increasing this parameter will help in resolution of the &lt;/span&gt;&lt;span style="font-style: italic;font-family:lucida grande;" &gt;"connection refused"&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; issue mentioned above.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Following are the steps to change the parameter.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;1. Connect to the database&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    sqlplus sys as sysdba&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;2. See the value of the process parameter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    show parameter processes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Sample Output&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;NAME                         TYPE     VALUE&lt;br /&gt;------------------------------------ -----------&lt;br /&gt;aq_tm_processes              integer     0&lt;br /&gt;db_writer_processes          integer     1&lt;br /&gt;gcs_server_processes         integer     0&lt;br /&gt;job_queue_processes          integer     4&lt;br /&gt;log_archive_max_processes    integer     2&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;processes                    integer     50&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;3. Change the parameter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    alter system set processes=&lt;span style="font-weight: bold; font-style: italic;"&gt;500&lt;/span&gt; scope=spfile&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-style: italic;"&gt;500&lt;/span&gt; is a sample value, set it to any appropriate value.&lt;/span&gt; &lt;span style="font-style: italic;"&gt;spfile&lt;/span&gt; represents the server parameters file.&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;4. Shutdown the database&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    shutdown immediate&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;5. Start the database&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    startup&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;6. Look at the parameters.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;    show parameter processes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;The processes parameter should have changed to the new value.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;Now running the test suite or any database intense application would not cause the &lt;/span&gt;&lt;span style="font-style: italic;font-family:lucida grande;" &gt;connection refused&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt; error to be generated.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&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/28715187-7555949583762034664?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/7555949583762034664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=7555949583762034664' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/7555949583762034664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/7555949583762034664'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2008/11/oracle-xe-processes-parameter.html' title='Oracle XE &quot;Processes&quot; Parameter'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-115735397048247951</id><published>2006-09-04T00:12:00.000-07:00</published><updated>2006-09-04T00:27:07.806-07:00</updated><title type='text'>try THE catch IN finally</title><content type='html'>&lt;div&gt;As widely known the &lt;span style="font-style: italic;font-family:courier new;" &gt;finally &lt;/span&gt;clause of Java has be implemented as a  mini-subroutine. The subrountine is within the bytecodes of the method  containing the finally clause. &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;The &lt;span style="font-style: italic;"&gt;jsr &lt;/span&gt;instruction cause a local jump to the sub-routine code and &lt;span style="font-style: italic;"&gt;ret  &lt;/span&gt;instruction cause a return from the sub-routine. &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;A very interesting impact of this implementation can be seen below.&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;pre&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;public int &lt;/span&gt;&lt;/span&gt;getNum()&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;int&lt;/span&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;i=2;&lt;br /&gt; &lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;try&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;return&lt;/span&gt; i;&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;finally&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;   i=3;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The return value of the above method is always &lt;span style="font-style: italic;"&gt;2&lt;/span&gt; not &lt;span style="font-style: italic;"&gt;3&lt;/span&gt;. The value change in the &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause doesn't impact the return value.&lt;br /&gt;&lt;br /&gt;The reason behind such a behaviour is as follows.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause is executed prior to the &lt;span style="font-style: italic;"&gt;return &lt;/span&gt;statement as expected. Before jumping to the code in &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause, the return value is popped off from the stack and stored in a local variable. The reason for this action is that in Java &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause can to also place another return value on the stack, can be through a return statement in finally itself.&lt;br /&gt;&lt;br /&gt;So the value of &lt;span style="font-style: italic;"&gt;i&lt;/span&gt; which is &lt;span style="font-style: italic;"&gt;2&lt;/span&gt; is popped-off the stack and stored in a local variable. During the execution of the &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause the value of &lt;span style="font-style: italic;"&gt;i&lt;/span&gt; is altered to &lt;span style="font-style: italic;"&gt;3&lt;/span&gt;. The &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause finishes execution and the control is transferred back to the &lt;span style="font-style: italic;"&gt;return &lt;/span&gt;statement.&lt;br /&gt;&lt;br /&gt;~*~Now the return statement uses the stored value as the return value of the method. The return statement is not evaluated again, implies &lt;span style="font-style: italic;"&gt;i &lt;/span&gt;is not evaluated again, so the change made to&lt;span style="font-style: italic;"&gt; i&lt;/span&gt; in the &lt;span style="font-style: italic;"&gt;finally &lt;/span&gt;clause is ineffective.~*~&lt;br /&gt;&lt;br /&gt;The change can be made effective only by explicitly adding a return statement to return the value of &lt;span style="font-style: italic;"&gt;i&lt;/span&gt; in the &lt;span style="font-style: italic;"&gt;finally&lt;/span&gt; clause.&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/28715187-115735397048247951?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/115735397048247951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=115735397048247951' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/115735397048247951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/115735397048247951'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2006/09/try-catch-in-finally.html' title='try THE catch IN finally'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28715187.post-115703201544879912</id><published>2006-08-31T06:43:00.000-07:00</published><updated>2006-08-31T06:46:55.456-07:00</updated><title type='text'>Java Code Quality for Programmers- Tools for the trade</title><content type='html'>Ensuring code quality is an herculean task in J2EE/Java projects today. Fortunately,a lot of tools that help in improving the quality of the Java language code are available as free and open source software. Using these set tools make the code developed conformant to the standards  right from the outset of the development phase.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Following is a one such list of  usage of different tools to improve the Java code quality that I use in my projects:&lt;br/&gt;&lt;br/&gt;1. IDE customization:  This constitutes the first line of defense. All the developer IDE must be configured with the same rules for Java code and documentation. Be it Eclipse, Netbeans or Rational Application Developer. This ensures that the code is formatted in similar manner across IDEs and the entire code base is coherent. Further, the IDEs provide a 'Format' option that would automatically format the whole code to the specification provided. This step removes almost all developer 'coding standard' errors.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;2.CheckStyle(http://checkstyle.sourceforge.net/): Checkstyle performs a detailed check of code conformance with Java Coding Standards. The tool also points out common functional errors made by programmers. A Checkstyle configuration file customized for the current project coding standards should be created and distributed to the team. This is a better way of communicating the project coding guidelines than a verbal discourse or a huge MS Word/PDF document.Checkstyle plug-ins are available for almost all the popular IDEs. The project Checkstyle configuration can be fed to the IDE plug-in so that  any non-conformance is immediately highlighted to the developer in the code. This ensures the code developed is in line with the project coding standards.&lt;br/&gt;&lt;br/&gt;3. FindBugs(http://findbugs.sourceforge.net/): FindBugs inspects the  Java byte code for bug patterns. Running FindBugs on the code developed reveals a set of issues, majority of runtime bugs, that cannot be caught by the source code analysis tools. Again plug-ins are available for popular IDEs.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Note: Checkstyle and FindBugs can be used without an IDE. The IDE integration is a just an option and left to the discretion of the developer.&lt;br/&gt;&lt;br/&gt;Once the above steps/tools have been performed on the code by the developer. The code is ready for the review  phase.&lt;br/&gt;&lt;br/&gt;Usage of such tools by developers, provide them with a lot of learning about the standards, do's and don'ts of Java programming. These tools  free the reviewers from delving into code level laborious issues like documentation, indentation etc, which are best done with automated tools. The reviewer can use the same tools or tools like PMD(http://pmd.sourceforge.net/) and JNCSS(http://www.kclee.de/clemens/java/javancss/) to determine design issues, code complexity.etc.&lt;br/&gt;&lt;br/&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28715187-115703201544879912?l=sriki77.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sriki77.blogspot.com/feeds/115703201544879912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28715187&amp;postID=115703201544879912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/115703201544879912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28715187/posts/default/115703201544879912'/><link rel='alternate' type='text/html' href='http://sriki77.blogspot.com/2006/08/java-code-quality-for-programmers.html' title='Java Code Quality for Programmers- Tools for the trade'/><author><name>Sriki</name><uri>http://www.blogger.com/profile/13130163896405586839</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://3.bp.blogspot.com/_lbwjjmTvrvk/Sh1k4TfqEXI/AAAAAAAAAB4/cIPl5FPm8BE/S220/sf_small.png'/></author><thr:total>0</thr:total></entry></feed>
