<?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-7941666868022023550</id><updated>2012-02-12T19:44:50.753-08:00</updated><title type='text'>Not Just Another Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-8352417767583489729</id><published>2012-02-10T01:40:00.000-08:00</published><updated>2012-02-10T01:40:16.326-08:00</updated><title type='text'>Time Based SQL Injection using heavy queries in MySQL</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;During my work I had to test Time Based SQL Injection in MySQL. But many blogs showcased ways to achieve this using SLEEP() and BENCHMARK() routines. SLEEP() routine is not available in MySQL 4.0 so the correct routine should be used based on the MySQL version.&lt;br /&gt;&lt;br /&gt;There is another approach for Time Based SQL Injection which is Time Based SQL Injection using heavy queries. This is used for Databases which do not have timing routines such Oracle.&lt;br /&gt;&lt;br /&gt;But to test effectively both 4.0 and 5.0 versions of MySQL I had to write a Time Based SQL Injection using heavy queries. After some googling and reading articles I came up with the following query which produces a half a second delay.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;SELECT * FROM &amp;lt;ANY TABLE NAME&amp;gt; WHERE 1=1 AND&lt;br /&gt;(SELECT COUNT(*)&lt;br /&gt; FROM information_schema.columns AS col1&lt;br /&gt; NATURAL JOIN information_schema.columns AS col2,&lt;br /&gt;information_schema.columns AS col3,&lt;br /&gt; information_schema.columns AS col4,&lt;br /&gt; information_schema.columns AS col5,&lt;br /&gt; information_schema.columns AS col6,&lt;br /&gt; information_schema.columns AS col7,&lt;br /&gt; information_schema.columns AS col8,&lt;br /&gt;information_schema.columns AS col9,&lt;br /&gt;information_schema.columns AS col10)=0&lt;br /&gt;AND 300&amp;gt;&lt;br /&gt;(SELECT ASCII(SUBSTRING(table_name,1,1))&lt;br /&gt; FROM information_schema.columns&lt;br /&gt; ORDER BY table_name&lt;br /&gt; LIMIT 1);&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;This was tested on MySQL 5.0 with information_schema.columns table containing 346 rows.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-8352417767583489729?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/8352417767583489729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=8352417767583489729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8352417767583489729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8352417767583489729'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2012/02/time-based-sql-injection-using-heavy.html' title='Time Based SQL Injection using heavy queries in MySQL'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-1784836402473775479</id><published>2012-01-30T00:14:00.000-08:00</published><updated>2012-01-30T00:44:43.699-08:00</updated><title type='text'>Thread Safe Blocking List</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In Java Concurrent Package there are many useful concurrent synchronizer classes such as BlockingQueue, Semaphore, CountDownLatch and CyclicBarrier. But what if we want an bounded List with insertion order preserved where if the upper limit of the List is met new insertions must be blocked until some elements are removed. The following BlockingList implementation does exactly that. This List uses a Semaphore to synchronize the flow of adding and removing. When the maximum amount of elements are in the List and another call to add is made, the add will be blocked until an element is removed from the List.&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.util.*;&lt;br /&gt;import java.util.concurrent.*;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;public class BlockingList&amp;lt;T&amp;gt; {&lt;br /&gt;    private final Semaphore semaphore;&lt;br /&gt;    private final List&amp;lt;T&amp;gt; list = Collections.synchronizedList(new ArrayList&amp;lt;T&amp;gt;());&lt;br /&gt;&lt;br /&gt;    public BlockingList(int max) {&lt;br /&gt;        semaphore = new Semaphore(max);        &lt;br /&gt;    }    &lt;br /&gt;&lt;br /&gt;    public boolean add(T t) throws InterruptedException {&lt;br /&gt;        semaphore.acquire();&lt;br /&gt;        boolean result = false;&lt;br /&gt;        try {&lt;br /&gt;            result = list.add(t);&lt;br /&gt;        } finally {&lt;br /&gt;            if(!result) {&lt;br /&gt;                semaphore.release();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return result;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public T remove(int index) {&lt;br /&gt;        T result = null;&lt;br /&gt;        try {&lt;br /&gt;            result = list.remove(index);&lt;br /&gt;        } finally {&lt;br /&gt;            if(result != null) {&lt;br /&gt;                semaphore.release();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return result;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public T get(int index) {&lt;br /&gt;        return list.get(index);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public int indexOf(T t) {&lt;br /&gt;        return list.indexOf(t);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public T removeIfPresent(T t) {&lt;br /&gt;        T result = null;&lt;br /&gt;        synchronized(list) {&lt;br /&gt;            if(list.contains(t)) {&lt;br /&gt;                result = remove(indexOf(t));&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return result;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public boolean putIfAbsent(T t) throws InterruptedException {&lt;br /&gt;        boolean result = false;&lt;br /&gt;        synchronized(list) {&lt;br /&gt;            if(!list.contains(t) &amp;amp;&amp;amp; semaphore.availablePermits() != 0) {&lt;br /&gt;                result = add(t);&lt;br /&gt;            }&lt;br /&gt;        }    &lt;br /&gt;        return result;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-1784836402473775479?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/1784836402473775479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=1784836402473775479' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1784836402473775479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1784836402473775479'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2012/01/blocking-list.html' title='Thread Safe Blocking List'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-595773611904902684</id><published>2012-01-18T01:51:00.000-08:00</published><updated>2012-01-18T01:51:39.105-08:00</updated><title type='text'>IBM CMOD Folder Field Default Value Retrieval Using ODWEK API</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;IBM Content Manager on Demand (CMOD) is a Enterprise Content Management system which enables to archive resource files and retrieve them whenever required. It has two different methods to access the resources.&lt;br /&gt;&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;A Set of Executable Files (.EXE or .OUT) which can be used to manage the resources.&lt;/li&gt;&lt;li&gt;On Demand Web Enable Kit (ODWEK) which is an API which can be used by any external application.&lt;/li&gt;&lt;/ol&gt;ODWEK is used by IBM Webi (Web Interface of CMOD) to manage the resources.&lt;br /&gt;&lt;br /&gt;As part of my work I had to retrieve Default values of Fields specified in each Application Group in their respective Folder so that any external application can make use of the Default Values.&lt;br /&gt;&lt;br /&gt;After some googling and trial and error I found out that it can be done using the ODCriteria.getSearchValues() method which would return a String array of Default values per field. The following code does the required.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.util.Enumeration;&lt;br /&gt;&lt;br /&gt;import com.ibm.edms.od.ODConfig;&lt;br /&gt;import com.ibm.edms.od.ODCriteria;&lt;br /&gt;import com.ibm.edms.od.ODFolder;&lt;br /&gt;import com.ibm.edms.od.ODServer;&lt;br /&gt;/**&lt;br /&gt; * ODWEK Testing Class&lt;br /&gt; * &lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class ODWEKTest {&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        ODConfig odConfig = new ODConfig();        &lt;br /&gt;        ODServer server = new ODServer(odConfig);&lt;br /&gt;        server.setUserId("administrator");&lt;br /&gt;        server.setPassword("1234567");&lt;br /&gt;        server.setPort(12238);&lt;br /&gt;        server.setServerName("localhost");&lt;br /&gt;        &lt;br /&gt;        try {&lt;br /&gt;            server.initialize("ODPing");        &lt;br /&gt;            server.logon();&lt;br /&gt;            Enumeration&amp;lt;ODFolder&amp;gt; folders = server.getFolders(); &lt;br /&gt;            if(folders != null) {&lt;br /&gt;                while(folders.hasMoreElements()) {&lt;br /&gt;                    ODFolder folder = folders.nextElement();&lt;br /&gt;                    try {&lt;br /&gt;                        folder.open();&lt;br /&gt;                    } catch(Exception e) {&lt;br /&gt;                        continue;&lt;br /&gt;                    }&lt;br /&gt;                    System.out.println("Folder : "+folder.getName());&lt;br /&gt;                    Enumeration&amp;lt;ODCriteria&amp;gt; fields = folder.getCriteria();&lt;br /&gt;                    while(fields.hasMoreElements()) {&lt;br /&gt;                        ODCriteria field = fields.nextElement();&lt;br /&gt;                        System.out.println("\tField : "+field.getName());&lt;br /&gt;                        String[] fixedValues = field.getSearchValues();                        &lt;br /&gt;                        if(fixedValues != null) {&lt;br /&gt;                            for(String dv:fixedValues) {&lt;br /&gt;                                System.out.println("\t\tDefault Value : "+dv);&lt;br /&gt;                            }&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                    folder.close();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        } catch(Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        } finally {&lt;br /&gt;            try {&lt;br /&gt;                server.logoff();&lt;br /&gt;            } catch (Exception e) {                &lt;br /&gt;                e.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;            server.terminate();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;ODApi.jar is required and java.library.path VM Argument must be set to point to the ODWEK Installation Directory in order to load required Libraries&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-595773611904902684?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/595773611904902684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=595773611904902684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/595773611904902684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/595773611904902684'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2012/01/ibm-cmod-folder-field-default-value.html' title='IBM CMOD Folder Field Default Value Retrieval Using ODWEK API'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-1014658282431254082</id><published>2011-12-22T01:16:00.000-08:00</published><updated>2011-12-22T01:16:23.452-08:00</updated><title type='text'>Batch File to Make Copies of a File in a Loop</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;During my work time I had to create a batch of files from a single file so that those can be used to load test a system. I wrote small batch file which does the job&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;SET /p NOOFFILES="No Of Files : "&lt;br /&gt;SET I=0&lt;br /&gt;SET COPYCMD=/Y&lt;br /&gt;:Start&lt;br /&gt;CP ./File.zip ./File-%I%.zip&lt;br /&gt;SET /a I+=1&lt;br /&gt;IF %NOOFFILES% == %I% (&lt;br /&gt;    GOTO End&lt;br /&gt;) ELSE ( &lt;br /&gt;    GOTO Start&lt;br /&gt;)&lt;br /&gt;:End&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;The script first prompts for the no of files which needs to be created and then creates those files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-1014658282431254082?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/1014658282431254082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=1014658282431254082' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1014658282431254082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1014658282431254082'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/12/batch-file-to-make-copies-of-file-in.html' title='Batch File to Make Copies of a File in a Loop'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-1627494755843829500</id><published>2011-12-02T01:53:00.001-08:00</published><updated>2012-01-24T02:03:03.062-08:00</updated><title type='text'>A Comparison of CountDownLatch, CyclicBarrier and Semaphore</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Recently I have been developing some applications with multithreading using java. And I wanted to use waiting of all Child Threads to finish in order to continue on with the Parent thread. I did some research and found out that from Java 1.5 onwards there have been some classes introduced within java.util.concurrent package where the scenario I am trying to create can be. the classes are;&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;CountDownLatch&lt;/li&gt;&lt;li&gt;CyclicBarrier&lt;/li&gt;&lt;li&gt;Semaphore&lt;/li&gt;&lt;/ul&gt;CountDownLatch and CyclicBarrier on the first look seems to do the same task and I read some blogs where they have tried to explain the difference of the two. Most common differences many were saying were;&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt; CountDownLatch can not be reused after meeting the final count.&lt;/li&gt;&lt;li&gt;CountDownLatch can not be used to wait for Parallel Threads to finish.&lt;/li&gt;&lt;li&gt;CyclicBarrier can be reset thus reused&lt;/li&gt;&lt;li&gt;CyclicBarrier can be used to wait for Parallel Threads to finish.&lt;/li&gt;&lt;/ol&gt;From these explanation the picture I got was this;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-zQq_On3SjFs/TtieWrr-2TI/AAAAAAAAAYI/f_-rNXU-tc8/s1600/CyclicBarrierVsCountDownLatch.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="144" src="http://3.bp.blogspot.com/-zQq_On3SjFs/TtieWrr-2TI/AAAAAAAAAYI/f_-rNXU-tc8/s320/CyclicBarrierVsCountDownLatch.PNG" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;If a Main thread creates 5 different thread. CountDownLatch can be used by the Main Thread to wait on the Child Threads. Where as CyclicBarrier can be used to enable waiting on Threads until each other finish.&lt;br /&gt;Thus CountDownLatch is a top down waiting where as CyclicBarrier is across waiting.&lt;br /&gt;&lt;br /&gt;But this wasn't convincing enough for me because no blog clearly explained the practical usage of the two classes. Furthermore there weren't not much talk about the powerful Semaphore class in those either. So I did some testing on that too and this is what I found out.&lt;br /&gt;&lt;br /&gt;I try to explain the Theoretical as well as Practical use of the 3 classes. Ok here goes.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;CountDownLatch&lt;/b&gt; can be used to monitor the completion of the Children Threads if the size of the created children is known forehand. CountDownLatch enables a Thread or Threads to wait for completion of Children Threads. But there is no waiting amongst the Children until they finish each others tasks. Children may execute asynchronously and after their work is done will exit making a countdown. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Practical Example&lt;/b&gt; : Main thread creates 10 Database Connections and Creates 10 different Threads and assigns those DB connection to the threads one each. But the Main thread must wait until all 10 Threads finish their DB Operation before closing the DB Connections. Children will exit after performing the DB Operation. A CountDownLatch can be used in this scenario.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.util.concurrent.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;import java.text.*;&lt;br /&gt;/**&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class CountDownLatchTest {&lt;br /&gt;    private static final int MAX_THREADS = 5;&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) throws Exception {&lt;br /&gt;        CountDownLatch countDownLatch = new CountDownLatch(MAX_THREADS);&lt;br /&gt;    &lt;br /&gt;        System.out.println("Spawning Threads");&lt;br /&gt;        for(int i=0;i&amp;lt;MAX_THREADS;i++) {&lt;br /&gt;            Thread t = new Thread(new WorkerThread(countDownLatch, String.format("Thread-%d", i)));&lt;br /&gt;            t.start();&lt;br /&gt;        }&lt;br /&gt;        System.out.println("Spawning Finished");&lt;br /&gt;        System.out.println("Waiting All Threads to Finish");&lt;br /&gt;        countDownLatch.await(); // Await is void&lt;br /&gt;        System.out.println("All Threads are Finished");&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    private static class WorkerThread implements Runnable {&lt;br /&gt;        private CountDownLatch countDownLatch;&lt;br /&gt;        &lt;br /&gt;        private String name;&lt;br /&gt;        &lt;br /&gt;        public WorkerThread(CountDownLatch countDownLatch, String name) {&lt;br /&gt;            this.name = name;&lt;br /&gt;            this.countDownLatch = countDownLatch;&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public void run() {&lt;br /&gt;            try {&lt;br /&gt;                SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");                &lt;br /&gt;                System.out.printf("%s : Doing Some Work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Doing Some more work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Finished work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                countDownLatch.countDown(); &lt;br /&gt;                System.out.printf("%s : Count Down Latch count on %s is %d\n", getFormattedDate(sdf), name, countDownLatch.getCount());&lt;br /&gt;            } catch(Exception e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private String getFormattedDate(SimpleDateFormat sdf) {&lt;br /&gt;            return sdf.format(new Date());&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private int getRandomWaitTime() {&lt;br /&gt;            return (int) ((Math.random() + 1) * 1000);&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;CyclicBarrier&lt;/b&gt; can be used to create a set of Children Threads if the size of the Threads created is known forehand. CyclicBarrier can be used to implement waiting amongst Children Threads until all of them finish. This is useful where parallel threads needs to perform a job which requires sequential execution. For example 10 Threads doing steps 1, 2, 3, but all 10 Threads should finish step one before any can do step 2. Cyclic barrier can be reset after all Threads are finished execution. This is a distinguishing feature from a CountDownLatch. A CountDownLatch can only be used for a single count down. Additionally a CyclicBarrier can be assigned an Additional Thread which executes each time all the Children Threads finish their respective tasks. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Practical Example&lt;/b&gt; : Processing of a Image Pixels Matrix row by row in the first step and in the second step saving the Pixel values to file row by row. In this scenario if there are 10 Threads running simultaneously to process the matrix row by row then all 10 should wait until all are finished before they move on to the next step which is saving those rows to file. &lt;br /&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.util.concurrent.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;import java.text.*;&lt;br /&gt;/**&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class CyclicBarrierTest {&lt;br /&gt;    private static final int MAX_THREADS = 5;&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        CyclicBarrier cyclicBarrier = new CyclicBarrier(MAX_THREADS, new Runnable() {&lt;br /&gt;            private int count = 1;&lt;br /&gt;        &lt;br /&gt;            public void run() {&lt;br /&gt;                System.out.printf("Cyclic Barrier Finished %d\n", count++);&lt;br /&gt;            }&lt;br /&gt;        });&lt;br /&gt;    &lt;br /&gt;        System.out.println("Spawning Threads");&lt;br /&gt;        for(int i=0;i&amp;lt;MAX_THREADS;i++) {&lt;br /&gt;            Thread t = new Thread(new WorkerThread(cyclicBarrier, String.format("Thread-%d", i)));&lt;br /&gt;            t.start();&lt;br /&gt;        }&lt;br /&gt;        System.out.println("Spawning Finished");&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    private static class WorkerThread implements Runnable {&lt;br /&gt;        private CyclicBarrier cyclicBarrier;&lt;br /&gt;        &lt;br /&gt;        private String name;&lt;br /&gt;        &lt;br /&gt;        public WorkerThread(CyclicBarrier cyclicBarrier, String name) {&lt;br /&gt;            this.name = name;&lt;br /&gt;            this.cyclicBarrier = cyclicBarrier;&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public void run() {&lt;br /&gt;            try {&lt;br /&gt;                SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");                &lt;br /&gt;                System.out.printf("%s : Doing Step 1 Work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Doing Step 1 more work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Finished Step 1 work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                int count = cyclicBarrier.await(); // Await returns an int which is the arrival index 1 means first 0 means last&lt;br /&gt;                System.out.printf("%s : Cyclic Barrier count on %s is %d\n", getFormattedDate(sdf), name, count);&lt;br /&gt;                if(count == 0) {&lt;br /&gt;                    cyclicBarrier.reset();&lt;br /&gt;                }&lt;br /&gt;                System.out.printf("%s : Doing Step 2 Batch of Work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Doing Some more Step 2 Batch of work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Finished Step 2 Batch of work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                count = cyclicBarrier.await();&lt;br /&gt;                System.out.printf("%s : Cyclic Barrier count end of Step 2 Batch of work on %s is %d\n", getFormattedDate(sdf), name, count);&lt;br /&gt;            } catch(Exception e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private String getFormattedDate(SimpleDateFormat sdf) {&lt;br /&gt;            return sdf.format(new Date());&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private int getRandomWaitTime() {&lt;br /&gt;            return (int) ((Math.random() + 1) * 1000);&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: transparent; color: black; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;Semaphore&lt;/b&gt; can be used to create a set of Children Threads even when the size of the Threads to be created is not known fore hand. This is because a Semaphore can wait until a number of releases have been made but that number is not required to initialize the Semaphore. Semaphores can be used in other scenarios such as Synchronizing between different threads such as Publisher, Subscriber scenario. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Practical Example&lt;/b&gt; : Traversing through a folder with sub folders within sub folders and if&amp;nbsp; JPEG files are found, move them to a destination directory and then zip them. In this scenario the folder traversing is done recursively until a JPEG file is found. And then a Thread is invoked to move it to destination directory. But zipping needs to wait until all JPEG files are moved to the destination directory. In this scenario no of JPEG files available in the folder structure is not known but the zipping needs to wait till all files are successfully moved. Ideal scenario for a Semaphore based waiting.&lt;br /&gt;&lt;div style="font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.util.concurrent.*;&lt;br /&gt;import java.util.*;&lt;br /&gt;import java.text.*;&lt;br /&gt;/**&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;public class SemaphoreTest {&lt;br /&gt;    private static final int MAX_THREADS = 5;&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) throws Exception {&lt;br /&gt;        Semaphore semaphore = new Semaphore(0);&lt;br /&gt;&lt;br /&gt;        System.out.println("Spawning Threads");&lt;br /&gt;        int threadCount = 0;&lt;br /&gt;        Random random = new Random();&lt;br /&gt;        for(int i=0;i&amp;lt;MAX_THREADS;i++) {&lt;br /&gt;            // Threads created will not always be MAX_THREADS&lt;br /&gt;            // Because Threads are created only if Random no is Even.&lt;br /&gt;            // Thus the No of Threads unknown at Semaphore Initialization&lt;br /&gt;            if(random.nextInt(9999) % 2 == 0) {&lt;br /&gt;                Thread t = new Thread(new WorkerThread(semaphore, String.format("Thread-%d", i)));&lt;br /&gt;                t.start();&lt;br /&gt;                threadCount++;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        System.out.println("Spawning Finished");&lt;br /&gt;        System.out.println("Waiting All Threads to Finish");&lt;br /&gt;        semaphore.acquire(threadCount); &lt;br /&gt;        System.out.println("All Threads are Finished");&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    private static class WorkerThread implements Runnable {&lt;br /&gt;        private Semaphore semaphore;&lt;br /&gt;        &lt;br /&gt;        private String name;&lt;br /&gt;        &lt;br /&gt;        public WorkerThread(Semaphore semaphore, String name) {&lt;br /&gt;            this.name = name;&lt;br /&gt;            this.semaphore = semaphore;&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        public void run() {&lt;br /&gt;            try {                &lt;br /&gt;                SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");                &lt;br /&gt;                System.out.printf("%s : Doing Some Work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Doing Some more work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                Thread.sleep(getRandomWaitTime());&lt;br /&gt;                System.out.printf("%s : Finished work on %s\n", getFormattedDate(sdf), name);&lt;br /&gt;                semaphore.release();                &lt;br /&gt;            } catch(Exception e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private String getFormattedDate(SimpleDateFormat sdf) {&lt;br /&gt;            return sdf.format(new Date());&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        private int getRandomWaitTime() {&lt;br /&gt;            return (int) ((Math.random() + 1) * 1000);&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;In conclusion, Each task has its separate unique use and it is Software Engineer's responsibility to understand which one is more suitable for the scenario they have to solve. In my case however CountDownLatch was the ideal one and I used it with pretty much success. It is advised to use these classes instead of trying to implement similar behavior on our own because they are developed and tested by Sun Microsystems expert Engineers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-1627494755843829500?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/1627494755843829500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=1627494755843829500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1627494755843829500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1627494755843829500'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/12/comparison-of-countdownlatch.html' title='A Comparison of CountDownLatch, CyclicBarrier and Semaphore'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-zQq_On3SjFs/TtieWrr-2TI/AAAAAAAAAYI/f_-rNXU-tc8/s72-c/CyclicBarrierVsCountDownLatch.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-203491392976044969</id><published>2011-11-27T22:26:00.001-08:00</published><updated>2011-11-27T23:44:14.191-08:00</updated><title type='text'>Java Source Code Hiding</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was thinking of a way to hide complex algorithms in source code and it turns out that Java Compiler can compile source code with unicode code character encoding. So for instance a typical HelloWorld class like this&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;public class HelloWorld {&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        System.out.println("Hello, World!");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&amp;nbsp; &lt;br /&gt;Can be written as&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;\u0070\u0075\u0062\u006C\u0069\u0063\u0020\u0063\u006C\u0061\u0073\u0073\u0020\u0048\u0065\u006C\u006C\u006F\u0057\u006F\u0072\u006C\u0064\u0020\u007B\u0009\u0070\u0075\u0062\u006C\u0069\u0063\u0020\u0073\u0074\u0061\u0074\u0069\u0063\u0020\u0076\u006F\u0069\u0064\u0020\u006D\u0061\u0069\u006E\u0028\u0053\u0074\u0072\u0069\u006E\u0067\u005B\u005D\u0020\u0061\u0072\u0067\u0073\u0029\u0020\u007B\u0009\u0009\u0053\u0079\u0073\u0074\u0065\u006D\u002E\u006F\u0075\u0074\u002E\u0070\u0072\u0069\u006E\u0074\u006C\u006E\u0028\u0022\u0048\u0065\u006C\u006C\u006F\u002C\u0020\u0057\u006F\u0072\u006C\u0064\u0021\u0022\u0029\u003B\u0009\u007D\u007D&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;And it would compile just fine using javac and will run and print Hello, World!.I wrote a small application which converts any java source file to Unicode encoding so that you can hide your source within your computer from people who have access.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.io.*;&lt;br /&gt;/*&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; */&lt;br /&gt;public class JavaUnicodeEncoding {&lt;br /&gt;    public static void main(String[] args) throws Exception {&lt;br /&gt;        BufferedReader br = null;&lt;br /&gt;        BufferedWriter bw = null;&lt;br /&gt;        try {&lt;br /&gt;            br = new BufferedReader(new FileReader(args[0]));&lt;br /&gt;            bw = new BufferedWriter(new FileWriter(args[1]));&lt;br /&gt;            String line = null;&lt;br /&gt;            while((line = br.readLine()) != null) {&lt;br /&gt;                for(char c:line.toCharArray()) {&lt;br /&gt;                    bw.write(String.format("\\u%04X",(int) c));&lt;br /&gt;                }&lt;br /&gt;                bw.flush();&lt;br /&gt;            }&lt;br /&gt;        } catch(ArrayIndexOutOfBoundsException e) {&lt;br /&gt;            usage();&lt;br /&gt;        } catch(Exception e) {&lt;br /&gt;            System.err.println(e.getMessage());&lt;br /&gt;        } finally {&lt;br /&gt;            if(br != null) {&lt;br /&gt;                br.close();&lt;br /&gt;            }&lt;br /&gt;            &lt;br /&gt;            if(bw != null) {&lt;br /&gt;                bw.close();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    private static void usage() {&lt;br /&gt;        System.out.println("java JavaUnicodeEncoding &amp;lt;input class filename /&amp;gt; &amp;lt;output class filename/&amp;gt;");&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;You can even use the two interchangeably also &lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;public class HelloWorld {&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        \u0053\u0079\u0073\u0074\u0065\u006D\u002E\u006F\u0075\u0074\u002E\u0070\u0072\u0069\u006E\u0074\u006C\u006E\u0028\u0022\u0048\u0065\u006C\u006C\u006F\u002C\u0020\u0057\u006F\u0072\u006C\u0064\u0021\u0022\u0029\u003B&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-203491392976044969?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/203491392976044969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=203491392976044969' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/203491392976044969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/203491392976044969'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/11/java-source-code-hiding.html' title='Java Source Code Hiding'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-1123362981617216911</id><published>2011-11-24T22:28:00.001-08:00</published><updated>2011-11-24T22:35:35.551-08:00</updated><title type='text'>DOS Batch File to Periodically Copy Files to a Location</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;During a Testing I had to do at my workplace I had to copy files to an input location at a random time so that there would be a constant supply of input files. I did some googling and found out several commands and integrated those together to create a batch file which can do that. The waiting is done using a ping command with a timeout. The timeout is taken from the system environment variable RANDOM so that it pauses for a random amount of time before copying files. After copying files I do a clean up on output files so that the storage is not spiked.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;:again&lt;br /&gt;&lt;br /&gt;SET COPYCMD=/Y&lt;br /&gt;&lt;br /&gt;ping 123.45.67.89 -n 1 -w %RANDOM% &amp;gt; nul&lt;br /&gt;&lt;br /&gt;xcopy &amp;lt;Source Folder with Files&amp;gt;\* &amp;lt;Destination Folder with Files&amp;gt; /s &lt;br /&gt;&lt;br /&gt;del /q &amp;lt;Folder Where Files to be Deleted Available&amp;gt;\*&lt;br /&gt;&lt;br /&gt;goto again&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;COPYCMD Environment Variable is used to Enable overwriting of existing files without prompting.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-1123362981617216911?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/1123362981617216911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=1123362981617216911' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1123362981617216911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1123362981617216911'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/11/dos-batch-file-to-periodically-copy.html' title='DOS Batch File to Periodically Copy Files to a Location'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-4285254924166405057</id><published>2011-11-19T01:33:00.001-08:00</published><updated>2011-12-21T21:35:39.869-08:00</updated><title type='text'>Arduino Google Voice Activated Servo Motor Controlling using Android</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was having some free time and wanted to put learn Android development. I found a Great Android Application called &lt;a href="http://code.google.com/p/android-scripting/"&gt;SL4A&lt;/a&gt;&amp;nbsp;(Scripting Layer for Android) which is an intermediate Android app which sits between the Android OS native methods and popular scripting languages such as Shell Script, Python, Perl etc.&lt;br /&gt;&lt;br /&gt;It opens up many possibilities to develop applications in Android really quickly with interpreted languages like Python. I always wanted to try out Door unlocking with an Android Google Voice API. For this system I wanted to connect to Wifi network and given the Voice command open or close a Door lock. So I came up with the following Circuit using Arduino;&lt;br /&gt;&lt;br /&gt;Things required to build the Prototype.&lt;br /&gt;&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;One Arduino (Any model)&lt;/li&gt;&lt;li&gt;A Breadboard&lt;/li&gt;&lt;li&gt;A Servo Motor&lt;/li&gt;&lt;li&gt;Two LEDs (Green and Red)&lt;/li&gt;&lt;li&gt;Two 1K resistors for LEDs&lt;/li&gt;&lt;li&gt;Jumper Cables&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Using the above mentioned equipment I put up the following prototype.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-BIBcVCjjQ2c/Tsd61VNX66I/AAAAAAAAAYA/4XxSJjgrkpk/s1600/SpeechDoor_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="195" src="http://2.bp.blogspot.com/-BIBcVCjjQ2c/Tsd61VNX66I/AAAAAAAAAYA/4XxSJjgrkpk/s320/SpeechDoor_bb.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The Green LED is driven using Pin 2, The Red LED is driven using Pin 3 and the Servo motor is attached to Pin 9 (Analog Output with PWM).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Android phone I have is a Samsung Galaxy ACE with Android OS 2.3.3 Gingerbread. I installed SL4A and &amp;nbsp;Python for Android to enable Python Scripting in Android.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;#=======================================&lt;br /&gt;#=          Shazin Sadakath            =&lt;br /&gt;#=======================================&lt;br /&gt;&lt;br /&gt;import android&lt;br /&gt;import socket&lt;br /&gt;# Android API Object SL4A Specific&lt;br /&gt;droid = android.Android();&lt;br /&gt;&lt;br /&gt;# Hostname or IP&lt;br /&gt;hostname = "192.168.1.65";&lt;br /&gt;# Port&lt;br /&gt;port = 10000;&lt;br /&gt;data = "";&lt;br /&gt;# Creating a UDP Socket&lt;br /&gt;s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM);&lt;br /&gt;# Connecting to Host (Usually not required since it is UDP)&lt;br /&gt;s.connect((hostname,port));&lt;br /&gt;print "Connected!";&lt;br /&gt;&lt;br /&gt;exit = False;&lt;br /&gt;while not exit:&lt;br /&gt;  # Using Android API for Google Voice and Recognizing command&lt;br /&gt;  data = droid.recognizeSpeech().result;&lt;br /&gt;  # Command is open or close proceding it to the Server else Error message&lt;br /&gt;  if data == "open" or data == "close":&lt;br /&gt;    # Sending command&lt;br /&gt;    s.sendto(data,(hostname,port));&lt;br /&gt;    # Recieving an ACK since UDP is unreliable &lt;br /&gt;    data = s.recvfrom(1024);    &lt;br /&gt;    print "Ack ", data[0];&lt;br /&gt;    # If ACK is success ending the program&lt;br /&gt;    if data[0] == "success":&lt;br /&gt;      exit = True;&lt;br /&gt;  else:&lt;br /&gt;    print "Invalid Command";&lt;br /&gt;   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;The Middle Man in this application is a Java Thread based UDP Server which listens for UDP packets froma connected Android app and Does the Serial communication to the Arduino Microcontroller.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;import java.net.DatagramPacket;&lt;br /&gt;import java.net.DatagramSocket;&lt;br /&gt;import java.net.SocketException;&lt;br /&gt;import java.util.logging.Level;&lt;br /&gt;import java.util.logging.Logger;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; */&lt;br /&gt;public class SpeechDoor implements Runnable {&lt;br /&gt;    private DatagramSocket socket;&lt;br /&gt;&lt;br /&gt;    public SpeechDoor() {&lt;br /&gt;        try {&lt;br /&gt;            ArduinoBridge.init("COM27");&lt;br /&gt;            socket = new DatagramSocket(10000);&lt;br /&gt;            new Thread(this).start();&lt;br /&gt;        } catch (SocketException ex) {&lt;br /&gt;            Logger.getLogger(SpeechDoor.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void run() {&lt;br /&gt;        byte[] data;&lt;br /&gt;        boolean success;&lt;br /&gt;        DatagramPacket recv, ack;&lt;br /&gt;        while (true) {&lt;br /&gt;            try {&lt;br /&gt;                data = new byte[1024];&lt;br /&gt;                success = false;&lt;br /&gt;                recv = new DatagramPacket(data, data.length);&lt;br /&gt;                System.out.printf("Waiting on Socket : %s:%d\n", socket.getLocalAddress().toString(), socket.getPort());&lt;br /&gt;                socket.receive(recv);&lt;br /&gt;                System.out.printf("Packet Recieved From : %s:%d\n", recv.getAddress().toString(), recv.getPort());&lt;br /&gt;                String value = new String(data, recv.getOffset(), recv.getLength());&lt;br /&gt;                System.out.printf("Value : %s\n", value);&lt;br /&gt;                if("open".equals(value)) {&lt;br /&gt;                    ArduinoBridge.writeToArduino((byte) 1);&lt;br /&gt;                    success = true;&lt;br /&gt;                } else if("close".equals(value)) {&lt;br /&gt;                    ArduinoBridge.writeToArduino((byte) 2);&lt;br /&gt;                    success = true;&lt;br /&gt;                }&lt;br /&gt;                if(success) {&lt;br /&gt;                    data = "success".getBytes();                    &lt;br /&gt;                } else {&lt;br /&gt;                    data = "fail".getBytes();&lt;br /&gt;                }&lt;br /&gt;                ack = new DatagramPacket(data, data.length, recv.getAddress(), recv.getPort());&lt;br /&gt;                socket.send(ack);&lt;br /&gt;                success = false;&lt;br /&gt;                Thread.sleep(1000);&lt;br /&gt;            } catch (Exception ex) {&lt;br /&gt;                Logger.getLogger(SpeechDoor.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void main(String[] args) {&lt;br /&gt;        new SpeechDoor();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Arduino Serial Communication is done using the RXTX Library for Serial Communication.&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;import gnu.io.CommPortIdentifier;&lt;br /&gt;import gnu.io.SerialPort;&lt;br /&gt;import java.io.OutputStream;&lt;br /&gt;import java.util.Enumeration;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; */&lt;br /&gt;public class ArduinoBridge {&lt;br /&gt;&lt;br /&gt;    private static SerialPort port = null;&lt;br /&gt;    private static CommPortIdentifier cpi = null;&lt;br /&gt;&lt;br /&gt;    public static void init(String p) {&lt;br /&gt;        Enumeration enums = CommPortIdentifier.getPortIdentifiers();&lt;br /&gt;&lt;br /&gt;        while (enums.hasMoreElements()) {&lt;br /&gt;            cpi = (CommPortIdentifier) enums.nextElement();&lt;br /&gt;            if (p.equals(cpi.getName())) {&lt;br /&gt;                break;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        if (cpi != null) {&lt;br /&gt;            try {&lt;br /&gt;                port = (SerialPort) cpi.open("ArduinoJavaBridge", 1000);&lt;br /&gt;                if (port != null) {&lt;br /&gt;                    port.setSerialPortParams(9600,&lt;br /&gt;                            SerialPort.DATABITS_8,&lt;br /&gt;                            SerialPort.STOPBITS_1,&lt;br /&gt;                            SerialPort.PARITY_NONE);&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                System.out.println("Ready!");&lt;br /&gt;                //new Thread(new ArduinoBridge()).start();&lt;br /&gt;&lt;br /&gt;            } catch (Exception e) {&lt;br /&gt;                e.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public static void writeToArduino(byte value) {&lt;br /&gt;        try {&lt;br /&gt;            &lt;br /&gt;            OutputStream os = null;&lt;br /&gt;&lt;br /&gt;            os = port.getOutputStream();&lt;br /&gt;            &lt;br /&gt;            os.write((byte) 0xff);&lt;br /&gt;            os.write((byte) (value));&lt;br /&gt;            os.flush();        &lt;br /&gt;&lt;br /&gt;            if (os != null) {&lt;br /&gt;                os.close();&lt;br /&gt;            }&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;Finally the Arduino Sketch which is Loaded in to the Microcontroller &lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;&lt;br /&gt;/* &lt;br /&gt; * Shazin Sadakath&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;#include &amp;lt;Servo.h&amp;gt;&lt;br /&gt;#define MAX 150&lt;br /&gt;#define MIN 0&lt;br /&gt;&lt;br /&gt;int greenLedPin = 2;&lt;br /&gt;int redLedPin = 3;&lt;br /&gt;int servoPin = 9;&lt;br /&gt;int command = 0;&lt;br /&gt;boolean open = false;&lt;br /&gt;&lt;br /&gt;Servo doorLock;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt; Serial.begin(9600);&lt;br /&gt; doorLock.attach(9);&lt;br /&gt; pinMode(greenLedPin, OUTPUT);&lt;br /&gt; pinMode(redLedPin, OUTPUT);&lt;br /&gt; digitalWrite(greenLedPin, LOW);&lt;br /&gt; digitalWrite(redLedPin, HIGH);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt; if(Serial.available() &amp;gt;= 2) {&lt;br /&gt;  if(Serial.read() == 0xff) {&lt;br /&gt;    command = Serial.read();&lt;br /&gt;      if(command == 1) {&lt;br /&gt;        if(!open) {&lt;br /&gt;         doorLock.write(MAX); &lt;br /&gt;         digitalWrite(redLedPin, LOW);&lt;br /&gt;         digitalWrite(greenLedPin, HIGH);&lt;br /&gt;         open = true;&lt;br /&gt;        }&lt;br /&gt;      } else if(command == 2) {&lt;br /&gt;        if(open) {&lt;br /&gt;         doorLock.write(MIN);&lt;br /&gt;         digitalWrite(greenLedPin, LOW);&lt;br /&gt;         digitalWrite(redLedPin, HIGH);&lt;br /&gt;         open = false;&lt;br /&gt;      } &lt;br /&gt;     }     &lt;br /&gt;  }  &lt;br /&gt; }  &lt;br /&gt; delay(10);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The video of the System is below. The accuracy completely depends on the way you pronounce the words "open" and "close", Surrounding noise and Google Voice API. In this video as you can see the The "open" word is not&amp;nbsp;recognized&amp;nbsp;first time. But the close word is.&lt;br /&gt;&lt;br /&gt;&lt;iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/nYG2_Dgq-OA" width="420"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Constructive&amp;nbsp;Criticism is always welcome!&lt;br /&gt;&lt;br /&gt;Trackbacks/Pings&lt;br /&gt;&lt;ol style="text-align: left;"&gt;&lt;li&gt;&lt;a href="http://hackaday.com/2011/11/20/an-exercise-in-servo-voice-control-with-android/"&gt;An Exercise in Servo Voice Control with Android - Hackaday&lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/android-scripting/wiki/Tutorials"&gt;A Voice Activated Servo - SL4A Tutorials &lt;/a&gt;&amp;nbsp;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-4285254924166405057?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/4285254924166405057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=4285254924166405057' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4285254924166405057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4285254924166405057'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/11/arduino-google-voice-activated-servo.html' title='Arduino Google Voice Activated Servo Motor Controlling using Android'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-BIBcVCjjQ2c/Tsd61VNX66I/AAAAAAAAAYA/4XxSJjgrkpk/s72-c/SpeechDoor_bb.png' height='72' width='72'/><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-730645641409966643</id><published>2011-11-12T01:17:00.001-08:00</published><updated>2011-11-12T01:39:49.279-08:00</updated><title type='text'>Arduino Interrupt based LED with Toggle Button</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I have been quit for sometime in my blog due to some work I had at work place. Got the time to work on Arduino Interrupts today and managed to put a small sketch on Arduino based Interrupts. Interrupts are a really powerful concept in hardware as well as in software. Specially in hardware, Interrupt eliminates polling saving precious processing cycles.&lt;br /&gt;&lt;br /&gt;An interrupt is a Sporadic event which occurs asynchronously. For instance while reading a socket for data we can either Read that socket Periodically to see whether there is any data to be read or we can attach an ISR (Interrupt Service Routine) for that socket. Whenever there is data available in the socket buffer the ISR will be called&amp;nbsp;asynchronously&amp;nbsp;and the main program will be stopped executing. When the ISR is finished executing the main program will execute from where it stopped. This is called Context Switching.&lt;br /&gt;&lt;br /&gt;Arduino UNO has two pins for External Interrupt handing INT0 (attached to pin 2) and INT1 (attached to pin 3). What I have tried to accomplish is without periodically reading pin 2 for a High value using Processing Cycles. Whenever there is FALLING (High to Low) in pin 2 a predefined ISR to be called which basically checks the state and does the opposite.&lt;br /&gt;&lt;br /&gt;The circuit sketch looks as the following&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4yy2WPSOjEA/Tr492E1hedI/AAAAAAAAAXc/l7J7l6CRgvQ/s1600/Interrupt_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="224" src="http://3.bp.blogspot.com/-4yy2WPSOjEA/Tr492E1hedI/AAAAAAAAAXc/l7J7l6CRgvQ/s320/Interrupt_bb.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The Arduino Sketch for the program is as below. I have used INT0 with pin 2 for interrupt signal. As you can see the loop method doesn't do any polling on the value of pin 2. And I have used pin 10 for LED Output.&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;int pin = 10;&lt;br /&gt;volatile int state = LOW;&lt;br /&gt;&lt;br /&gt;void setup()&lt;br /&gt;{&lt;br /&gt;  pinMode(pin, OUTPUT);&lt;br /&gt;  digitalWrite(2, HIGH);&lt;br /&gt;  attachInterrupt(0, toggle, FALLING); // Attaching the ISR to INT0&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop()&lt;br /&gt;{&lt;br /&gt;  // Does Nothing&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Interrupt Service Routine&lt;br /&gt;void toggle()&lt;br /&gt;{&lt;br /&gt;  if(state == LOW) {&lt;br /&gt;    state = HIGH;&lt;br /&gt;  } else {&lt;br /&gt;    state = LOW; &lt;br /&gt;  }&lt;br /&gt;  digitalWrite(pin, state);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-730645641409966643?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/730645641409966643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=730645641409966643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/730645641409966643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/730645641409966643'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/11/arduino-interrupt-based-led-with-toggle.html' title='Arduino Interrupt based LED with Toggle Button'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-4yy2WPSOjEA/Tr492E1hedI/AAAAAAAAAXc/l7J7l6CRgvQ/s72-c/Interrupt_bb.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-553459652405580202</id><published>2011-10-11T06:33:00.000-07:00</published><updated>2011-10-14T08:19:05.431-07:00</updated><title type='text'>Ambient Lighting using an RGB LED and Arduino UNO</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I had some spare time today and managed to put up an ambient lighting using a single RGB LED and an Arduino UNO Micro controller. &lt;br /&gt;&lt;br /&gt;There are many implementations of Arduino Ambient light setups like&lt;br /&gt;&lt;br /&gt;http://siliconrepublic.blogspot.com/2011/02/arduino-based-pc-ambient-lighting.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The above implementation is a really cool one which uses a +RGB LED Strip to create the ambient light effect from the PC's averaged screen color.&lt;br /&gt;&lt;br /&gt;But sadly I didn't have a RGB LED Strip but only one RGB LED. So I tried to create the ambient light effect using the single RGB LED. So the setup is as following&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Q_dT3sENZ5c/TphS277HxLI/AAAAAAAAAW0/ECQAdw-Qxfo/s1600/RGB_bb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" src="http://2.bp.blogspot.com/-Q_dT3sENZ5c/TphS277HxLI/AAAAAAAAAW0/ECQAdw-Qxfo/s320/RGB_bb.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-3Wxpz0UKCwc/TphS365XLNI/AAAAAAAAAW8/WcAAmVD0XFc/s1600/RGB_schem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-3Wxpz0UKCwc/TphS365XLNI/AAAAAAAAAW8/WcAAmVD0XFc/s320/RGB_schem.png" width="284" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-E1PG3GSL03E/TpQ9P-zHB1I/AAAAAAAAAWQ/GFEtXFJObIc/s1600/11102011527.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://1.bp.blogspot.com/-E1PG3GSL03E/TpQ9P-zHB1I/AAAAAAAAAWQ/GFEtXFJObIc/s320/11102011527.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;iframe allowfullscreen="" frameborder="0" height="349" src="http://www.youtube.com/embed/boLTDMvGfNo?hl=en&amp;amp;fs=1" width="425"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;The RGB LED is a common anode (positive) one so the 5v is connected to the common anode via a 1k resistor. And I use pin 9, 10, 11 with Pulse Width Modulation (PWM) for Blue, Green and Red cathodes (negative) respectively.&amp;nbsp; I drive the PWM pins using the Arduino analogWrite(). But since the RGB pins are cathodes it negates the driving value. Meaning if I give a high value (255) it will dim the corresponding color and if I give a low value (0) it will increase the brightness of the corresponding color.&lt;br /&gt;&lt;br /&gt;Sketch Code for Arduino UNO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;int bluePin = 9;&lt;br /&gt;int greenPin = 10;&lt;br /&gt;int redPin = 11;&lt;br /&gt;int blueBrightness = 0;&lt;br /&gt;int greenBrightness = 0;&lt;br /&gt;int redBrightness = 0;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; // Setting Up the COM Port&lt;br /&gt;&amp;nbsp; Serial.begin(9600);&lt;br /&gt;&amp;nbsp; // Changing PIN modes to OUTPUT&lt;br /&gt;&amp;nbsp; pinMode(bluePin, OUTPUT);&lt;br /&gt;&amp;nbsp; pinMode(greenPin, OUTPUT);&lt;br /&gt;&amp;nbsp; pinMode(redPin, OUTPUT);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; if(Serial.available() &amp;gt;= 4) {&lt;br /&gt;&amp;nbsp;&amp;nbsp; if(Serial.read() == 0xff) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 0, 0, 0 is Black&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // 255, 255, 255 is White&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; redBrightness = Serial.read();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; greenBrightness = Serial.read();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; blueBrightness = Serial.read();&lt;br /&gt;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; /*&lt;br /&gt;&amp;nbsp;&amp;nbsp; Since the RGB LED has cathode pins for &lt;br /&gt;&amp;nbsp;&amp;nbsp; RGB we need to deduct value from 255 &lt;br /&gt;&amp;nbsp;&amp;nbsp; meaning if the brightness is 255 from the &lt;br /&gt;&amp;nbsp;&amp;nbsp; PC for a color we need to give 0 so that it&lt;br /&gt;&amp;nbsp;&amp;nbsp; will eluminate brightly&lt;br /&gt;&amp;nbsp; */&lt;br /&gt;&amp;nbsp; analogWrite(bluePin, 255 - blueBrightness);&lt;br /&gt;&amp;nbsp; analogWrite(greenPin, 255 - greenBrightness);&lt;br /&gt;&amp;nbsp; analogWrite(redPin, 255 - redBrightness);&lt;br /&gt;&amp;nbsp; delay(10); &lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In order to capture the Screen Averaged color I used the implementation from the above mentioned post yet I used Java instead of Processing because I am familiar with it. I used RXTX Library for COM port writing.&lt;br /&gt;&lt;br /&gt;The Java Code is below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;package com.shazin.ambientrgb;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* @author Shazin Sadakath&lt;br /&gt;&amp;nbsp;*/&lt;br /&gt;import gnu.io.CommPortIdentifier;&lt;br /&gt;import gnu.io.SerialPort;&lt;br /&gt;import java.awt.AWTException;&lt;br /&gt;import java.awt.Robot; &lt;br /&gt;import java.awt.image.BufferedImage;&lt;br /&gt;import java.awt.Rectangle;&lt;br /&gt;import java.awt.Dimension;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.OutputStream;&lt;br /&gt;import java.util.Enumeration;&lt;br /&gt;import java.util.logging.Level;&lt;br /&gt;import java.util.logging.Logger;&lt;br /&gt;&lt;br /&gt;public class AmbientRGB implements Runnable {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static Robot robot; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static SerialPort port = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static CommPortIdentifier cpi = null;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) throws AWTException {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enumeration enums = CommPortIdentifier.getPortIdentifiers();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; robot = new Robot();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (enums.hasMoreElements()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpi = (CommPortIdentifier) enums.nextElement();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ("COM27".equals(cpi.getName())) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cpi != null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; port = (SerialPort) cpi.open("ArduinoJavaBridge", 1000);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (port != null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; port.setSerialPortParams(9600,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SerialPort.DATABITS_8,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SerialPort.STOPBITS_1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SerialPort.PARITY_NONE);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("Ready!");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new Thread(new AmbientRGB()).start();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Logger.getLogger(AmbientRGB.class.getName()).log(Level.SEVERE, null, e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void run() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OutputStream os = null;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os = port.getOutputStream();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException ex) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Logger.getLogger(AmbientRGB.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (true &amp;amp;&amp;amp; os != null) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int pixel;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float r = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float g = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float b = 0;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rectangle rectangle = new Rectangle(new Dimension(1366, 768));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BufferedImage screenshot = robot.createScreenCapture(rectangle);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int i = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int j = 0;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i = 0; i &amp;lt; rectangle.getWidth(); i = i + 2) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (j = 0; j &amp;lt; rectangle.getHeight(); j = j + 2) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pixel = screenshot.getRGB(i, j); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = r + (int) (255 &amp;amp; (pixel &amp;gt;&amp;gt; 16)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g = g + (int) (255 &amp;amp; (pixel &amp;gt;&amp;gt; 8)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b = b + (int) (255 &amp;amp; (pixel)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int totalPixels = (683 * 384); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = r / totalPixels; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g = g / totalPixels; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b = b / totalPixels;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.write(0xff); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.write((byte) (r)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.write((byte) (g)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.write((byte) (b)); &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; os.flush();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.sleep(10);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception ex) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Logger.getLogger(AmbientRGB.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I used a White Paper Scroll to cover the RGB LED so that the light is evenly visible. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-553459652405580202?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/553459652405580202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=553459652405580202' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/553459652405580202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/553459652405580202'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/10/ambient-lighting-using-rgb-led-and.html' title='Ambient Lighting using an RGB LED and Arduino UNO'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Q_dT3sENZ5c/TphS277HxLI/AAAAAAAAAW0/ECQAdw-Qxfo/s72-c/RGB_bb.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-6454188801236614401</id><published>2011-09-25T20:25:00.000-07:00</published><updated>2011-09-25T20:27:27.109-07:00</updated><title type='text'>Loading a Place Holder Properties file with a Environment Variable</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While I was working at Virtusa, we had a requirement of externalizing the DB Configurations in a property.&lt;br /&gt;The property file location was set on an Environment Variable.&lt;br /&gt;&lt;br /&gt;We tried the conventional placeholder bean method and tried to append the properties file location with the ${ABC}/db.properties format. But it didn't work the way we wanted it to.&lt;br /&gt;&lt;br /&gt;Then after some reading and trial and error I was able to figure out that&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"&gt;&lt;code&gt;&amp;lt;context:property-placeholder location="file:///${XYZ}/DDA/db.properties"/&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;context:property-placeholder location="file:///${ABC}/db.properties"&gt;&lt;/context:property-placeholder&gt;&lt;br /&gt;&lt;br /&gt;Does exactly what we require and we could use the properties in the file within the spring bean configuration using ${&lt;property name=""&gt;property name}.&lt;/property&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/7941666868022023550-6454188801236614401?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/6454188801236614401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=6454188801236614401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/6454188801236614401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/6454188801236614401'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/09/loading-place-holder-properties-file.html' title='Loading a Place Holder Properties file with a Environment Variable'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-2360746518296677990</id><published>2011-08-19T10:12:00.000-07:00</published><updated>2011-08-19T10:26:32.031-07:00</updated><title type='text'>Spring Dynamic Modules for OSGi (1)</title><content type='html'>Lately I have been testing out Spring Dynamic Modules for OSGi. Open Service Gateway Initiative (OSGi) is a dynamic module and service system for Java. It enables modules (well known as bundles) with specific functionality to be installed, started, stopped, removed without interrupting or stopping the execution life cycle.&lt;br /&gt;&lt;br /&gt;OSGi specifies an API to develop bundled applications which are;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Modular&lt;/li&gt;&lt;li&gt;Flexible&lt;/li&gt;&lt;li&gt;Independent&lt;/li&gt;&lt;li&gt;Dynamic&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;An OSGi bundled application can be run in many OSGi containers available such as;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Apache Felix&lt;/li&gt;&lt;li&gt;Eclipse Equinox&lt;/li&gt;&lt;li&gt;Knopflerfish&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;and many more...&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But the problem with OSGi is that it restricts the developer to use a strictly specified set of API classes and doesn't enable the flexibility offered in spring enabled application where everything is defined in beans. To tackle this spring has put forward a framework for Dynamic Modules in OSGi while leveraging the flexibility of the Spring framework.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Expect more in the coming posts...&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-2360746518296677990?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/2360746518296677990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=2360746518296677990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/2360746518296677990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/2360746518296677990'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/08/spring-dynamic-modules-for-osgi-1.html' title='Spring Dynamic Modules for OSGi (1)'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-7938239402310322564</id><published>2011-08-17T00:23:00.000-07:00</published><updated>2011-08-17T00:51:35.372-07:00</updated><title type='text'>Performance Testing</title><content type='html'>On my spare time I have been doing some Performance Testing mechanisms in Java.&lt;br /&gt;I just wrote a small code snippet and ran it in a Worker thread and tried to improve &lt;br /&gt;the performance of it. Even though this is small the lesson I learned was immense.&lt;br /&gt;&lt;br /&gt;This is the worker class I used.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;import java.util.concurrent.*;&lt;br /&gt;&lt;br /&gt;public class Callee implements Callable&amp;lt;Integer&amp;gt; {&lt;br /&gt;    public Integer call() {&lt;br /&gt;        int i = 0;&lt;br /&gt;        while(i &amp;lt; 10000) {&lt;br /&gt;            System.out.println(i);            &lt;br /&gt;            i++;&lt;br /&gt;        }&lt;br /&gt;        return i;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And the worker was called by the following class&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;import java.util.concurrent.*;&lt;br /&gt;import java.awt.*;&lt;br /&gt;&lt;br /&gt;public class Caller {&lt;br /&gt;    public static void main(String[] args)throws Exception {&lt;br /&gt;        long startFreeMemory = Runtime.getRuntime().freeMemory();&lt;br /&gt;        long startTime = System.currentTimeMillis();&lt;br /&gt;        ExecutorService exec = Executors.newCachedThreadPool();&lt;br /&gt;        Future&amp;lt;Integer&amp;gt; f = exec.submit(new Callee());&lt;br /&gt;        exec.shutdown();&lt;br /&gt;        System.out.println(&amp;quot;Future is &amp;quot;+f.get());&lt;br /&gt;        long endTime = System.currentTimeMillis();&lt;br /&gt;        long endFreeMemory = Runtime.getRuntime().freeMemory();&lt;br /&gt;        System.out.println(&amp;quot;Memory used : &amp;quot;+(startFreeMemory - endFreeMemory));&lt;br /&gt;        System.out.println(&amp;quot;Duration : &amp;quot;+(endTime - startTime));&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Testing was done in Intel Core 2 Duo Process with 2.93 GHz and 2 Gb of RAM.&lt;br /&gt;&lt;br /&gt;The initial program ran for 672 Milliseconds and Used 674408 units of RAM.&lt;br /&gt;&lt;br /&gt;Then the Callee class was changed to the following.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;import java.util.concurrent.*;&lt;br /&gt;&lt;br /&gt;public class Callee implements Callable&amp;lt;Integer&amp;gt; {&lt;br /&gt;    public Integer call() {&lt;br /&gt;        int i = 0;&lt;br /&gt;        StringBuilder sb = new StringBuilder();&lt;br /&gt;        while(i &amp;lt; 10000) {        &lt;br /&gt;            sb.append(i+&amp;quot;\n&amp;quot;);&lt;br /&gt;            i++;&lt;br /&gt;        }&lt;br /&gt;        System.out.print(sb.toString());&lt;br /&gt;        return i;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Using a StringBuffer without directly printing to the screen reduced the execution time by 188 Milliseconds but the RAM units used increased to 828288.&lt;br /&gt;&lt;br /&gt;But just changing &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;sb.append(i+&amp;quot;\n&amp;quot;);&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;to &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;sb.append(i).append(&amp;quot;\n&amp;quot;);&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;reduced the RAM Usage by almost half from the previous implementation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-7938239402310322564?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/7938239402310322564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=7938239402310322564' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/7938239402310322564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/7938239402310322564'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/08/performance-testing.html' title='Performance Testing'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-111710440990793056</id><published>2011-08-10T07:55:00.000-07:00</published><updated>2011-08-17T00:53:14.839-07:00</updated><title type='text'>Eiffel Programming</title><content type='html'>As part of degree studies I had to learn a Programming Language named Eiffel which enables to write programs which doesn't unintentionally kill or injure people/assets. Simply put it enables to write Secure programs.&lt;br /&gt;&lt;br /&gt;The Eiffel language many features to make this possible such as Design by Contract, Multiple Inheritance, Method Rename and so on.&lt;br /&gt;&lt;br /&gt;While doing Eiffel I wanted to try out a Small thread based code I did in Java in Eiffel. The code just takes in a String and prints one character after another in the console like in those Action Movies where the secret location name will be printed.&lt;br /&gt;&lt;br /&gt;After some reading I managed to do this with the following code in Eiffel.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;slow_prompt(text : STRING) is&lt;br /&gt;    require&lt;br /&gt;        valid_text : text /= void&lt;br /&gt;    local&lt;br /&gt;        counter : INTEGER&lt;br /&gt;    do&lt;br /&gt;        from&lt;br /&gt;            counter := 1;&lt;br /&gt;        until&lt;br /&gt;            counter &amp;gt; text.count&lt;br /&gt;        loop&lt;br /&gt;            io.put_character (text.at (counter));&lt;br /&gt;            sleep(7812500); -- Sleep for 7812500 nano seconds&lt;br /&gt;            counter := counter + 1;&lt;br /&gt;        end&lt;br /&gt;    end&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For this method to work however the class EXECUTION_ENVIRONMENT needs to facility inherited. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-111710440990793056?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/111710440990793056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=111710440990793056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/111710440990793056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/111710440990793056'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/08/eiffel-programming.html' title='Eiffel Programming'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-8660587481950398747</id><published>2011-08-09T09:24:00.000-07:00</published><updated>2011-08-17T00:54:37.403-07:00</updated><title type='text'>Java 7 Hands On</title><content type='html'>I have been trying out Java 7 this week and Tested out the latest features in JDK 7. They have given some serious thought on minimizing the coding strain of the developer by providing some new features. My favorite one is Binary Literals. There are quite more features which are;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Try with Resources&lt;/li&gt;&lt;li&gt;Multi Catch Statements&lt;/li&gt;&lt;li&gt;Diamond Syntax&lt;/li&gt;&lt;li&gt;Binary Literals&lt;/li&gt;&lt;li&gt;Underscore Between Literals&lt;/li&gt;&lt;li&gt;String in Switch&lt;/li&gt;&lt;/ul&gt;I wrote a small class to Test out all those features which is shown below.&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;import java.io.*;&lt;br /&gt;import java.awt.Color;&lt;br /&gt;import java.util.*;&lt;br /&gt;&lt;br /&gt;public class Test {&lt;br /&gt;    public static void main(String[] args)throws IOException {&lt;br /&gt;        try{&lt;br /&gt;            try (FileInputStream in = new FileInputStream(args[0])) { // Try with Resources&lt;br /&gt;        &lt;br /&gt; &lt;br /&gt;              int i = in.read(); &lt;br /&gt;    &lt;br /&gt;            }&lt;br /&gt;        } catch(FileNotFoundException &amp;#124; ArrayIndexOutOfBoundsException e) { // Multi Catch Statements&lt;br /&gt;            e.printStackTrace();&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        List&amp;lt;Color&amp;gt; colors = new ArrayList&amp;lt;&amp;gt;(); // Diamond Syntax&lt;br /&gt;&lt;br /&gt;        int no = 4 &amp;lt;&amp;lt; 1;&lt;br /&gt;        int bi8 = 0b1000; // Binary Literals&lt;br /&gt;&lt;br /&gt;        System.out.println(&amp;quot; 4 &amp;lt;&amp;lt; 1 == 0b1000 &amp;gt; &amp;quot;+(no == bi8));&lt;br /&gt;        &lt;br /&gt;        int oldOneMillion = 1000000;&lt;br /&gt;        int newOneMillion = 1_000_000; // Underscore Between Literals&lt;br /&gt;&lt;br /&gt;        System.out.println(&amp;quot;1000000 == 1_000_000 ? &amp;quot;+(oldOneMillion == newOneMillion));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        /* String in Switch */&lt;br /&gt;&lt;br /&gt;        final String RED = &amp;quot;Red&amp;quot;;&lt;br /&gt;        final String GREEN = &amp;quot;Green&amp;quot;;&lt;br /&gt;        final String BLUE = &amp;quot;Blue&amp;quot;;&lt;br /&gt;            &lt;br /&gt;        Scanner sn = new Scanner(System.in);&lt;br /&gt;        System.out.print(&amp;quot;Enter choice (Red, Green, Blue): &amp;quot;);&lt;br /&gt;        String input = sn.nextLine();&lt;br /&gt;        switch(input) {&lt;br /&gt;            case RED :&lt;br /&gt;                    colors.add(Color.RED);&lt;br /&gt;                    break;&lt;br /&gt;            case GREEN :&lt;br /&gt;                    colors.add(Color.GREEN);&lt;br /&gt;                    break;&lt;br /&gt;            case BLUE :&lt;br /&gt;                    colors.add(Color.BLUE);    &lt;br /&gt;                    break;&lt;br /&gt;            default :&lt;br /&gt;                    System.out.println(&amp;quot;None&amp;quot;);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}    &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Great Features, Thanks Sun/Oracle Engineers. Hope you all fix the minor bugs soon!&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-8660587481950398747?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/8660587481950398747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=8660587481950398747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8660587481950398747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8660587481950398747'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/08/java-7-hands-on.html' title='Java 7 Hands On'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-8692728323510334086</id><published>2011-08-06T09:06:00.000-07:00</published><updated>2011-08-17T03:17:11.885-07:00</updated><title type='text'>MIT Problem Set Solution</title><content type='html'>As part of my degree program I had to do a coursework which had a Problem Set to be Solved which was given as part of the Introduction to Algorithms module of Electrical Engineering and Computer Science course taught at the prestigious Massachusetts Institute of Technology (MIT).&lt;br /&gt;&lt;br /&gt;The problem set I had to solve is available in &lt;a href="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/assignments/ps8.pdf"&gt;this&lt;/a&gt; PDF as Problem Set 8-2 Video Game Design.&lt;br /&gt;&lt;br /&gt;In short the problem is that there is a Game with Rooms and Corridors connecting those rooms. Each Room will have either a monster or a life potion. Encountering the monster decreases life and drinking life potion increases life. The objective of the algorithm was to find the minimum life points required to start the Game.&lt;br /&gt;&lt;br /&gt;I used Floyd and Warshall Algorithm as the base to solve the problem and modified it to get the output. I had the following assumptions in place;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Maximum life points a player can have is 100. If a maze requires more than 100 at the start of the maze to finish the maze that maze is not r-admissible.&lt;/li&gt;&lt;li&gt;The mazes will only have a maximum of 100 rooms or less. This is because the player will be frustrated to finish the maze if it is longer than that.&lt;/li&gt;&lt;li&gt;From start room there is at least two paths to the destination.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;div&gt;Following are the two part flow chart diagrams of the algorithm.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-H2BexYEGe_E/Tj1olDr0JFI/AAAAAAAAAKA/JIN53JkjZO0/s1600/FlowChart1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 245px; height: 320px;" src="http://4.bp.blogspot.com/-H2BexYEGe_E/Tj1olDr0JFI/AAAAAAAAAKA/JIN53JkjZO0/s320/FlowChart1.png" alt="" id="BLOGGER_PHOTO_ID_5637777294391256146" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-5UMI4bl1wMs/Tj1olX0owyI/AAAAAAAAAKI/ZOcddOIU9YM/s1600/FlowChart2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 236px; height: 320px;" src="http://1.bp.blogspot.com/-5UMI4bl1wMs/Tj1olX0owyI/AAAAAAAAAKI/ZOcddOIU9YM/s320/FlowChart2.png" alt="" id="BLOGGER_PHOTO_ID_5637777299796968226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Implementation of the algorithm is seen below;&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;public double RAdmissible() {&lt;br /&gt;      if (maze != null) {&lt;br /&gt;          // Variable to store the result&lt;br /&gt;          double r = 0d;&lt;br /&gt;          // Constant to store No of vertices in the Maze&lt;br /&gt;          final int MAZE_LENGTH = maze.getSize();&lt;br /&gt;          // Variable to store Adjacency Matrix of the Maze&lt;br /&gt;          double matrix[][] = maze.getAdjacencyMatrix();&lt;br /&gt;          // Variable to store Predecessor of the Longest path&lt;br /&gt;          double pred[][] = new double[MAZE_LENGTH][MAZE_LENGTH];&lt;br /&gt;          /*&lt;br /&gt;           *&lt;br /&gt;           * If there is a positive cycle&lt;br /&gt;           * then with minimum of r = 1 maze is navigable&lt;br /&gt;           * Else have to find the least costly path from start to end of the maze&lt;br /&gt;           *&lt;br /&gt;           *&lt;br /&gt;           */&lt;br /&gt;          // Variable to store whether this maze contains a positive cycle&lt;br /&gt;          boolean positiveCycle = false;&lt;br /&gt;          /*&lt;br /&gt;           * Modified version of Floyd-Warshall Algorithm. Runs at O(N^3).&lt;br /&gt;           * This is used to find the least cost path from start to finish&lt;br /&gt;           * and to find whether there are positive cycles in the maze.&lt;br /&gt;           */&lt;br /&gt;          for (int k = 0; k &amp;amp;lt; MAZE_LENGTH &amp;amp;amp;&amp;amp;amp; !positiveCycle; k++) {                 &lt;br /&gt;               for (int i = 0; i &amp;amp;lt; MAZE_LENGTH &amp;amp;amp;&amp;amp;amp; !positiveCycle; i++) {                     &lt;br /&gt;                     for (int j = 0; j &amp;amp;lt; MAZE_LENGTH &amp;amp;amp;&amp;amp;amp; !positiveCycle; j++) {                         if (matrix[k][j] != Double.NEGATIVE_INFINITY &amp;amp;amp;&amp;amp;amp;                                 matrix[i][k] + matrix[k][j] &amp;amp;gt; matrix[i][j]) {&lt;br /&gt;                          // Assigning the new least cost path&lt;br /&gt;                          matrix[i][j] = matrix[i][k] + matrix[k][j];&lt;br /&gt;                          // Assigning the new predecessor&lt;br /&gt;                          pred[i][j] = k;&lt;br /&gt;                          /*&lt;br /&gt;                           * If i == j then it is a cycle.&lt;br /&gt;                           * But we have to determine whether it is a positive cycle.&lt;br /&gt;                           * For that we check whether the new path is not Negative Infinity and it is positive.&lt;br /&gt;                           */&lt;br /&gt;                          if (i == j &amp;amp;amp;&amp;amp;amp; matrix[i][j] != Double.NEGATIVE_INFINITY &amp;amp;amp;&amp;amp;amp; matrix[i][j] &amp;amp;gt; 0) {&lt;br /&gt;                              positiveCycle = true;&lt;br /&gt;                          }&lt;br /&gt;                      }&lt;br /&gt;                  }&lt;br /&gt;              }&lt;br /&gt;&lt;br /&gt;              // Minimum r is the cost to go from start to finish&lt;br /&gt;              double minimumR = matrix[0][MAZE_LENGTH - 1];&lt;br /&gt;              // If Minimum r is Negative Infinity then cost from start to next to finish is taken&lt;br /&gt;              minimumR = minimumR == Double.NEGATIVE_INFINITY ? matrix[0][MAZE_LENGTH - 2] : minimumR;&lt;br /&gt;              /*&lt;br /&gt;               * If a positive cycle is available then Minimum r is 1&lt;br /&gt;               * This is because life points necessary to safely navigate&lt;br /&gt;               * the maze can be gained by going through the positive cycle.&lt;br /&gt;               *&lt;br /&gt;               * If no positive cycle is found then&lt;br /&gt;               * If Minimum r is Negative or Zero the Minimum r should be&lt;br /&gt;               * one greater than the absolute value of Minimum r.&lt;br /&gt;               *&lt;br /&gt;               * If Minimum r is Positive then&lt;br /&gt;               * Minimum r is 1 this is because there is safe path&lt;br /&gt;               * from start to end where the player's lifepoints will&lt;br /&gt;               * never become 0 or less.&lt;br /&gt;               *&lt;br /&gt;               */&lt;br /&gt;              minimumR = positiveCycle ? 1.0 : minimumR &amp;amp;lt;= 0 ? abs(minimumR) + 1.0 : 1.0;                 /*   &lt;br /&gt;                              * If Minimum r is greater than 100 then                          * r is 0 which means there is no safe path in the maze.                         *&lt;br /&gt;                              * Note : This is based on the assumption that a player can have a maximum of         * 100 life points.                  &lt;br /&gt;                              */&lt;br /&gt;              r = minimumR &amp;amp;gt; 100 ? 0 : minimumR;&lt;br /&gt;          }&lt;br /&gt;          // Return the Minimum r&lt;br /&gt;          return r;&lt;br /&gt;      } else {&lt;br /&gt;          throw new IllegalStateException(&amp;quot;Maze is invalid&amp;quot;);&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The Maze is a Adjacency Matrix implementation with Two Dimensional Double array. I used the following maze designs to test the algorithm.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-zf4ZrAcQX1Y/Tj1rrrBjMII/AAAAAAAAAKQ/ik9wuLLpT7I/s1600/Mazes.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 245px; height: 320px;" src="http://1.bp.blogspot.com/-zf4ZrAcQX1Y/Tj1rrrBjMII/AAAAAAAAAKQ/ik9wuLLpT7I/s320/Mazes.png" alt="" id="BLOGGER_PHOTO_ID_5637780706565501058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Many couldn't finish this task in my batch and I was awarded highest marks (91) for the coursework.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-8692728323510334086?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/8692728323510334086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=8692728323510334086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8692728323510334086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8692728323510334086'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/08/mit-problem-set-solution.html' title='MIT Problem Set Solution'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-H2BexYEGe_E/Tj1olDr0JFI/AAAAAAAAAKA/JIN53JkjZO0/s72-c/FlowChart1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-4856159081613750173</id><published>2011-08-03T10:11:00.000-07:00</published><updated>2011-08-17T00:58:09.813-07:00</updated><title type='text'>Integrating EJB3 Session Bean with Spring Security 3</title><content type='html'>During my BSc education I had a coursework which required to be developed using Enterprise Java Beans. All the business logics were to be captured using Session Beans and they were to be made as the one and only access point to the data layer.&lt;br /&gt;&lt;br /&gt;But to implement the Authentication and Authorization in the web application I wanted to use Spring Security Framework 3. But it had a different mechanism to connect with the database and retrieve the user credentials and authorizations.&lt;br /&gt;&lt;br /&gt;I wanted the same EJB Session Beans which handles User related logics to be used in the authentication as well. Then after reading some materials online and some coding I managed to use my EJB Session Bean UserController along with the Spring Security authentication and authorization mechanism.&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;package com.lkbotics.business;&lt;br /&gt;&lt;br /&gt;import com.lkbotics.entity.Country;&lt;br /&gt;import com.lkbotics.entity.Customer;&lt;br /&gt;import com.lkbotics.entity.User;&lt;br /&gt;import java.util.List;&lt;br /&gt;import javax.ejb.Stateless;&lt;br /&gt;import javax.persistence.EntityManager;&lt;br /&gt;import javax.persistence.NoResultException;&lt;br /&gt;import javax.persistence.PersistenceContext;&lt;br /&gt;import javax.persistence.Query;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; */&lt;br /&gt;@Stateless&lt;br /&gt;public class UserController implements UserControllerRemote, UserControllerLocal {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Entity Manager for Accessing Tables in Database&lt;br /&gt;     */&lt;br /&gt;    @PersistenceContext(name=&amp;quot;LKBotics&amp;quot;)&lt;br /&gt;    private EntityManager entityManager;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * &lt;br /&gt;     * @param username - Username of the user&lt;br /&gt;     * @return User&lt;br /&gt;     */&lt;br /&gt;    public User getUserByUsername(String username) {&lt;br /&gt;        Query query = entityManager.createQuery(&amp;quot;FROM User as u WHERE u.username = ?1&amp;quot;);&lt;br /&gt;        query.setParameter(1, username);&lt;br /&gt;        User user = (User) query.getSingleResult();&lt;br /&gt;        return user;&lt;br /&gt;    }&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Spring Security 3 Uses something called an Authentication Provider to get Authentication details. This could be an XML Tag with hard coded values or a database table with dynamic values. But in this scenario we require a custom Authentication Provider which uses the EJB Session Bean UserController to get the user credentials. For that purpose Spring Security 3 provides an Interface named UserDetailsService. &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;/*&lt;br /&gt; * To change this template, choose Tools &amp;#124; Templates&lt;br /&gt; * and open the template in the editor.&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;package com.lkbotics.services;&lt;br /&gt;&lt;br /&gt;import com.lkbotics.business.UserControllerRemote;&lt;br /&gt;import com.lkbotics.dto.UserDetailsAdaptor;&lt;br /&gt;import com.lkbotics.entity.User;&lt;br /&gt;import java.util.logging.Level;&lt;br /&gt;import java.util.logging.Logger;&lt;br /&gt;import javax.enterprise.context.RequestScoped;&lt;br /&gt;import javax.naming.InitialContext;&lt;br /&gt;import javax.naming.NamingException;&lt;br /&gt;import javax.persistence.NoResultException;&lt;br /&gt;import org.springframework.security.core.userdetails.UserDetails;&lt;br /&gt;import org.springframework.security.core.userdetails.UserDetailsService;&lt;br /&gt;import org.springframework.security.core.userdetails.UsernameNotFoundException;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * @author Shazin Sadakath&lt;br /&gt; */&lt;br /&gt;@RequestScoped&lt;br /&gt;public class UserDetailsServiceImpl implements UserDetailsService{&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    private UserControllerRemote userController;&lt;br /&gt;&lt;br /&gt;    public UserDetailsServiceImpl(){&lt;br /&gt;        try {&lt;br /&gt;            InitialContext ctx = new InitialContext();&lt;br /&gt;            userController = (UserControllerRemote) ctx.lookup(&amp;quot;com.lkbotics.business.UserControllerRemote&amp;quot;);&lt;br /&gt;        } catch (NamingException ex) {&lt;br /&gt;            Logger.getLogger(UserDetailsServiceImpl.class.getName()).log(Level.SEVERE, null, ex);&lt;br /&gt;        }        &lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    @Override&lt;br /&gt;    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {&lt;br /&gt;        UserDetailsAdaptor userDetails = null;&lt;br /&gt;        try{&lt;br /&gt;            User user = userController.getUserByUsername(username);&lt;br /&gt;            userDetails = new UserDetailsAdaptor(user);&lt;br /&gt;        }catch(NoResultException e){&lt;br /&gt;            throw new UsernameNotFoundException(username);&lt;br /&gt;        }                &lt;br /&gt;        return userDetails;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As seen above UserDetailsService has a method named loadUserByUsername which needs to be overridden and implemented to use the EJB3 Session Bean. This enable user credentials to be retrieved via the EJB instead of direct JDBC calls, centralizing the data access to EJB Persistence Context. &lt;br /&gt;&lt;br /&gt;Hope this helped.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-4856159081613750173?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/4856159081613750173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=4856159081613750173' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4856159081613750173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4856159081613750173'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/08/integrating-ejb3-session-bean-with.html' title='Integrating EJB3 Session Bean with Spring Security 3'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-3591594484779529313</id><published>2011-07-20T00:58:00.001-07:00</published><updated>2011-07-20T01:06:56.147-07:00</updated><title type='text'>Moodle Password Hash Structure</title><content type='html'>I was working with Moodle Learning Management System as part of my work &lt;br /&gt;and was able to figure out the Hashing of passwords in moodle available in&lt;br /&gt;users table. I am sure there are programmers who would want to know this. &lt;br /&gt;&lt;br /&gt;Moodle uses MD5 Hashing to protect the passwords of the moodle users.&lt;br /&gt;&lt;br /&gt;But it uses a salt value which is suffixed to the actual password before MD5 hashing algorithm being applied. Salt values are used to prevent Dictionary attacks. This salt value can be found in a file called config.php in the moodle file structure.&lt;br /&gt;&lt;br /&gt;So the structure is MD5([Actual User Password] + [Salt Value])&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-3591594484779529313?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/3591594484779529313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=3591594484779529313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/3591594484779529313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/3591594484779529313'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/07/moodle-password-hash-structure.html' title='Moodle Password Hash Structure'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-7962783994177180150</id><published>2011-07-01T01:16:00.001-07:00</published><updated>2011-07-01T01:18:02.603-07:00</updated><title type='text'>First Class</title><content type='html'>After 4 years of determination and hard work, with the help of god I made to get a First Class Honours in my BSc (Hons) Software Engineering degree. Feels so happy and humble proud to have achieved this.&lt;br /&gt;&lt;br /&gt;Once again Thanks to god.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-7962783994177180150?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/7962783994177180150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=7962783994177180150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/7962783994177180150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/7962783994177180150'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/07/first-class.html' title='First Class'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-9177580593070895588</id><published>2011-03-31T05:49:00.001-07:00</published><updated>2011-03-31T09:31:34.295-07:00</updated><title type='text'>Sri Lanka Vs India, A lot more than just World Cup Final.</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-TKJVLl4F4Lc/TZSr24Lq6SI/AAAAAAAAAIs/t_xrNjK4UjM/s1600/199438_173783529337979_100001190005959_358907_1266225_n.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 256px;" src="http://4.bp.blogspot.com/-TKJVLl4F4Lc/TZSr24Lq6SI/AAAAAAAAAIs/t_xrNjK4UjM/s320/199438_173783529337979_100001190005959_358907_1266225_n.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5590281996756248866" /&gt;&lt;/a&gt;&lt;br /&gt;In two days time, the Cricket World Cup 2011 final will be played in Wankade Stadium, Mumbai, India. &lt;br /&gt;&lt;br /&gt;Sri Lanka will be facing off the home team India in a thrilling match which will decide who is the World Champion of Cricket. &lt;br /&gt;&lt;br /&gt;India is a country said to be sixty times larger than Sri Lanka. With a daunting population of 1200 Million people. If India has 2 percent of its people playing cricket, It will be more than the total population of Sri Lanka which is around 20 Million. India is far superior when it comes to financial capabilities as BCCI the controlling body of Cricket in India being the richest in the world. &lt;br /&gt;One would think that with all these resources Indian team should be the best team in the world. But they aren't. Four years ago they were kicked out of the World Cup 2007 in the first round itself by Sri Lanka and Bangladesh. &lt;br /&gt;&lt;br /&gt;So people would ask what does Sri Lanka have? Well compared to India, Sri Lanka is far behind in terms of resources. But Sri Lankan cricketers have unmatched courage, unparalleled skill and unforgiving competitiveness. &lt;br /&gt;&lt;br /&gt;It is not numbers that count but the attitude of cricketers and their devotion for what they believe in. For that Sri Lankan cricket team can be given a full hundred because they never thought that they were underdogs. They played their hearts out in crunch games in this world cup and got into the final for the second consecutive time showing consistency.  &lt;br /&gt;&lt;br /&gt;Furthermore winning this world cup means a lot to Sri Lanka because it will definitely bring in peace and friendship amongst Sri Lankans. Just like the 1995 Rugby World Cup win solved all the ethnic conflicts between blacks and whites in South Africa. &lt;br /&gt;&lt;br /&gt;This country needs greatness to heal the wounds of the past and I am sure that our team would be able to deliver that greatness. The greatness which will unite Sinhalese, Tamils, Muslims, Catholics and would heal all the wounds of the past. &lt;br /&gt;&lt;br /&gt;So lets join our hands together and wish our lions victory. Go Sri Lanka!!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-9177580593070895588?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/9177580593070895588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=9177580593070895588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/9177580593070895588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/9177580593070895588'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/03/sri-lanka-vs-india-lot-more-than-just.html' title='Sri Lanka Vs India, A lot more than just World Cup Final.'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-TKJVLl4F4Lc/TZSr24Lq6SI/AAAAAAAAAIs/t_xrNjK4UjM/s72-c/199438_173783529337979_100001190005959_358907_1266225_n.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-5050906030679813819</id><published>2011-03-06T12:55:00.001-08:00</published><updated>2011-03-06T13:00:20.401-08:00</updated><title type='text'>Nearing End of My Degree Studies</title><content type='html'>It has been quite sometime since I last blogged. I was/am busy neck deep with my final year project work and studies and didn't get much time to blog. So far everything is going smoothly. Hope I would be able to finish off well. &lt;br /&gt;&lt;br /&gt;Last year Participating in Google Summer of Code changed my life completely. I was a part time student before I took part in GSoC and had 2 more years of academic studies left. But with GSoC I managed to cut it 1 year. Thanks to almighty god. &lt;br /&gt;&lt;br /&gt;Hoping that everything goes well as planned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-5050906030679813819?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/5050906030679813819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=5050906030679813819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5050906030679813819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5050906030679813819'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2011/03/nearing-end-of-my-degree-studies.html' title='Nearing End of My Degree Studies'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-4459647440258206763</id><published>2010-08-16T09:57:00.000-07:00</published><updated>2010-08-16T10:04:52.742-07:00</updated><title type='text'>Deleting All .svn directories from a SVN Local Copy</title><content type='html'>I have been puzzled for sometime on how to recursively delete all .svn directories from a local copy of a particular SVN checkout. I was searching through the net and found a  &lt;a href="http://vitzo.com/en/article/how-to-delete-all-svn-folders-on-windows-xp-vista"&gt;solution&lt;/a&gt; but sadly it didn't work so I had to make some minor modifications to make it work. Now all you have to have to do is copy and paste the following code in a notepad and save it as "delete_svn.reg" and double click it and allow it to create a registry. Then you can right click on the root directory of any SVN local copy checkout and select "Delete SVN Folders" from the context menu to delete .svn metadata directories.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Windows Registry Editor Version 5.00 &lt;br /&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN] &lt;br /&gt;@="Delete SVN Folders" &lt;br /&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command] &lt;br /&gt;@="cmd.exe /c \"TITLE Removing SVN Folders in %1 &amp;&amp; COLOR 9A &amp;&amp; FOR /r \"%1\" %%f IN (.svn _svn) DO RD /s /q \"%%f\" \""&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-4459647440258206763?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/4459647440258206763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=4459647440258206763' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4459647440258206763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4459647440258206763'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/08/deleting-all-svn-directories-from-svn.html' title='Deleting All .svn directories from a SVN Local Copy'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-525792536726268780</id><published>2010-08-15T20:39:00.000-07:00</published><updated>2010-08-15T20:47:07.307-07:00</updated><title type='text'>Nearing End, New Beginning..</title><content type='html'>Officially Google Summer of Code comes to an end this week, but the lessons learnt from it will continue forever.&lt;br /&gt;&lt;br /&gt;It was a very informative learning experience so far. I learnt how to work in a team and get the work done. I am very happy and honored have got selected to Google Summer of Code. All praises should go to God and God Alone. I have given my best during Google Summer of Code. I had to do Google Summer of Code as well as My Academic Project simultaneously. I managed to get them both done while switching on and off between the two. &lt;br /&gt;&lt;br /&gt;Even though the summer is over I am hoping to continue the contributions whenever I can to the opensource community. I will be doing my final year from September 2010 and hoping to graduate in 2011 if God Wish th. &lt;br /&gt;&lt;br /&gt;I would like to thank my Mentor Burke Mamlin and my backup Mentor Ben Wolfe for all the help throughout this summer. Really was lucky to have you guys as mentors.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-525792536726268780?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/525792536726268780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=525792536726268780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/525792536726268780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/525792536726268780'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/08/nearing-end-new-beginning.html' title='Nearing End, New Beginning..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-2398361145002656080</id><published>2010-08-08T20:35:00.000-07:00</published><updated>2010-08-08T21:09:18.126-07:00</updated><title type='text'>Working Hard..</title><content type='html'>As end of Summer of Code 2010 is nearing, I can say that I have given my best to achieve the required goals of my project and I have achieved most of the goals that were in my project description.&lt;br /&gt;&lt;br /&gt;I am happy to say that while achieving those goals, I learnt quited a lot too. It was a very challenging and fun experience for me thus far.&lt;br /&gt;&lt;br /&gt;As we are nearing the end of Summer of Code, Last Week I started the Documentation and managed to get some documentation in the online wiki pages.&lt;br /&gt;&lt;br /&gt;Some community members praised my early documentation and gave some feedback to make it better.&lt;br /&gt;&lt;br /&gt;I have been given some minor tasks to be done by my mentor and I am hoping to finish them off as soon as possible.&lt;br /&gt;&lt;br /&gt;Hope everything goes smoothly and god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-2398361145002656080?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/2398361145002656080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=2398361145002656080' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/2398361145002656080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/2398361145002656080'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/08/working-hard.html' title='Working Hard..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-672329155975895350</id><published>2010-08-01T20:33:00.000-07:00</published><updated>2010-08-04T21:33:38.675-07:00</updated><title type='text'>All Forward, Hard Forward, Relax ....</title><content type='html'>Took a weekend off after 2 months and guess where I headed? Kithulgala! one of the best places in the world for White Water Rafting. I have never done WWR before and it was an amazing amazing experience. I was in the front left side and it was very thrilling to go into rapids and was a nice experience. If someone is hoping to visit Sri Lanka, definitely a nice place to visit to.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.mysrilankaholidays.com/gallery/kitulgala-2.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 500px; height: 350px;" src="http://www.mysrilankaholidays.com/gallery/kitulgala-2.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is not a picture of me and my friends, Just to show how Kithulgala looks like.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-sOQvDwKIas/TFo-fIv1dCI/AAAAAAAAAHs/stGmSc9NNIo/s1600/WWR.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_-sOQvDwKIas/TFo-fIv1dCI/AAAAAAAAAHs/stGmSc9NNIo/s320/WWR.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5501778599431468066" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now this is a picture of us in the water. I am at the front left :)&lt;br /&gt;&lt;br /&gt;Then spent some quality time with my batch mates at Miyora Hotel in Kithulgala. Certainly was a great experience after a long time.&lt;br /&gt;&lt;br /&gt;That being said I was busy doing some modifications to the Openmrs Module Administration page based on the feedback I got from my mentor and the rest of the community after the second and final presentation. &lt;br /&gt;&lt;br /&gt;One major change requested was displaying all the modules in the module repository search area and reducing the modules based on the search. Currently the repository search uses an AJAX based Jquery Data table but I had to change it to a Javascript Array based Jquery Data table to work correctly.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-sOQvDwKIas/TFZA-f6gQbI/AAAAAAAAAHk/iBLKhxZgJn4/s1600/ScreenShot.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 150px;" src="http://2.bp.blogspot.com/_-sOQvDwKIas/TFZA-f6gQbI/AAAAAAAAAHk/iBLKhxZgJn4/s320/ScreenShot.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5500655437342589362" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Apart from that some more minor changes were also done to module administration page.&lt;br /&gt;Currently working on polishing up the User Interface and documentation.&lt;br /&gt;&lt;br /&gt;Hoping to carry on the good work, hope god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-672329155975895350?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/672329155975895350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=672329155975895350' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/672329155975895350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/672329155975895350'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/08/all-forward-hard-forward-relax.html' title='All Forward, Hard Forward, Relax ....'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-sOQvDwKIas/TFo-fIv1dCI/AAAAAAAAAHs/stGmSc9NNIo/s72-c/WWR.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-960808858463949375</id><published>2010-07-25T20:12:00.000-07:00</published><updated>2010-07-25T21:03:48.130-07:00</updated><title type='text'>Moving On..</title><content type='html'>Almost two months into Google Summer of Code, The knowledge I gained in developing Java Web Application is immense. I wasn't fluent with J2EE Applications before, even though I had some experience in J2SE. Thus far GSoC has been a really good learning experience.&lt;br /&gt;&lt;br /&gt;Last week (22/07/2010) I had my second and final presentation. It went as planned apart from some minor technical glitches in the conference call. Well there was nothing much I could do about it either. Anyhow I was able to demonstrate what I did to the community and was able to get some positive feedback to improve what I have done.&lt;br /&gt;&lt;br /&gt;I am currently working on them along with the Module Configuration related developments. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_-sOQvDwKIas/TE0ESGrMYVI/AAAAAAAAAHY/MQzi7Hp8dU4/s1600/ScreenShot.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 150px;" src="http://4.bp.blogspot.com/_-sOQvDwKIas/TE0ESGrMYVI/AAAAAAAAAHY/MQzi7Hp8dU4/s320/ScreenShot.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5498055429165179218" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I hope to continue the developments of the Module Configuration in coming week and finish it off as soon as possible.&lt;br /&gt;&lt;br /&gt;I hope everything goes smoothly and god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-960808858463949375?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/960808858463949375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=960808858463949375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/960808858463949375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/960808858463949375'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/07/moving-on.html' title='Moving On..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_-sOQvDwKIas/TE0ESGrMYVI/AAAAAAAAAHY/MQzi7Hp8dU4/s72-c/ScreenShot.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-6655800436724278152</id><published>2010-07-18T20:31:00.000-07:00</published><updated>2010-07-18T21:20:29.485-07:00</updated><title type='text'>Presentation II..</title><content type='html'>Ever since Google Summer of Code began. It was a quite a learning experience from all aspects. From time management to designing and coding. Looking back at the path so far, I have learnt so much that I didn't know earlier and I have been focusing myself on to achieve the goals of my project.&lt;br /&gt;&lt;br /&gt;Last week was an eventful one where I had to finalize on a design for the Module Configuration at start up. I had a discussion with my mentor, back up mentor and some other people from the openmrs developer community and came to a design decision.&lt;br /&gt;Now I have started developing it and hoping to finish it before the end of the summer.&lt;br /&gt;&lt;br /&gt;Apart from that I completed my mid term evaluation survey and I got to know that I have successfully completed up to mid term. Which is a motivation factor for the rest of the summer. I am hoping to carry out the work I have been doing so far till the end.&lt;br /&gt;&lt;br /&gt;Presentation II is due this week and hoping to do a presentation on the goals and a small demonstration.&lt;br /&gt;&lt;br /&gt;Hope everything goes smoothly and hope god be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-6655800436724278152?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/6655800436724278152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=6655800436724278152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/6655800436724278152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/6655800436724278152'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/07/presentation-ii.html' title='Presentation II..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-5927470317468185893</id><published>2010-07-11T20:15:00.000-07:00</published><updated>2010-07-11T20:32:26.759-07:00</updated><title type='text'>Evaluation I</title><content type='html'>Last week was an eventful one where I started searching for ideas on how to build the Module Configuration mechanism at start up. I got some valuable feedback from the community as well as from my mentor. &lt;br /&gt;&lt;br /&gt;Now I need to do some studying and come up with a design which will be accepted by my mentor. My mentor provided me with some great resources of similar work and I am currently going through them.&lt;br /&gt;&lt;br /&gt;Apart from that I had to develop a mechanism which would automatically check for Module updates and prompt whenever there are module updates available, right in the Administration Page.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_-sOQvDwKIas/TDqLpq6iLRI/AAAAAAAAAHA/M2ILgZXHvoI/s1600/AutomaticUpdate.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 151px;" src="http://1.bp.blogspot.com/_-sOQvDwKIas/TDqLpq6iLRI/AAAAAAAAAHA/M2ILgZXHvoI/s320/AutomaticUpdate.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5492856243542437138" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This week being the Mid Term Evaluation period, I am hoping to complete my evaluation as soon as possible and continue on with my project work. Hoping to come up with a good design for Module Configuration mechanism. &lt;br /&gt;&lt;br /&gt;Hope god will be with me as always&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-5927470317468185893?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/5927470317468185893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=5927470317468185893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5927470317468185893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5927470317468185893'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/07/evaluation-i.html' title='Evaluation I'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_-sOQvDwKIas/TDqLpq6iLRI/AAAAAAAAAHA/M2ILgZXHvoI/s72-c/AutomaticUpdate.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-5778720202577097470</id><published>2010-07-04T21:37:00.000-07:00</published><updated>2010-07-04T22:07:25.068-07:00</updated><title type='text'>Learning More..</title><content type='html'>Last week was quite an eventful one where I had to integrate and test the module repository caching with the online module repository (http://modules.openmrs.org/). The caching mechanism works as expected but may require some fine tuning.&lt;br /&gt;&lt;br /&gt;Decided to work on those fine tuning after having a discussion with my mentor. Along with those fine tuning I would have to start designing a proper way to configure modules right after they have been deployed on to the Openmrs system. Need to discuss about possible designs of that with the community.&lt;br /&gt;&lt;br /&gt;Mid Term evaluation just a week away, enjoyed the experience I acquired all throughout since the beginning of this summer. Gained a lot of valuable insight of how Open source projects are performing and how they collaborate to solve problems. &lt;br /&gt;&lt;br /&gt;Hoping to learn more and contribute more. May god be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-5778720202577097470?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/5778720202577097470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=5778720202577097470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5778720202577097470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5778720202577097470'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/07/learning-more.html' title='Learning More..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-833459115692943461</id><published>2010-06-27T23:39:00.000-07:00</published><updated>2010-07-04T07:37:23.655-07:00</updated><title type='text'>A month of Work, Fun and Excitement</title><content type='html'>It is more than one month since Google Summer of Code coding officially kicked off on 24th of May 2010. Turning back I can see all the oppurtunities I faced to learn and the challenges I had to face and how I accomplished them of course with the great help of my mentor. It was a great month. &lt;br /&gt;&lt;br /&gt;Recapping on last week where I managed to get the Module Repository caching done and started testing with a locally hosted module repository. &lt;br /&gt;&lt;br /&gt;Before the Module Repository caching for each Key Stroke on the Module Repository search box an ajax call is sent to remote server. This call is sent via the internet. In sites where internet is slow this could take time to search modules.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_-sOQvDwKIas/TChFVydOeDI/AAAAAAAAAG4/Qa_k2xShhuE/s1600/ModuleRepositorySearch.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 202px;" src="http://4.bp.blogspot.com/_-sOQvDwKIas/TChFVydOeDI/AAAAAAAAAG4/Qa_k2xShhuE/s320/ModuleRepositorySearch.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5487712386574874674" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;With the initial module repository caching at the startup of all the modules in the repository. I have changed the ajax call to call a servlet which resides in the local host. Thus the requests sent over the internet is decreased. Which leads to faster module search.&lt;br /&gt;&lt;br /&gt;I am yet to fully test this with the actual system. Once I do it I can do a performance test.&lt;br /&gt;&lt;br /&gt;Hoping to do those within this week. Hope god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-833459115692943461?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/833459115692943461/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=833459115692943461' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/833459115692943461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/833459115692943461'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/06/month-of-work-fun-and-excitement.html' title='A month of Work, Fun and Excitement'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_-sOQvDwKIas/TChFVydOeDI/AAAAAAAAAG4/Qa_k2xShhuE/s72-c/ModuleRepositorySearch.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-498271198050704284</id><published>2010-06-20T19:42:00.000-07:00</published><updated>2010-06-20T19:51:15.744-07:00</updated><title type='text'>Four Weeks..</title><content type='html'>It has been 4 weeks since Google Summer of Code officially kicked off and it was quite a learning experience thus far. Learnt a lot about open source and how they collaborate to get the work done. &lt;br /&gt;&lt;br /&gt;Last week was an eventful week where I started developing the module repository caching mechanism. And to add icing on the cake last Saturday (19th of June 2010) I received the Google Welcome Package. It was a quite a gift to receive after a much awaited 3 weeks. &lt;br /&gt;&lt;br /&gt;Mid Term evaluation begins on July 12th 2010 in exactly 3 weeks. Hoping to completely finish module repository caching and searching before that.&lt;br /&gt;&lt;br /&gt;Hope god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-498271198050704284?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/498271198050704284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=498271198050704284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/498271198050704284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/498271198050704284'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/06/four-weeks.html' title='Four Weeks..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-8425635418527567775</id><published>2010-06-13T22:45:00.000-07:00</published><updated>2010-06-13T23:26:26.818-07:00</updated><title type='text'>Presentation I..</title><content type='html'>Last week was an eventful week with the OpenMRS Interns Presentation on 10/06/2010.&lt;br /&gt;I wanted to do a Presentation of the problem statement which can be understood by anyone, and which describes what I have done so far and what I am hoping to do in the future.&lt;br /&gt;&lt;br /&gt;I thought to create a Presentation which is informal but clearly states the above mentioned. &lt;br /&gt;&lt;br /&gt;The Presentation can be found at &lt;br /&gt;&lt;br /&gt;http://docs.google.com/present/edit?id=0AdL9ONCpLAwGZGdrc3hoYmRfNTJoZjh2eHZjcQ&amp;hl=en&lt;br /&gt;&lt;br /&gt;I got to do my Presentation via a Skype Conference Call where I had to speak and explain each slide. Unfortunately the screen share system didn't work for Sri Lanka on that day due to some bandwidth problems, so my mentor (Burke Mamlin) had to flip through the slide while I was explaining orally. Thank you Burke for that :). It seems many have enjoyed the slides and my mentor said that my presentation was easy to follow.&lt;br /&gt;&lt;br /&gt;I couldn't do the demonstration of the things I have done, sadly :( but I was determined to show it at least to my mentor. So I managed to take some time out my mentor's busy schedule and did a screen sharing via Skype on Saturday around 10.00 P.M. UTC-4. He gave me some feedback which included pros and cons of my work so far.&lt;br /&gt;&lt;br /&gt;He pointed out somethings which he said are of low priority that can be done to improve the things I have done. I took notes about them and hoping to get to them at the end of the summer. &lt;br /&gt;&lt;br /&gt;Currently I am planning and designing to do the Speeding up of module repository search which would also be another challenging task.&lt;br /&gt;&lt;br /&gt;Hope everything goes smoothly and may god be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-8425635418527567775?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/8425635418527567775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=8425635418527567775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8425635418527567775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8425635418527567775'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/06/presentation-i.html' title='Presentation I..'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-3711359123612794031</id><published>2010-06-06T20:52:00.000-07:00</published><updated>2010-06-06T21:07:55.227-07:00</updated><title type='text'>So Far...</title><content type='html'>Refined Module Administration&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-sOQvDwKIas/TAxtID276MI/AAAAAAAAAGw/x0_0OYCrvFo/s1600/ModuleAdministration.PNG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 221px;" src="http://2.bp.blogspot.com/_-sOQvDwKIas/TAxtID276MI/AAAAAAAAAGw/x0_0OYCrvFo/s320/ModuleAdministration.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5479874831845157058" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My project Refine Module Administration focuses on a solution for the problem of Spring Context Refresh whenever a module action is performed from the Module Administration page. The idea was to decouple the Spring Context Refresh from each module action and make it an explicit action that can be performed when the user actually needs to. &lt;br /&gt;&lt;br /&gt;This will prevent unwanted interruptions to the background processes and scheduled tasks. Developing for the last couple of weeks I managed to get this done by creating an attribute called pendingAction in Module. I am using this attribute to store the pending action per module. And a Map will store the moduleId and the pendingAction for fast retrieval. When the user eventually tries to restart, this map will be referred to execute any pending tasks first and then perform a Spring Context refresh.&lt;br /&gt;&lt;br /&gt;I had to face a lot challenges because after a server crash or manual stop, at the next restart the pending module actions had to performed. So I had to think of ways to perform these tasks without actually performing a Spring Context Refresh.&lt;br /&gt;&lt;br /&gt;I had to learn the OpenMRS Core API related to Module Administration and Spring 3 to do the coding.&lt;br /&gt;&lt;br /&gt;I have started testing now hoping to test the system in all aspects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-3711359123612794031?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/3711359123612794031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=3711359123612794031' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/3711359123612794031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/3711359123612794031'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/06/so-far.html' title='So Far...'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-sOQvDwKIas/TAxtID276MI/AAAAAAAAAGw/x0_0OYCrvFo/s72-c/ModuleAdministration.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-1768805468705812287</id><published>2010-05-30T20:20:00.000-07:00</published><updated>2010-05-30T20:26:32.380-07:00</updated><title type='text'>First Week...</title><content type='html'>It has been one week since Google Summer of Code officially kicked off. There have been a lot of commits being done to the SVN throughout the first week. All interns for the summer seems to be enjoying their coding including me. &lt;br /&gt;&lt;br /&gt;We had a demonstration on OpenMRS Web Application on last Thursday (27th of May 2010). and as usual attended the conference call. From time to time I make skype calls to my mentor to clear out any doubts I have during development. He is very willing to answer my questions and sometimes stays awake till midnight to attend the call :).&lt;br /&gt;&lt;br /&gt;Having a good time as well as working hard to achieve the goal of giving a nice presentation on 10th of June 2010. Hoping everything will go smoothly. &lt;br /&gt;&lt;br /&gt;Hope god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-1768805468705812287?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/1768805468705812287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=1768805468705812287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1768805468705812287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/1768805468705812287'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/05/first-week.html' title='First Week...'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-6267489801064123975</id><published>2010-05-24T00:46:00.000-07:00</published><updated>2010-05-24T00:56:10.507-07:00</updated><title type='text'>Commit Numero Uno</title><content type='html'>Google Summer of Code begins today (24th of May 2010). I started my developments on Friday (21st of May 2010) and was able to do my first commit on Saturday (22nd of May 2010) to my branch which is at http://svn.openmrs.org/openmrs/branches/moduleadmin/&lt;br /&gt;&lt;br /&gt;I have been developing on Sunday (23rd of May 2010) as well and managed to finish some UI modifications and back end code changes.&lt;br /&gt;&lt;br /&gt;Hoping to have a skype call with my mentor clear out any confusions possibly within the next 3 days. &lt;br /&gt;&lt;br /&gt;Hoping to give a good presentation on 10th of June 2010 and carry on from there.&lt;br /&gt;&lt;br /&gt;May god be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-6267489801064123975?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/6267489801064123975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=6267489801064123975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/6267489801064123975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/6267489801064123975'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/05/commit-numero-uno.html' title='Commit Numero Uno'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-233851637088121702</id><published>2010-05-17T06:24:00.001-07:00</published><updated>2010-05-24T00:46:10.601-07:00</updated><title type='text'>Happy, Excited, Determined</title><content type='html'>In about 7 days from today (17th May 2010) Google Summer of Code 2010 coding officially begins and would last for little more than 3 months (till 30th August 2010). During this I am looking forward to learn a lot and also to contribute to a worthy cause. &lt;br /&gt;&lt;br /&gt;Last week was a very eventful one because I had 3 final exams of my degree within 5 days and I had to spare time to keep up with my OpenMRS Project as well. Somehow I managed to get both done while balancing between studies and work. &lt;br /&gt;&lt;br /&gt;I have created my OpenMRS GSoC Project Page on OpenMRS Wiki.&lt;br /&gt;&lt;br /&gt;http://openmrs.org/wiki/Refine_Module_Administration_Project&lt;br /&gt;&lt;br /&gt;And last Saturday (15th of May 2010) was a memorable one too because myself and Ruwan were invited to a Sri Lankan GSoC Students meetup held at the University of Moratuwa Sri Lanka. It was organized by Lanka Software Foundation and it was a very pleasant experience for me. &lt;br /&gt;&lt;br /&gt;I am hoping to start off my work on 22th of May 2010 to get a head start. I hope everything goes smoothly as planned and god will be with me as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-233851637088121702?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/233851637088121702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=233851637088121702' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/233851637088121702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/233851637088121702'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/05/happy-excited-determined.html' title='Happy, Excited, Determined'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-4265513441194130829</id><published>2010-05-10T06:20:00.000-07:00</published><updated>2010-05-10T06:42:18.454-07:00</updated><title type='text'>Getting Ready.... Part 2</title><content type='html'>It has been yet another learning week. Communicated with my mentor and tried to ask as many questions as possible to further understand what needs to be done. Attended the weekly conference call held on every Thursday. Getting to know the community members further. Got a mail from my mentor on areas I should further look out for related to my project. &lt;br /&gt;&lt;br /&gt;Last Saturday (8th of May 2010) OpenMRS GSoC 2010 Interns from Sri Lanka (Including me :)) managed to meet up and share our experiences. It was a very happy meet up held around 8.30 a.m. in the morning at IIT (Where I study). &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_-sOQvDwKIas/S-gKfMgTF_I/AAAAAAAAAF8/UjjTHZP-hoc/s1600/GSoC.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_-sOQvDwKIas/S-gKfMgTF_I/AAAAAAAAAF8/UjjTHZP-hoc/s320/GSoC.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5469633278490384370" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the picture : &lt;br /&gt;Bottom Left : Umashanthi Pavalanathan (University of Moratuwa, CSE Faculty)&lt;br /&gt;Top Left : Shazin Sadakath (Me :)) (IIT Sri Lanka)&lt;br /&gt;Bottom Right : Ruwan Egodawatta (IIT Sri Lanka)&lt;br /&gt;Top Right : Firzhan Naqash (University of Moratuwa, IT Faculty)&lt;br /&gt;&lt;br /&gt;I will be having my final exams starting from tomorrow (11th of May 2010) and it will come to an end on 21st of May 2010. After that I can fully allocate myself to OpenMRS Module Administration Refinement. Hoping to give out my best and get it done at any cost :). Hope god will be with me every step of the way as always.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-4265513441194130829?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/4265513441194130829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=4265513441194130829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4265513441194130829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4265513441194130829'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/05/getting-ready-part-2.html' title='Getting Ready.... Part 2'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-sOQvDwKIas/S-gKfMgTF_I/AAAAAAAAAF8/UjjTHZP-hoc/s72-c/GSoC.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-8926652843307587300</id><published>2010-05-02T20:24:00.000-07:00</published><updated>2010-05-10T06:19:56.079-07:00</updated><title type='text'>Getting Ready....</title><content type='html'>Almost one week since GSOC results were announced. Community Bonding Period certainly helps to keep in touch with the mentors. Primary method of communication is email but I always stay online in the IRC #openmrs channel just in case. &lt;br /&gt;&lt;br /&gt;Communicated with my immediate mentor Burke Mamlin and understood my project priorities. Which are:&lt;br /&gt;&lt;br /&gt;* Writing code that allows module upgrade or deletion to be queued for a subsequent manual restart of the OpenMRS&lt;br /&gt;* Modifications to module administration page&lt;br /&gt;&lt;br /&gt;Started drafting a project plan on last Saturday (1st May 2010). Hoping to stick to throughout and was trying to get familiar with the existing code of Module Administration. Dry running the code as well as execution testing.&lt;br /&gt;&lt;br /&gt;Was a very informative week so far. Hoping to learn more :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-8926652843307587300?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/8926652843307587300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=8926652843307587300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8926652843307587300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/8926652843307587300'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/05/getting-ready.html' title='Getting Ready....'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-7792197014532211027</id><published>2010-04-26T19:58:00.001-07:00</published><updated>2010-04-26T20:11:06.683-07:00</updated><title type='text'>Life is good!</title><content type='html'>Yesterday (26th April 2010) Google Summer of Code accepted students were announced. Thanks to god and more than 6 months of preparations, My proposal for Refine Module Administration project was announced as accepted.I was waiting 4 anxious weeks for that moment. It was around 0130 hours when I checked the results and I couldn't sleep after that. My immediate mentor is Burke Mamlin and my backup mentor is Ben Wolfe. Looking forward to working with them on the project :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-7792197014532211027?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/7792197014532211027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=7792197014532211027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/7792197014532211027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/7792197014532211027'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/04/life-is-good.html' title='Life is good!'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-5318884608853667159</id><published>2010-03-07T21:50:00.000-08:00</published><updated>2010-03-07T21:54:50.326-08:00</updated><title type='text'>Having a good idea is one thing. Bringing it to life is another.</title><content type='html'>Everyone have ideas, dreams, aspirations. But only very few achieve those. Well some call it fortune, some say hard work, some say fate, some say god's will. But I believe that is a mixture of all of those said above. &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;To be fortunate you have to be brave. To work hard you need a good environment. To get fate going your way you need good deeds done in the past and To get god's will you need to be with him all the time. Not only when you need him.&lt;/div&gt;&lt;div&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/7941666868022023550-5318884608853667159?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/5318884608853667159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=5318884608853667159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5318884608853667159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/5318884608853667159'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2010/03/having-good-idea-is-one-thing-bringing.html' title='Having a good idea is one thing. Bringing it to life is another.'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-4696222010878260693</id><published>2008-06-12T03:44:00.000-07:00</published><updated>2008-12-10T22:14:44.853-08:00</updated><title type='text'>Today's little ideas are the tomorrow's success stories!!!</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-sOQvDwKIas/SFD_Rcd-4rI/AAAAAAAAAA4/9qKlZKnnPEY/s1600-h/sergeyandlarry1_wideweb__470x395,0.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_-sOQvDwKIas/SFD_Rcd-4rI/AAAAAAAAAA4/9qKlZKnnPEY/s320/sergeyandlarry1_wideweb__470x395,0.jpg" alt="" id="BLOGGER_PHOTO_ID_5210945444032471730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Two friends Sergey and Larry started off their business in a garage. A business which turned so influential, Its name has been added as a verb in the dictionary. "Google" the backbone of internet traversing. Google has grown from nothing to everything within a very short period because of its uniqueness and effectiveness.&lt;br /&gt;&lt;br /&gt;Google provides an unprecedented and friendly environment for its employees. Unparalleled freedom and relaxation, which keeps its employees stress less and hundred percent efficient all the time.&lt;br /&gt;&lt;br /&gt;Growing using most of the Open Source technologies the giant remembers its past and gives back to the open source community in numerous ways.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-4696222010878260693?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/4696222010878260693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=4696222010878260693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4696222010878260693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/4696222010878260693'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2008/06/todays-little-ideas-are-tomorrows.html' title='Today&apos;s little ideas are the tomorrow&apos;s success stories!!!'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-sOQvDwKIas/SFD_Rcd-4rI/AAAAAAAAAA4/9qKlZKnnPEY/s72-c/sergeyandlarry1_wideweb__470x395,0.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7941666868022023550.post-9172038862291382872</id><published>2008-05-15T22:38:00.000-07:00</published><updated>2008-05-15T22:47:29.945-07:00</updated><title type='text'>Hello.. Android</title><content type='html'>One week ago I knew nothing about Android. But with some tutorials and going thoughs, I have achieved to become a Beginner in Android development and its framework. Currently working on the &lt;a href="http://www.helloandroid.com/node/566"&gt;idea&lt;/a&gt; to start off my Android Application Development career :).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7941666868022023550-9172038862291382872?l=shazsterblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://shazsterblog.blogspot.com/feeds/9172038862291382872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7941666868022023550&amp;postID=9172038862291382872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/9172038862291382872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7941666868022023550/posts/default/9172038862291382872'/><link rel='alternate' type='text/html' href='http://shazsterblog.blogspot.com/2008/05/hello-android.html' title='Hello.. Android'/><author><name>s2_zat</name><uri>http://www.blogger.com/profile/16033913838278307155</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp3.blogger.com/_-sOQvDwKIas/R4Gdj40JasI/AAAAAAAAAAM/FZ-IW8GJn9I/S220/n556720426_9698.jpg'/></author><thr:total>0</thr:total></entry></feed>
