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

<channel>
	<title>Sanjay Mysoremutt - Software Designer</title>
	<atom:link href="http://work.msanjay.in/feed/" rel="self" type="application/rss+xml" />
	<link>http://work.msanjay.in</link>
	<description>Technically curious</description>
	<lastBuildDate>Mon, 11 Jul 2011 12:04:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>list of free Android applications</title>
		<link>http://work.msanjay.in/2011/06/29/list-of-android-applications/</link>
		<comments>http://work.msanjay.in/2011/06/29/list-of-android-applications/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 09:33:01 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://work.msanjay.in/?p=1125</guid>
		<description><![CDATA[With my trusty E71 functioning as good as a mini-PC for all practical applications including Maps/GPS, Instant Messaging integrated with Google Chat and other IM services, Email, Twitter, and various other applications, and surviving a few very tough falls, I never thought I&#8217;d upgrade my phone in a long time. At some point I purchased [...]]]></description>
			<content:encoded><![CDATA[<p>With my trusty E71 functioning as good as a mini-PC for all practical applications including Maps/GPS, Instant Messaging integrated with Google Chat and other IM services, Email, Twitter, and various other applications, and surviving a few very tough falls, I never thought I&#8217;d upgrade my phone in a long time.</p>
<p>At some point I purchased an Android phone  (LG Optimus P500) for my wife, and then when finally a &#8216;key&#8217; key of my E71 stopped working, I thought I&#8217;d borrow her phone as a stop gap till I get it fixed. Well&#8230; no prizes for guessing that I ended up holding on to it considering that I still haven&#8217;t fixed the E71&#8230;</p>
<p>Well to cut a long story short, here are the list of apps that I&#8217;ve installed on it, they can be searched for in the Android Market. Highly recommended marked in <span style="color: #0000ff;">blue</span>. Of course, I&#8217;d highly recommend all <a href="http://specadel.com/mobile.html" target="_blank">Mobile Study</a> based applications by <a href="http://www.specadel.com/" target="_blank">Specadel</a> as well. But then that might be biased considering I consult here <img src='http://work.msanjay.in/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  But then they have got a pretty good rating in the market, so you can consider checking them out as well.</p>
<p><span id="more-1125"></span></p>
<p><strong>Children&#8217;s Stories:</strong></p>
<ul>
<li> 3 Pigs</li>
<li>Hansel and Gretel</li>
<li><span style="color: #0000ff;">iStoryBooks</span></li>
</ul>
<p><strong>Art/music particularly for children:</strong></p>
<ul>
<li><span style="color: #0000ff;">Art of Glow</span></li>
<li><span style="color: #0000ff;">Kid Coloring</span></li>
<li><span style="color: #0000ff;">Musical Lite</span></li>
<li><span style="color: #0000ff;">Paint Joy</span></li>
<li>Robotic Guitarist Free</li>
</ul>
<p><strong>Children&#8217;s Games:</strong></p>
<ul>
<li>Kids ABC Phonics Lite</li>
<li>Kids Connect the Dots Lite</li>
<li>Kids Numbers and Math Lite</li>
<li>Kids Shape Puzzle Lite</li>
<li>Let&#8217;s Xylophone</li>
<li>Bubbles 2</li>
<li>Coloris</li>
<li><span style="color: #0000ff;">Disney Fairies Puzzle</span></li>
<li>Find The Ball (3 cups that rotate around and you need to spot which one isn&#8217;t empty)</li>
<li>Jewels Deluxe</li>
<li>Shapes</li>
<li>Sight Words</li>
<li><span style="color: #0000ff;">Zoo Trip</span></li>
</ul>
<p><strong>Arcade Games:</strong></p>
<ul>
<li>aTilt 3D Labyrinth Free</li>
<li>Angry Birds Rio</li>
<li>Chess Free</li>
<li>Dropwords</li>
<li>Falling Ball (very nice game of avoiding a ball using accelerometer)</li>
<li>Fling (nice puzzle)</li>
<li>Flying Turtle</li>
<li>Frozen Bubble Plus</li>
<li><span style="color: #0000ff;">Fruit Slice</span></li>
<li><span style="color: #0000ff;">Glow Hockey</span></li>
<li><span style="color: #0000ff;">Hungry Shark Free</span></li>
<li>Mr Block Free</li>
<li><span style="color: #0000ff;">Paper Toss</span> (flick paper into a basket)</li>
<li>Penguin Skiing (very nice accelerometer based skiing game)</li>
<li>Phit Droid (rearranging blocks puzzle)</li>
<li>Pool Master Pro (pool game)</li>
<li>Scooter Hero AD</li>
<li>ShakyTower</li>
<li>Super Sudoku</li>
<li><span style="color: #0000ff;">Speedx 3D Free</span> (navigate through a dizzy tunnel using accelerometer)</li>
<li>Swing Frog Free</li>
<li>YooNinja Free</li>
</ul>
<p><strong>Utilities:</strong></p>
<ul>
<li> Barcode Scanner</li>
<li><span style="color: #0000ff;">eBuddy </span>(best IM Client that integrates gtalk, etc)</li>
<li><span style="color: #0000ff;">Gingerbread keyboard</span></li>
<li>Gmail</li>
<li>Google Sky Map (this is just amazing! Accelerometer + GPS based. Go on the terrace at night)</li>
<li>handyCalc</li>
<li>Google Maps</li>
<li>MyPhoneExplorer Client (see <a href="http://www.fjsoft.at/en/" target="_blank">MyPhoneExplorer</a>)</li>
<li>Picasa Tool (view Picasa Web Albums in Android)</li>
<li>Skype</li>
<li>Sound Sleep (interesting audio collection)</li>
<li>StopWatch &amp; Timer</li>
<li><span style="color: #0000ff;">SuperBox </span>(10 utilities, main useful ones are clearing cache, and moving apps to SD card)</li>
<li><span style="color: #0000ff;">TED Air</span> (browse through TED videos, download offline to SD card0</li>
<li>WebMD (first-aid and other medical info)</li>
<li>WordPress (if you have a wordpress blog that you&#8217;d like to post to)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2011/06/29/list-of-android-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>finally, an almost-free bluetooth headset from Microsoft</title>
		<link>http://work.msanjay.in/2011/06/29/finally-an-almost-free-bluetooth-headset-from-microsoft/</link>
		<comments>http://work.msanjay.in/2011/06/29/finally-an-almost-free-bluetooth-headset-from-microsoft/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 08:52:51 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[gadgets]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://work.msanjay.in/?p=1116</guid>
		<description><![CDATA[A helicopter was flying around above Seattle yesterday when an electrical malfunction disabled all of the aircraft&#8217;s electronic navigation and communication equipment. Due to the clouds and haze the pilot could not determine his position or course to steer to the airport. The pilot saw a tall building, flew toward it, circled, drew a handwritten [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>A helicopter was flying around above Seattle yesterday when an electrical malfunction disabled all of the aircraft&#8217;s electronic navigation and communication equipment.  Due to the clouds and haze the pilot could not determine his position or course to steer to the airport.  The pilot saw a tall building, flew toward it, circled, drew a handwritten sign and held it in the helicopter&#8217;s window.  The sign said &#8220;WHERE AM I ?&#8221; in large letters.<br />
People in the tall building quickly responded to the aircraft, drew a large sign and held it in a building window.  Their sign said, &#8220;YOU ARE IN A HELICOPTER.&#8221;  The pilot smiled, waved, looked at his map and determine the course to steer to SEATAC (Seattle/Tacoma) airport and landed safely.<br />
After they were on the ground, the co-pilot asked the pilot how the &#8220;YOU ARE IN A HELICOPTER&#8221; sign helped determine their position.  The pilot responded, &#8220;I knew that had to be the MICROSOFT building because they gave me a technically correct but completely useless answer.&#8221;</p></blockquote>
<p>I&#8217;d read this story over a decade ago during my college days, and never thought I&#8217;d experience it first hand <img src='http://work.msanjay.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <span id="more-1116"></span></p>
<p>So it started when I purchased a copy of Microsoft Office for Home Business use, from the Microsoft India store. There was a nice contest going on, and I made an entry as well. A week or so later, I got a mail saying I&#8217;d won Rs. 2000 to purchase anything on the site.</p>
<p>Then I browsed through the site, and couldn&#8217;t find many things that I&#8217;d want to buy around that range. Shortlisted an <a href="http://www.microsoftstore.co.in/microsoft/250/product/Natural-Ergonomic-Keyboard-4000.aspx">ergonomic keyboard</a>, or one of the Jabra bluetooth headsets. </p>
<p>The ergonomic keyboard was never in stock. Considering the online reviews, the battery life and weight of the Jabra headsets, I finally settled for the <a href="http://www.microsoftstore.co.in/microsoft/1065/product/Jabra-EasyGo-Headset.aspx">Jabra Easygo Headset</a>.</p>
<p>Some of the correspondence (with names/email addresses edited out for their privacy)&#8230;</p>
<blockquote><p>On 3 June 2011 15:47, Sanjay M wrote:</p>
<p>Hi There,</p>
<p>I tried using this coupon to purchase a Bluetooth Headset from <a href="http://www.microsoftstore.co.in/microsoft/1065/product/Jabra-EasyGo-Headset.aspx" target="_blank">http://www.microsoftstore.co.in/microsoft/1065/product/Jabra-EasyGo-Headset.aspx</a></p>
<p>But got an error: Invalid Coupon when I tried to apply the provided coupon code. Kindly advise.</p>
<p>Thanks,<br />
Sanjay</p>
<p>PS: I copied and pasted and ensured there were no spaces. Error message is:<br />
&#8220;Payment Invalid Coupon Code&#8221;</p></blockquote>
<p>And got a response:</p>
<blockquote><p>On 15 June 2011 17:42:</p>
<p>Dear Sanjay,</p>
<p><strong> </strong></p>
<p>Thank you for sharing your Valued Feedback.</p>
<p>This is with reference to your query , please be advised that Coupon issue has been resolved.</p>
<p>If there is any other way that I can help you, Please do not hesitate to contact us at our toll free no.</p>
<p>&nbsp;</p>
<p><strong>From:</strong> Sanjay M<br />
<strong>Sent:</strong> Thursday, June 16, 2011 4:44 PM<br />
<strong> </strong><strong>To:</strong> <a href="mailto:support@microsoftstore.co.in" target="_blank">support@microsoftstore.co.in</a><br />
<strong>Subject:</strong> Re: &#8220;Payment Invalid Coupon Code&#8221;</p>
<p>Hi there!</p>
<p>Though it was well over 48 hours as per a previous email, thank you very much for your reply.</p>
<p>However unfortunately this time there was no field where I could enter the coupon code at all.</p>
<p>Another thing is that when I select Net Banking, then click on &#8220;<strong>click here to see bank names&#8221; </strong>my bank is listed:</p>
<p>Then I get redirected to:<br />
<a href="https://www.ccavenue.com/txn/Billing.jsp" target="_blank">https://www.ccavenue.com/txn/Billing.jsp</a></p>
<p>And there my bank isn&#8217;t in the list any more. This is just FYI, I can use another account among those listed to pay.</p>
<p>Just FYI, I&#8217;m a soffware freelancer with expertise in various technologies including Microsoft <a href="http://asp.net/" target="_blank">ASP.NET</a>, and would be glad to provide any technical assistance towards improving the functionality of the site.</p></blockquote>
<blockquote><p>On 16 June 2011 18:07, support &lt;<a href="mailto:support@microsoftstore.co.in" target="_blank">support@microsoftstore.co.in</a>&gt; wrote:</p>
<p>Dear Sanjay,</p>
<p>We apologize for the inconvenience caused.</p>
<p>This  is with reference to your query, please be advised that Customer CC  Avenue has removed &lt;bank&gt; payment option from its payment gateway and We  requested CC Avenue to provide updated list .</p>
<p>If there is any other way that I can help you, Please do not hesitate to contact us at our toll free no.</p>
<p>Regards</p>
<p>Microsoft Store Online</p>
<p>Toll Free Number: 18001037787</p></blockquote>
<p>Oh boy&#8230;</p>
<div>
<blockquote><p><strong>From:</strong> Sanjay M<br />
<strong>Sent:</strong> Thursday, June 16, 2011 6:55 PM<br />
<strong>To:</strong> support<br />
<strong>Subject:</strong> Re: Subject: Re: &#8220;Payment Invalid Coupon Code&#8221;</p></blockquote>
</div>
<blockquote><p>&nbsp;</p>
<p>Yes, please note that was just an additional point. The main point of my mail:<br />
<strong><br />
However unfortunately this time there was no field where I could enter the coupon code at all.</strong></p>
<p>Could you please let me know where I can enter the coupon code to  get my Rs 2000 discount. I went all the way till the end of the checkout  process and looked all over hte screen. I&#8217;m sure it was there last  time.</p>
<p>Regards,<br />
Sanjay</p></blockquote>
<p>&nbsp;<br />
Then&#8230;</p>
<blockquote><p>On 17 June 2011 10:48, support &lt;<a href="mailto:support@microsoftstore.co.in" target="_blank">support@microsoftstore.co.in</a>&gt; wrote:</p>
<div>
<p>Dear Sanjay,</p>
<p>Thank you for sharing your Valued Feedback.</p>
<p>This  is with reference to your  query , please be advised that Coupon Code  Option is available on Store, kindly refer to the attachment for your  reference.</p>
</div>
<p>If there is any other way that I can help you, Please do not hesitate to contact us at our toll free no.</p>
<p>&lt;screenshot that showed the promo code field&gt;</p>
<p>&nbsp;</p>
<p>On 29 June 2011 13:20, Sanjay M wrote:<br />
PS: I just tried with the latest version of Internet Explorer and its the same with that browser as well.</p></blockquote>
<p>Then another exchange of emails&#8230;</p>
<blockquote><p>On 29 June 2011 13:16, Sanjay M wrote:<br />
Dear MS Store,</p>
<p>Thank  you &#8211; I tried it out again and it definitely does not have that  Promocode box that you show in the screenshot. Here&#8217;s the screenshot  from my machine:</p>
<p>The last date is 30th i.e. tomorrow so I hope you can help me sort  this out at the earliest, or alternatively extend the validity of the  coupon. I have spent a lot of time on this so far, just FYI.</p>
<p>Thanks,<br />
<span style="color: #888888;">Sanjay</span></p>
<p>PS: I just tried with the latest version of Internet Explorer and its the same with that browser as well.</p>
<p>&lt;screenshot without promocode field attached&gt;</p></blockquote>
<p>Finally they called me on my cell phone to sort it out. It turns out that promo code wasn&#8217;t applicable to that particular product.</p>
<p>They called me again after a while asking if I was sure if that was the product I wanted to buy. I said yes&#8230; (after all the time I&#8217;d spent browsing through the site!) They said they&#8217;d add it to that product and would call back. Later on I just refreshed the screen&#8230; and was able to see the promocode field, and immediately purchased the Rs. 2119 headset for Rs. 119.</p>
<p>All&#8217;s well that ends well <img src='http://work.msanjay.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p>&nbsp;</p>
<table cellpadding="0">
<tbody>
<tr>
<td>
<table cellpadding="0">
<tbody>
<tr>
<td>from</td>
<td colspan="2"><img id="upi" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" />Sanjay M</td>
</tr>
<tr>
<td colspan="2">to</td>
<td colspan="2"><img id="upi" src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" />support &lt;support@microsoftstore.co.in&gt;</td>
</tr>
<tr>
<td colspan="2">date</td>
<td colspan="2"><img src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" />29 June 2011 14:55</td>
</tr>
<tr>
<td colspan="2">subject</td>
<td colspan="2"><img src="https://mail.google.com/mail/images/cleardot.gif" alt="" width="16px" height="16px" />Re: Subject: Re: &#8220;Payment Invalid Coupon Code&#8221;</td>
</tr>
<tr>
<td colspan="2"></td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="4"></td>
</tr>
</tbody>
</table>
</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Thanks to your kind support, I was finally able to successfully order the product.</p>
<p>Thanks,<br />
<span style="color: #888888;">Sanjay</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2011/06/29/finally-an-almost-free-bluetooth-headset-from-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ipclip &#8211; simple Windows utility to copy IP address to clipboard</title>
		<link>http://work.msanjay.in/2010/06/02/ipclip-simple-tool-to-copy-ip-address-to-clipboard/</link>
		<comments>http://work.msanjay.in/2010/06/02/ipclip-simple-tool-to-copy-ip-address-to-clipboard/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 07:53:17 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[C Sharp]]></category>

		<guid isPermaLink="false">http://work.msanjay.in/?p=1103</guid>
		<description><![CDATA[We often require the IP address of the current machine. If you&#8217;re tired of opening a DOS box and typing ipconfig, here&#8217;s a small tool that copies the IP address and puts it into the clipboard. Just download the EXE file into your system path (eg %windir%\system32). Then, go to Windows Start -&#62; Run (Windows [...]]]></description>
			<content:encoded><![CDATA[<p>We often require the IP address of the current machine. If you&#8217;re tired of opening a DOS box and typing ipconfig, here&#8217;s a small tool that copies the IP address and puts it into the clipboard.</p>
<p>Just <a href="https://code.google.com/p/ipclip/downloads/list">download the EXE file</a> into your system path (eg %windir%\system32).</p>
<p>Then, go to Windows Start -&gt; Run (Windows key + R) and type <strong>ipclip</strong>.</p>
<p>Here&#8217;s the source code&#8230;<br />
<span id="more-1103"></span></p>
<pre lang="c#">String strHostName = Dns.GetHostName();
            String ip = null;
            Console.WriteLine("Local Machine's Host Name: " + strHostName);
            // Then using host name, get the IP address list..
            IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
            foreach (var addr in ipEntry.AddressList) {
                if (!addr.AddressFamily.ToString().ToLower().EndsWith("v6"))
                {
                    ip = addr.ToString();
                    break;
                }
            }

            if (ip != null)
            {
                if (MessageBox.Show("IP Address: " + ip + " \r\n\r\nCopy to clipboard?", "IP Clip [msanjay.in]",
                    MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
                {
                    Clipboard.SetData(DataFormats.Text, ip);
                }
            }
            else
            {
                MessageBox.Show("IP Address not obtained", "IP Clip [msanjay.in]",
                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            this.Close();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/06/02/ipclip-simple-tool-to-copy-ip-address-to-clipboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>importing some initial test data into a grails application</title>
		<link>http://work.msanjay.in/2010/04/01/importing-some-initial-test-data-into-a-grails-application/</link>
		<comments>http://work.msanjay.in/2010/04/01/importing-some-initial-test-data-into-a-grails-application/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 11:58:00 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1100</guid>
		<description><![CDATA[Grails is pretty fast to get up and running. We mainly need to be clear about one main thing, the domain model. The primary task is to identify the entities in the system as domain classes, and then elaborate on them adding properties. Then define the relationships between them. Once this is done, we get [...]]]></description>
			<content:encoded><![CDATA[<p>Grails is pretty fast to get up and running. We mainly need to be clear about one main thing, the domain model. The primary task is to identify the entities in the system as domain classes, and then elaborate on them adding properties. Then define the relationships between them.</p>
<p>Once this is done, we get a ready-made application to start with. Now to really play around with this application, it helps to add some test data. This is also useful to do some initial testing of our domain model, before we add controller logic to it.</p>
<p>Using the CSVReader class outlined here earlier, its easy to add some test data.</p>
<p><span id="more-1100"></span><br />
Create a service that does the importing.</p>
<pre>class LoadDbService {

    boolean transactional = true
    def rootDir = 'something'

    // a set method for property rootDir
    public void setRootDir(String dir) {

        rootDir = dir
        if (! (dir.endsWith("/") || dir.endsWith("\\")))
            rootDir += File.separator
    }

    def load() { .. detailed below .. }</pre>
<p>This service would be called at startup, from Bootstrap.groovy, in the init method:</p>
<pre>        def init = { servletContext -&gt;

        def dbs = new LoadDbService()

        dbs.rootDir = servletContext.getRealPath("/data/")

        println "loading data... " + dbs.rootDir

        dbs.load()
     }</pre>
<p>This service imports CSV data into domain objects. If a domain object refers to other domain objects, do a find and replace the item in the map with the found object. Eg for a finance application having domain classes Bank, Account, Entity (a person or an institute who operates an account and makes a payment). Account below belongs to both a Bank and an Entity. So this is how the load method would load value to these tables:</p>
<pre>        def csv

        csv = new CsvFileReader(rootDir +  'Bank.csv')

        csv.forEachRow () {
            new Bank(it).save(flush:true)
        }

        csv = new CsvFileReader(rootDir +  'Entity.csv')

        csv.forEachRow () {
            new Entity(it).save(flush:true)
        }

        csv = new CsvFileReader(rootDir +  'Account.csv')

        csv.forEachRow () {
            println it
            def b = it['bank'] = Bank.findByName(it['bank'])
            def e = it['entity'] = Entity.findByName(it['entity'])

            println it

            def a = new Account(it)

            b.addToAccounts(a)
            b.save(flush:true)

            e.addToAccounts(a)
            e.save(flush:true)
        }</pre>
<p>So what about the contents of the CSV files? As you might&#8217;ve guessed, each row of the CSV files contain a value for each non-null field of the domain class. Eg, the domain class Payment contains the following initial lines:</p>
<pre>
name,accNumber,bankCode,description,bank,entity
ICICI-Savings,121111,12111,Savingsaccount,ICICI,usr1
HSBC-Savings,121111,12111,Savingsaccount,HSBC,usr1</pre>
<p>The first line of this CSV file contains a header that has the domain class property names. This is how the object is constructed &#8211; because the map that is loaded for each row, is passed to the constructor of the class (eg new Entity(it) &#8211; where &#8216;it&#8217; is a map.</p>
<p>So we need a CSV file for each domain class. Now there&#8217;s an easy way to create this CSV file as well. In the index.gsp, we add the following code, that will iterate through the domain classes, and make a list of the header fields for each of them. We then just need to remove unnecessary fields like id, version and anything else thats nullable if necessary.</p>
<p>&lt;div id=&#8221;domainList&#8221; class=&#8221;dialog&#8221;&gt;<br />
&lt;h2&gt;Available Domains:&lt;/h2&gt;</p>
<p>&lt;ul&gt;<br />
&lt;g:each var=&#8221;c&#8221; in=&#8221;${grailsApplication.domainClasses}&#8221;&gt;<br />
&lt;li class=&#8221;controller&#8221;&gt;&lt;g:link controller=&#8221;${c.logicalPropertyName}&#8221;&gt;${c.name}&lt;/g:link&gt;&lt;/li&gt;<br />
&lt;ul&gt;<br />
&lt;li class=&#8221;controller&#8221;&gt;<br />
&lt;g:each var=&#8221;p&#8221; in=&#8221;${c.properties}&#8221;&gt;<br />
${p.name},<br />
&lt;/g:each&gt;<br />
&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/g:each&gt;<br />
&lt;/ul&gt;</p>
<p>&lt;/div&gt;</p>
<p>When we view the index page in the browser, the above code renders all the domain classes and the header line for each CSV file (i.e. the comma seperated list of their properties)!</p>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/04/01/importing-some-initial-test-data-into-a-grails-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UML class (and other) diagrams</title>
		<link>http://work.msanjay.in/2010/03/15/uml-class-and-other-diagrams/</link>
		<comments>http://work.msanjay.in/2010/03/15/uml-class-and-other-diagrams/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:10:44 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1083</guid>
		<description><![CDATA[After examining different approaches of drawing UML sequence diagrams, today I came across a good way of drawing class diagrams as well. I don&#8217;t know how I didn&#8217;t come across this site before! Its a similar concept to the websequencediagrams site, where we can specify in simple text notation and it generates a pretty good [...]]]></description>
			<content:encoded><![CDATA[<p>After examining different approaches of <a href="http://msanjay.weblogs.us/software-designer/?p=650">drawing UML sequence diagrams</a>, today I came across a good way of drawing class diagrams as well. I don&#8217;t know how I didn&#8217;t come across this site before! Its a similar concept to the websequencediagrams site, where we can specify in simple text notation and it generates a pretty good diagram from that!</p>
<p><a href="http://yuml.me/">Yuml.me</a> allows us to create very cool looking class, activity and state diagrams using a very elegant text based notation!<br />
<span id="more-1083"></span></p>
<p>I modified one of their examples to include a more comprehensive set of notations (complete list can be found in their <a href="http://yuml.me/diagram/class/samples">samples</a> page:</p>
<pre>
[Customer]1-orders 0..*&gt;[Order]
[Order]++*-*&gt;[LineItem], [Order]-1&gt;[DeliveryMethod]
[Customer|firstName;lastName;email|save();addOrder(Order)]
[Order]*-*&gt;[Product]
[DeliveryMethod]^[National]
[DeliveryMethod]^[International]
[Customer]uses-.-&gt;[PaymentStrategy]
[Customer][Address]
</pre>
<p>&lt;img src=&quot;http://yuml.me/diagram/class/[Customer]1-orders 0..*&gt;[Order], [Order]++*-*&gt;[LineItem], [Order]-1&gt;[DeliveryMethod], [Customer|firstName;lastName;email|save();addOrder(Order)], [Order]*-*&gt;[Product], [DeliveryMethod]^[National], [DeliveryMethod]^[International], [Customer]uses-.-&gt;[PaymentStrategy], [Customer][Address].&#8221; alt=&#8221;UML Class Diagram&#8221; /&gt;</p>
<p><a href=""></a></p>
<p>Some explanation on some aspects of the class diagram&#8230;</p>
<p><strong>Composition Relationships</strong> Eg: Order &#8211; LineItem</p>
<p>Order contains 1 or more instance of type LineItem. This is a relationship known as composition represented by the filled black diamond. The Order class is composed of LineItems. The arrowhead on the other end of the relationship denotes that the relationship is navigable in only one direction. That is, LineItem does not know about Order. In UML relationships are presumed to be bidirectional unless the arrowhead is present to restrict them. Had this arrowhead been omitted, it would have meant that LineItem knew about Order it belonged to.</p>
<p><strong>Inheritance</strong><br />
A kind of relationship, like National and International being two kinds of DeliveryMethods.</p>
<p><strong>Aggregation / Association</strong> Eg: Customer &#8211; Order</p>
<p>The weak form of aggregation is denoted with an open diamond. This relationship denotes that the aggregate class  (the class with the white diamond touching it i.e. Customer) is in some way the “whole”, and the other class Order in the relationship is somehow “part” of that whole. Customer has Orders.</p>
<p>Association is used to indicate a form of containment that does not have a whole / part implication. For example, each Order refers to its DeliveryMethod. This is not aggregation since Order is not part of a DeliveryMethod.</p>
<p><strong>Dependency</strong> Eg Customer &#8211; PaymentStrategy</p>
<p>Sometimes the relationship between a two classes is very weak. They are not implemented with<br />
member variables at all, but maybe with member function arguments. This is indicated by the dotted line.</p>
<p>Further reading: <a href="http://www.objectmentor.com/resources/publishedArticles.html">Object Mentor&#8217;s UML resources</a>&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/03/15/uml-class-and-other-diagrams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>configuring a custom log4j category in grails</title>
		<link>http://work.msanjay.in/2010/03/12/configuring-a-custom-log4j-category-in-grails/</link>
		<comments>http://work.msanjay.in/2010/03/12/configuring-a-custom-log4j-category-in-grails/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 09:10:45 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[career]]></category>
		<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1075</guid>
		<description><![CDATA[Objective: to have a seperate logger exclusively for writing some special messages to a seperate file. Usually log4j writes to logs based on package &#38; class names, as covered by the Log4J Configuration Documentation (In fact, some things have changed since Grails 1.1) But we sometimes need a logger for logging special messages, though we [...]]]></description>
			<content:encoded><![CDATA[<p>Objective: to have a seperate logger exclusively for writing some special messages to a seperate file.</p>
<p>Usually log4j writes to logs based on package &amp; class names, as covered by the <a href="http://grails.org/doc/1.1.x/guide/3.%20Configuration.html#3.1.2%20Logging">Log4J Configuration Documentation</a> (In fact, some things have changed since Grails 1.1)</p>
<p>But we sometimes need a logger for logging special messages, though we may log other messages to the usual log within the same class.<br />
<span id="more-1075"></span><br />
So in Config.groovy, we define a new rolling file appender named &#8216;splMsgFile&#8217;</p>
<pre>
log4j = {
  appenders {

      console name:'stdout'

      rollingFile name:'msgFile', file: logDirectory + './appln.log', threshold: org.apache.log4j.Level.INFO, maxFileSize:"1MB", maxBackupIndex: 10, 'append':true, layout:pattern(conversionPattern: "%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p [%c] - %m%n")

      rollingFile name:'splMsgFile', file: './splMsg.log', threshold: org.apache.log4j.Level.INFO, maxFileSize:"1MB", maxBackupIndex: 10, 'append':true, layout:pattern(conversionPattern: "%d{dd MMM yyyy HH:mm:ss,SSS} [%t] %-5p [%c] - %m%n")

  }
</pre>
<p>Then we add an info level log below, after the appenders section, with the name splMsgLog</p>
<pre>  debug msgFile:"splMsgLog" //    name of the log category is splMsgLog...</pre>
<p>In any part of the project, independent of package/class, apart from the usual logs, we can write to this additional log as follows:</p>
<pre>       def msgLog = Logger.getLogger("splMsgLog")
       msgLog.info("this is a special message1")</pre>
<p>So while there may be other log messages that come in the usual log file, the splMsgLog contains only the ones logged with this one!</p>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/03/12/configuring-a-custom-log4j-category-in-grails/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSV File Reader &#8211; Groovy</title>
		<link>http://work.msanjay.in/2010/03/11/csv-file-reader-groovy/</link>
		<comments>http://work.msanjay.in/2010/03/11/csv-file-reader-groovy/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 09:24:47 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[grails]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1069</guid>
		<description><![CDATA[Here&#8217;s a useful class that reads a CSV file and returns each row of values. Its based on some regular expressions I found on the net (unfortunately URL got lost, but its a fairly straightforward one to fine). Call back functions to make it a convenient way to read the input CSV file. // create [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a useful class that reads a CSV file and returns each row of values. Its based on some regular expressions I found on the net (unfortunately URL got lost, but its a fairly straightforward one to fine). Call back functions to make it a convenient way to read the input CSV file.</p>
<pre>
// create the object with the input path
def csv = new CsvFileReader(inputFilePath))

//  define a closure that handles each row of data
//  returned as a map of column name (defined by header row)
csv.forEachRow () {
print (it['ColumnName']) }
</pre>
<p>Here&#8217;s the entire code&#8230;<br />
<span id="more-1069"></span></p>
<pre>
/**
 *
 *  Class that consumes a CSV file, including double quotes, and then
 *  returns each row of values iteratively as a map
 *
 *  Usage:
 *
 *      // create the object with the input path
 *      def csv = new CsvFileReader(inputFilePath))
 *
 *      //  define a closure that handles each row of data
 *      //  returned as a map of column name (defined by header row)
 *      csv.forEachRow () {
 *         print (it['ColumnName']) }
 *
 * User: Sanjay Mysoremutt
 * Last Updated: Mar 11, 2010
 **/

import java.text.SimpleDateFormat

class CsvFileReader {

    CsvFileReader(def fileName) {
        this.fileName = fileName
    }

    def fileName

    def dateFormat = /\d{1,2}-\d{1,2}-\d{2,4} \d{1,2}:\d{1,2}(:\d{1,2}){0,1}/
    //def dateTimeFormat = /\d{1,2}-\d{1,2}-\d{2,4} \d{1,2}:\d{1,2}(:\d{1,2}){0,1}/
    def dateTimeFormat = /\d{1,2}\/\d{1,2}\/\d{2,4} \d{1,2}:\d{1,2}(:\d{1,2}){0,1}/
    def currencyFormat = /\$(\d)*(.){0,1}(\d)+/

    def nullIfEmpty = { instr -&gt;
            return instr == ''? null: instr
        }

    def df = new SimpleDateFormat('MM/dd/yyyy') //('dd-MM-yyyy')

    def forEachRow(forEachRowCallBack) {

        def idx = 0
        def items

        def headingRow = true //  to differentiate the first row, set to false
        def header = []
        def values = [ : ]
        def columnIdx

        new File(fileName).eachLine() { fields -&gt;

			// This reads comma separated line and puts it into a hashmap
			//	It skips commas that are within double quotes
            items = fields.split(/,(?=([^"]*"[^"]*")*(?![^"]*"))/)*.replaceAll(/"/, "")

// " now we check for the headingRow being true only for the first time,
// and immediately set it to false for subsequent rows!

            if (headingRow) {
                     headingRow = false
                     header = items
                }

            else {

                columnIdx = 0

                //  return the values in a map of header name and column names
                header.each {

                    values[it] = items[columnIdx++]

                    //  convert any dates into date objects
                    if (values[it] ==~ dateTimeFormat) {
                        //  convert date to date object
                        // println "matched date format"
                        values[it] = df.parse(values[it])
                        //  println values[it]
                    }
                    else if (values[it] ==~ currencyFormat) {
                        //  convert currency to decimal object
                        // println "matched currency format"
                        values[it] = new BigDecimal(values[it].substring(1))
                        // println values[it]
                    }
                    else {
                        //  convert any empty strings to nulls
                        values[it] = nullIfEmpty(values[it])
                    }
                }

                forEachRowCallBack(values)
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/03/11/csv-file-reader-groovy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>swiss army mobile &#8211; Nokia E71</title>
		<link>http://work.msanjay.in/2010/03/06/swiss-army-mobile-nokia-e71/</link>
		<comments>http://work.msanjay.in/2010/03/06/swiss-army-mobile-nokia-e71/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 08:09:21 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1067</guid>
		<description><![CDATA[Coming soon: how to make best use of your Nokia E71. Most of this might apply to E63 and E72 as well&#8230; For now&#8230; http://delicious.com/msanjay75/nokia]]></description>
			<content:encoded><![CDATA[<p>Coming soon:</p>
<p>how to make best use of your Nokia E71. Most of this might apply to E63 and E72 as well&#8230;</p>
<p>For now&#8230;</p>
<p>http://delicious.com/msanjay75/nokia</p>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/03/06/swiss-army-mobile-nokia-e71/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sync google calendar, thunderbird, Nokia E71 (S60)</title>
		<link>http://work.msanjay.in/2010/03/06/sync-google-calendar-thunderbird-nokia-e71-s60/</link>
		<comments>http://work.msanjay.in/2010/03/06/sync-google-calendar-thunderbird-nokia-e71-s60/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 07:36:19 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1062</guid>
		<description><![CDATA[Just a hurried note, will add more details soon, but this should have the relevant info&#8230; On Nokia, set up, Mail For Exchange (from Ovi Store), and then visit this link on google: Google Sync for Nokia S60 to link your phone to your calendar. I&#8217;ve set up the sync time as once every 12 [...]]]></description>
			<content:encoded><![CDATA[<p>Just a hurried note, will add more details soon, but this should have the relevant info&#8230;</p>
<p>On Nokia, set up, Mail For Exchange (from <a href="http://store.ovi.com/">Ovi Store</a>), and then visit this link on google:</p>
<p><a href="http://www.google.com/support/mobile/bin/answer.py?hl=en&amp;answer=147951">Google Sync for Nokia S60</a> to link your phone to your calendar. I&#8217;ve set up the sync time as once every 12 hours, as this is sufficient for my purposes.</p>
<p>Then on Thunderbird, install the <a href="https://addons.mozilla.org/en-US/thunderbird/addon/4631">Google Calendar Provider Addon</a> (simplest way is in Thunderbird, go to Tools -&gt; Addons -&gt; and enter this in the search box, to install directly). This allows you to connect to the Google Calendar from thunderbird.</p>
<p>Instead of a TODO list, I create an &#8220;Event&#8221; for each TODO item, and this allows me to set up a reminder and a date for each item, and also syncs across Thunderbird, Google Calendar and my phone!</p>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2010/03/06/sync-google-calendar-thunderbird-nokia-e71-s60/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pixelpipe stopped working on E71 &#8211; with error &#8216;media items discarded&#8217;</title>
		<link>http://work.msanjay.in/2009/09/17/pixelpipe-stopped-working-on-e71-with-error-media-items-discarded/</link>
		<comments>http://work.msanjay.in/2009/09/17/pixelpipe-stopped-working-on-e71-with-error-media-items-discarded/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 07:18:15 +0000</pubDate>
		<dc:creator>msanjay</dc:creator>
				<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://msanjay.weblogs.us/software-designer/?p=1053</guid>
		<description><![CDATA[Pixelpipe is no doubt one of the one of the best, most convenient software services I&#8217;ve ever seen, that integrates seamlessly with Nokia&#8217;s ShareOnline of Nokia E71. I can upload pictures and video and audio right from my mobile into my blog or any other pre-configured destination! Suddenly yesterday, it started giving an error &#8220;One [...]]]></description>
			<content:encoded><![CDATA[<p>Pixelpipe is no doubt one of the one of the best, most convenient software services I&#8217;ve ever seen, that integrates seamlessly with Nokia&#8217;s ShareOnline of Nokia E71.  I can upload pictures and video and audio right from my mobile into my blog or any other pre-configured destination!</p>
<p>Suddenly yesterday, it started giving an error &#8220;One or more media items discarded because your service provider does not support them&#8221;</p>
<p>I googled and found that there were other&#8217;s who had a similar issue, even few months ago (so it wasn&#8217;t a sudden overnight change on some server). But no one really had any constructive suggestion for a solution. I did try updating the service but that hadn&#8217;t made any difference.</p>
<p>Finally the solution turned out to be to delete the Pixelpipe entry from Shareonline completely. I was concerned that this might affect my content already online (in case it results in deletion of my account as well!)</p>
<p>Still tried it out as there was no other option, and then visited the site http://m.pixelpipe.com/nokia with my mobile browser, and downloaded the configuration file again. Finally this worked fine and I&#8217;m into uploading again!</p>
]]></content:encoded>
			<wfw:commentRss>http://work.msanjay.in/2009/09/17/pixelpipe-stopped-working-on-e71-with-error-media-items-discarded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

