<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Inphina Thoughts</title>
	<atom:link href="http://thoughts.inphina.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thoughts.inphina.com</link>
	<description>A Journey Towards True Software Craftsmanship</description>
	<lastBuildDate>Sun, 22 Jan 2012 12:13:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thoughts.inphina.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Inphina Thoughts</title>
		<link>http://thoughts.inphina.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thoughts.inphina.com/osd.xml" title="Inphina Thoughts" />
	<atom:link rel='hub' href='http://thoughts.inphina.com/?pushpress=hub'/>
		<item>
		<title>Capsules for recovering Scala fever.</title>
		<link>http://thoughts.inphina.com/2011/12/27/capsules-for-recovering-scala-fever/</link>
		<comments>http://thoughts.inphina.com/2011/12/27/capsules-for-recovering-scala-fever/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 07:55:46 +0000</pubDate>
		<dc:creator>Neelkanth Sachdeva</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2720</guid>
		<description><![CDATA[Scala is a multi-paradigm programming language that combines the features of object-oriented programming and functional programming. The word &#8220;Scala&#8221; refers to &#8220;Sca(Scalable)+la(Language)&#8221; i.e designed to grow with the demands of its users. Scala runs on the Java Virtual Machine. Here We&#8217;ll discuss about some of the basic concepts in Scala that make it distinct from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2720&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scala-lang.org" target="_blank">Scala</a> is a multi-paradigm programming language that combines the features of object-oriented programming and functional programming. The word &#8220;Scala&#8221; refers to &#8220;Sca(Scalable)+la(Language)&#8221; i.e designed to grow with the demands of its users. Scala runs on the Java Virtual Machine.<br />
<br />
Here We&#8217;ll discuss about some of the basic concepts in Scala that make it distinct from other programming languages.Let us start with some of the following:<br />
<br /> <br />
<strong>1. Simple method in scala</strong>:-<br />
<pre class="brush: scala;">
object Check {
   def countcharacter(a: String, b: String) = { //Declaring a method in scala
       if (a.length &gt; b.length) println(&quot;The large word is&quot; + a) 
       else  println(&quot;The large word is&quot; + b) 
 }

  def main(args: Array[String]) {                 // The main method in scala
      countcharacter(&quot;Neelkanth&quot;,&quot;Sachdeva&quot;)     //calling the method
  }

}



</pre><br />
<strong>2. Scala Array with &#8220;for&#8221; loop :-</strong></p>
<p><pre class="brush: scala;">
object forloopdemo {
  
  val name= new Array[String](4)     // Declaring an Array in scala
  name(0)=&quot;This&quot;
    name(1)=&quot;is&quot;
      name(2)=&quot;an&quot;
        name(3)=&quot;array&quot;
  
  def printarrayelem(args:Array[String]):Unit={  

   /*Creating a method named &quot;printarrayelem&quot; with return type &quot;Unit&quot;,
   that will print out all the elements in array.  */                                             
                                                     
  for(arg &lt;- args)      
  /* A sample for loop for printing all elements in array. */                                                  
  println(arg)         
}
  
  def main(args: Array[String]) {    //The main method in scala
  printarrayelem(name)
  }
}
</pre></p>
<p></p>
<p><strong>3. Constructor in Scala</strong>:-<br />
<pre class="brush: scala;">

class construct(val name: String, val age: Int) {                
println(&quot;This is the example program of primary constructor&quot;)
}

object PrimaryConstructor {
  def main(args: Array[String]) {           //the main method.
    val cons = new construct(&quot;Neelkanth Sachdeva&quot;, 23) 
     /*passing the values for name and age at the time of object creation. */                                                
                                                       
    println(cons.name)      // accessing the value via constructor.
  }
}
</pre><br />
<br />
<strong>4. Companion Objects. </strong>:-</p>
<p>In Java, you often have a class with both instance methods and static methods. In Scala, you achieve this by having a class and a “companion” object<br />
of the same name. The class and its companion object can access each other’s private features. They must be located in the same source file.</p>
<p><pre class="brush: scala;">
class companion{
  private var balance=0.0
  private def deposit(amount:Double){      //Declaring a private method
  balance+=amount
  println(balance)
  }
}
object companion {
  def main(args: Array[String]) {
  val n=new companion
/*Accessing the private method of class in its companion object.  */
  n.deposit(78.00)                
   }
 }
</pre></p>
<p>
<strong>5. Bypass the main method</strong> :-<br />
In Scala, you need not to have main method always, you can bypass the main method by extending the &#8220;App&#8221; trait as follows.<br />
 <pre class="brush: scala;">

object main_alternate extends App{       //extending the &quot;App&quot; trait 
                                         //to avoid main method.
 println(&quot;This is the alternate of main&quot;)
}
</pre><br />
<br />
<strong>6.ArrayBuffer in Scala</strong>:-<br />
Most operations on an array buffer have the same speed as for an array, because the operations simply access and modify the underlying array. Additionally, array buffers can have data efficiently added to the end.Array buffers are useful for efficiently building up a large collection whenever the new items are always added to the end.<br />
<pre class="brush: scala;">
import scala.collection.mutable.ArrayBuffer
object arraybuffdemo {
  val abuf = new ArrayBuffer[Int]()        //Array buffer
  val array = Array(1, 2, 3, 4, 5)         //Simple array

  def main(args: Array[String]) {

    abuf += 1            //Inserting an element to buffer
    println(abuf)

    abuf ++= array      //Inserting a whole array to arraybuffer
    println(abuf)

    abuf.trimStart(1)   //removing one element from 
                         //starting point in arraybuffer
    println(abuf)

    abuf.trimEnd(1)    //removing one element from 
                         //ending point in arraybuffer
    println(abuf)

    abuf.insert(1, 80, 81, 82)  //inserting the three element 
                                //say 80,81,82 at index 1. 
    println(abuf)
       
    abuf.remove(1, 2)   //removing two elements from the index 1
    println(abuf)

 }
}
</pre></p>
<p><strong>Enjoiii Scala!!!!</strong> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2720/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2720/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2720/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2720&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/12/27/capsules-for-recovering-scala-fever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6d5738e0562e77e8ce2a0fc8ea784d8e?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">neelsachdeva</media:title>
		</media:content>
	</item>
		<item>
		<title>Seasons Greetings and Best Wishes for 2012</title>
		<link>http://thoughts.inphina.com/2011/12/25/seasons-greetings-and-best-wishes-for-2012/</link>
		<comments>http://thoughts.inphina.com/2011/12/25/seasons-greetings-and-best-wishes-for-2012/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 14:50:57 +0000</pubDate>
		<dc:creator>Narinder Kumar</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2710</guid>
		<description><![CDATA[Festival and Holiday season is all around us. Many of us are already on holidays, taking well deserved break and having fun with family and friends. This is also a time to sit back, take a look how things went in past 12 months and plan for the coming year. For Inphina, it has been [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2710&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Festival and Holiday season is all around us. Many of us are already on holidays, taking well deserved break and having fun with family and friends. This is also a time to sit back, take a look how things went in past 12 months and plan for the coming year. </p>
<p>For Inphina, it has been an eventful year. We did projects on lot of new and diverse technologies like Google Fusion Tables, Maps, Google App Engine, Lift, Scala and lot more. Our partners list also increased substantially this year and we got opportunity to work with organizations from Singapore, Australia, Germany, UK, USA and of-course India. We started with CSD (Certified Scrum Developer) program and were the first one to execute it in India. Along with many successful public and private courses in India, we were able to take it outside India and did our first International CSD course in Kathmandu, Nepal. Most importantly, we had great fun and learning all through-out the year. We would like to thank all our partners for their confidence and support. </p>
<p>On behalf of everyone at Inphina, we would like to wish you and your dear ones a Merry Christmas and happy times in the year ahead.</p>
<p><a href="http://phithoughts.files.wordpress.com/2011/12/seasonsgreetings.jpg"><img src="http://phithoughts.files.wordpress.com/2011/12/seasonsgreetings.jpg?w=600&#038;h=433" alt="" title="SeasonsGreetings" width="600" height="433" class="aligncenter size-full wp-image-2712" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2710/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2710&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/12/25/seasons-greetings-and-best-wishes-for-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce0a0ccd020055820a0c1c8a3e397416?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">narinderkumar</media:title>
		</media:content>

		<media:content url="http://phithoughts.files.wordpress.com/2011/12/seasonsgreetings.jpg" medium="image">
			<media:title type="html">SeasonsGreetings</media:title>
		</media:content>
	</item>
		<item>
		<title>Using RDBMS on Google App Engine : Google Cloud SQL</title>
		<link>http://thoughts.inphina.com/2011/12/16/using-rdbms-on-google-app-engine-google-cloud-sql/</link>
		<comments>http://thoughts.inphina.com/2011/12/16/using-rdbms-on-google-app-engine-google-cloud-sql/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 11:14:05 +0000</pubDate>
		<dc:creator>Narinder Kumar</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[GAE]]></category>
		<category><![CDATA[Google Cloud SQL]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2544</guid>
		<description><![CDATA[We have been working on Google App Engine since its early days and have developed and ported several applications on the platform for our clients. One of the major hinderance for our Enterprise clients for not being able to move to GAE has been Datastore being the only storage option available till date. Major reasons [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2544&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have been working on <a href="http://code.google.com/appengine/" title="Google App Engine" target="_blank">Google App Engine</a> since its early days and have developed and ported several applications on the platform for our clients. One of the major hinderance for our Enterprise clients for not being able to move to GAE has been Datastore being the only storage option available till date. Major reasons for these enterprises not using Datastore are:</p>
<ul>
<li>(In case of migration) Substantial efforts in adapting the application code base to Google Datastore specifications</li>
<li>Potentially huge data-migration efforts</li>
<li>Vendor Lock-In as both the application code and data residing in Datastore can&#8217;t be taken to an in-premise Infrastructure or another cloud platform seamlessly</li>
</ul>
<p>Keeping all these requests and potential business opportunities in mind, Google has recently announced <a href="http://code.google.com/apis/sql/" title="Google Cloud SQL" target="_blank">Cloud SQL</a>. </p>
<p><strong>What is Google Cloud SQL</strong></p>
<ul>
<li>It&#8217;s a Relational Database on Cloud offering from Google.</li>
<li>Offers <a href="http://www.mysql.com/" title="MySQL" target="_blank">MySQL</a> Database environment with JDBC support for Java applications and DB-API support for Python applications.</li>
<li>Being a service on Cloud, it offers traditional advantages of any Cloud service like no maintenance, administration, replication and backup efforts
<li>To ensure high-availability, data gets replicated across multiple geographic regions</li>
<li>Easy to use Web-Interface for managing multiple Instances</li>
</ul>
<p><strong>Google Cloud SQL &amp; Google App Engine</strong></p>
<p>A very good integration has been provided for your applications running on Google App Engine to use Google Cloud SQL as back-end storage mechanism. Furthermore, one SQL instance can be shared across multiple Google App Engine applications. This feature should be quite helpful as often we have a family of Web Applications for different user-requirements but still sharing the same Database.<br />
<span id="more-2544"></span><br />
<strong>Getting Started</strong></p>
<p>Cloud SQL is still in limited preview mode so you need to request access for the same. More information is available <a href="http://code.google.com/apis/sql/docs/before_you_begin.html#enroll" title="Google Cloud SQL Access Request" target="_blank">here</a>.</p>
<p>Once you have got access, you can visit <a href="https://code.google.com/apis/console/" title="Google APIs Console" target="_blank">Google APIs Console</a> and should be able to see <strong>Google Cloud SQL</strong> tab on the left side menu. You can create a new Cloud SQL instance from there. During the creation, you can</p>
<ul>
<li>Specify the storage capacity (current options are 1GB, 5GB and 10 GB)</li>
<li>Specify one/more App Engine Application ID&#8217;s allowed to access this DB instance. It should be noted that multiple applications can access one Cloud SQL instance or one application can access multiple SQL instances.</li>
</ul>
<p>Once an instance is created, you can access it either through API Console&#8217;s Web Browser <a href="http://code.google.com/apis/sql/docs/advanced_tasks.html#sqlprompt" title="Google Cloud SQL Prompt" target="_blank">SQL prompt</a> or through a command line tool from your computer. Detailed instructions for downloading and configuring command line tool are available <a href="http://code.google.com/apis/sql/docs/commandline.html" title="Google Cloud SQL Command Line Tool" target="_blank">here</a>. To quickly get going, we will use Web Browser. Once inside SQL prompt, we can execute commands as if we are working on local MySQL Database installation. <em>Do keep in mind that all identities in Google Cloud SQL are case-sensitive i.e. Entries and entries are considered different tables.</em></p>
<p><strong>Integrating GAE Application with Cloud SQL</strong></p>
<p>For Java developers, detailed instructions are available <a href="http://code.google.com/apis/sql/docs/developers_guide_java.html#use_with_java" title="GAE/J and Cloud Sql Integration" target="_blank">here</a>. Similar instructions for Python can be accessed <a href="http://code.google.com/apis/sql/docs/developers_guide_python.html#use_with_python" title="GAE/Python and Cloud SQL Integration" target="_blank">here</a>. Following the steps, I was able to get an application on GAE accessing Cloud SQL Database in less than 15 minutes. During development stages, you can also test the application behavior accessing your local MySQL Database. Configuration steps for the same are provided <a href="http://code.google.com/apis/sql/docs/developers_guide_java.html#using_the_java_development_server" title="Simulating Cloud SQL in Local Development Environment" target="_blank">here</a></p>
<p><strong>Export/Import</strong> Cloud SQL provides the possibility of importing your existing MySQL data to Cloud SQL Database. This feature is very important when we are thinking of migrating our existing in-premise applications to Cloud. Similarly if for some reasons, we want to move our applications from GAE platform, an export utility is also provided. In both the cases, though we need to pass via <a href="http://code.google.com/apis/storage/" title="Google Cloud Storage" target="_blank">Google Cloud Storage</a>, yet another Service offering from Google to store your data on cloud. Detailed instructions about exporting and importing data are provided <a href="http://code.google.com/apis/sql/docs/advanced_tasks.html#importexport" title="Export Import Data from Google Cloud SQL" target="_blank">here</a> </p>
<p><strong>Usage Stats</strong> You can access usage statistics on variety of parameters and across multiple time-lines through your instance dashboard. As the service is currently in preview mode, it&#8217;s usage is free but once Google launches it officially it will most likely be a paid service. This would then be an important place for determining possible improvement areas in your application for cost and performance optimizations.</p>
<p><strong>Conclusion</strong> </p>
<p>I think it is big positive addition for increasing the reach of GAE platform inside enterprises. I am yet to try it on a serious project but the integration looked quite straightforward. Possibility of accessing the same instance from multiple GAE applications also appears to be a good feature while designing or migrating multiple applications using same Database. One of things which I feel lacking is inability to access Cloud SQL instance from applications outside Google App Engine environment. This may be a bottleneck when we think about phased migration of an application family using the same Database instance or one of the applications can&#8217;t be deployed on GAE platform because of some reasons. Workarounds are possible but ideal solution would be to provide REST Service to access the instance from anywhere. Hope this is in future pipeline. Looking forward to hearing your comments and experiences on Cloud SQL and GAE.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2544/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2544&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/12/16/using-rdbms-on-google-app-engine-google-cloud-sql/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce0a0ccd020055820a0c1c8a3e397416?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">narinderkumar</media:title>
		</media:content>
	</item>
		<item>
		<title>Basic Http authentication in Lift.</title>
		<link>http://thoughts.inphina.com/2011/12/16/basic-http-authentication-in-lift/</link>
		<comments>http://thoughts.inphina.com/2011/12/16/basic-http-authentication-in-lift/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 10:10:22 +0000</pubDate>
		<dc:creator>Neelkanth Sachdeva</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2678</guid>
		<description><![CDATA[Lift web framework accommodate a no. of conspicuous features that are implemented in a unique and solitary way as compared to other frameworks. Here we&#8217;ll discuss about the basic &#8220;Http authentication&#8221; mechanism for security in Lift. What is &#8216;LiftRules&#8217; singleton ? Nearby all configuration parameters for the http requests and response are defined in LiftRules [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2678&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://liftweb.net" target="_blank">Lift web framework</a>  accommodate a no. of conspicuous features that are implemented in a unique and solitary way as compared to other frameworks. Here we&#8217;ll discuss about the basic &#8220;Http authentication&#8221; mechanism for security in Lift.<br />
<br />
<strong>What is <strong>&#8216;LiftRules&#8217;</strong> singleton ?</strong><br />
 Nearby all configuration parameters for the http requests and response are defined in <em>LiftRules</em> singleton. The important thing to notice is that we can only change the configuration parameteres of  <em>LiftRules</em> only during boot but not at other times. You can find more about <em>LiftRules</em> <a href="http://scala-tools.org/mvnsites/liftweb-2.3/net/liftweb/http/LiftRules.html" target="_blank">Here</a>.<br />
<br />
Now for our purpose of Http authentication what all you have to do , is to add some Lines of code using the <strong>LiftRules</strong> singleton present in lift, in to your <code><strong>Boot.scala</strong></code> File and you&#8217;ll find all gets done for a basic http authentication.<br />
<br />
Let us have a look to the steps for doing it ::<br />
<br />
*Firstly in your <strong>Boot.scala</strong> file make the class extends Loggable(part of &#8220;net.liftweb.common&#8221;) as :<br />
<pre class="brush: scala;">
class Boot extends Loggable {
  def boot {
   LiftRules.addToPackages(&quot;XYZ&quot;)
.....
.....
} }

</pre><br />
<br />
*Now you have to proceed with the &#8216;prepend&#8217; method(from LiftRules package) implementation in your <strong>Boot</strong>(def Boot) method &amp; defining the name of html pages on which you want to implement the authentication as follows:<br />
<pre class="brush: scala;">
 LiftRules.httpAuthProtectedResource.prepend{
      case (Req(&quot;html_page_name&quot;:: Nil,_,_)) =&gt; Full(AuthRole(&quot;admin&quot;))
      case (Req(&quot;securepage&quot;:: Nil,_,_)) =&gt; Full(AuthRole(&quot;admin&quot;))
                       
      
// Just mention the above code for page on which you
// want to implement the http authentication.   

    }
</pre><br />
<br />
*Call the authentication(have root in &#8216;HttpAuthentication.class&#8217;) from the <strong>LiftRules</strong> and mention the username and password for the authentication purpose as :<br />
 <pre class="brush: scala;">
LiftRules.authentication = HttpBasicAuthentication(&quot;Authenticate Yourself&quot;) {      
      case(&quot;user_name&quot;,&quot;password&quot;,req) =&gt; {
        logger.info(&quot;Authentication Succeeded...Welcome!!&quot;)
         userRoles(AuthRole(&quot;admin&quot;))
         true
      }
    }
</pre><br />
</br><br />
* Now each time when user will try to access the page,browser will pop up for the http authentication like: <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
</br><br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/12/authenticate.png?w=600" alt="Http Authentication in Lift" /><br />
</p>
<p><strong>Note</strong>:- Don&#8217;t forgot the following basic imports:<br />
 <pre class="brush: scala;">
import common.{Loggable, Full}
import http._
import auth.{userRoles, HttpBasicAuthentication, AuthRole}
</pre><br />
<br />
::: Want to get start with Lift ? come <a href="http://neelkanthsachdeva.wordpress.com/2011/11/03/getting-started-with-lift-web-framework-your-first-step/" title="Here" target="_blank">Here</a>.  </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2678/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2678/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2678/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2678&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/12/16/basic-http-authentication-in-lift/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6d5738e0562e77e8ce2a0fc8ea784d8e?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">neelsachdeva</media:title>
		</media:content>

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/12/authenticate.png" medium="image">
			<media:title type="html">Http Authentication in Lift</media:title>
		</media:content>
	</item>
		<item>
		<title>Mercurial Branching Cheat Sheet</title>
		<link>http://thoughts.inphina.com/2011/12/15/mercurial-branching-cheat-sheet/</link>
		<comments>http://thoughts.inphina.com/2011/12/15/mercurial-branching-cheat-sheet/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 08:53:43 +0000</pubDate>
		<dc:creator>Narinder Kumar</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[scm]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2640</guid>
		<description><![CDATA[I have been using Subversion as source code version control tool since many years. Though I have used Mercurial for couple of hobby projects earlier but few weeks back, I started using it on my first Industrial project. Here, we are working on multiple feature-sets which need to go into Production at different time-lines. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2640&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been using <a href="http://subversion.apache.org/" title="Apache Subversion" target="_blank">Subversion</a> as source code version control tool since many years. Though I have used <a href="http://mercurial.selenic.com/" title="Mercurial SCM" target="_blank">Mercurial</a> for couple of hobby projects earlier but few weeks back, I started using it on my first Industrial project. Here, we are working on multiple feature-sets which need to go into Production at different time-lines. The best way to manage such scenarios is the use of branches. The concept and way of working with branches in Mercurial is quite different from Subversion. Here are few commands which one might find helpful while starting to work with Mercurial branches:<br />
<pre class="brush: plain;">
hg branches //shows all the branches present in the repository
</pre><br />
There is always at-least one branch in Mercurial Repository which is called <em>default</em> as compared to <em>trunk</em> in Subversion.<br />
<pre class="brush: plain;">
hg branch new_branch_name //creates a new named branch
</pre><br />
Named branches help in easy identification of the work being done on that branch.<br />
<pre class="brush: plain;">
hg commit //commits all the changes locally to the newly created branch
hg push --new-branch //pushes all the changes of this branch along with the branch to mercurial server
</pre><br />
Only when we have committed and pushed our changes in newly created branch, other team members will be able to see the branch and our changes. Once a team member has committed the changes in a branch and other people would like to do further work on the same branch, they can use the following flow:<br />
<pre class="brush: plain;">
hg pull //gets all the changes on default as well as other branches
hg update -C branch_name //switches to the branch
</pre><br />
On regular intervals, we will need to merge our changes from one branch to other for integrating different feature-sets. Following are the commands for the purpose<br />
<pre class="brush: plain;">
hg merge default //merges all the changes from default branch to your current working branch
hg commit //commits all the changes in your current working branch
hg push //pushes all the change-sets into the repository for other members to use them
</pre></p>
<p>For more detailed information on branching, please refer to <a href="http://mercurial.selenic.com/wiki/Branch" title="Mercurial Branch" target="_blank">branching tutorial</a> available on Mercurial site.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2640/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2640/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2640/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2640&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/12/15/mercurial-branching-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ce0a0ccd020055820a0c1c8a3e397416?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">narinderkumar</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Started with Lift web framework : Your first step&#8230;!</title>
		<link>http://thoughts.inphina.com/2011/11/03/getting-started-with-lift-web-framework-your-first-step/</link>
		<comments>http://thoughts.inphina.com/2011/11/03/getting-started-with-lift-web-framework-your-first-step/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 10:54:17 +0000</pubDate>
		<dc:creator>Neelkanth Sachdeva</dc:creator>
				<category><![CDATA[Lift web framework]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2587</guid>
		<description><![CDATA[Lift is a sophisticated web development framework that runs inside a Java web container &#38; uses the Scala programming language.Lift removes a lot of the burdens that other frameworks place on developers by mixing together the best ideas in the marketplace today &#38; aims to make building real-time, highly interactive, and amazingly scalable applications.Here we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2587&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://liftweb.net" target="_blank">Lift </a>is a sophisticated web development framework that runs inside a Java web container &amp; uses the <a href="http://www.scala-lang.org/" target="_blank">Scala</a> programming language.Lift removes a lot of the burdens that other frameworks place on developers by mixing together the best ideas in the marketplace today &amp; aims to make building real-time, highly interactive, and amazingly scalable applications.Here we are going to introduce you with the Lift web framework in a very easy and understandable manner to give you a better quick start with Lift.</p>
<p>1. First of all you have to install simple-build-tool(sbt) on your machine. (Know more about it <a href="http://vikashazrati.wordpress.com/2011/05/19/creating-a-scala-project-with-sbt-and-working-in-eclipse/" target="_blank">Here</a> )</p>
<p>2. After installing simple-build-tool(sbt), Just create a directory for your project say &#8220;Test&#8221; , enter in to directory and just say &#8220;sbt&#8221; as:</p>
<p><pre class="brush: scala;">nsachdeva@nsachdeva-Vostro-3700:~/Test$ sbt</pre></p>
<p>3. &#8220;sbt&#8221; will prompt you to ask for creating new project, just press &#8220;y&#8221; &amp; give the Name to your project as shown in Fig. :</p>
<p><img src="http://phithoughts.files.wordpress.com/2011/11/blog3_1.png?w=600" alt="" />.</p>
<p>4. Now for creating the lift project, you’ll use a processor to generate the structure and default files you’ll need to start working on the application.From the shell, run this command:</p>
<p><pre class="brush: scala;">*lift is org.lifty lifty 1.6.1</pre></p>
<p>5. Now you have to execute the following command to populate a blank SBT project with Lift web specialities.</p>
<p><pre class="brush: scala;">&gt; lift create project-blank</pre></p>
<p>6. Just give the name of your main package &amp; the version of Lift you want to use, when it prompt for ask and then you will obtain the following type structure of your project.</p>
<p><img src="http://phithoughts.files.wordpress.com/2011/11/blog3_3.png?w=600" alt="" /></p>
<p>7. After obtaining this point, proceed by a &#8220;reload&#8221; &amp; &#8220;update&#8221;.This will download all the dependencies required.</p>
<p>8.Start the jetty and check the running application at <a href="http://localhost:8080/" target="_blank">http://localhost:8080</a>.</p>
<p><img src="http://phithoughts.files.wordpress.com/2011/11/blog3_4.png?w=600" alt="" /></p>
<p><strong><span style="text-decoration:underline;"><strong>Importing the project in &#8220;IntellijIdea&#8221;</strong>:</span></strong></p>
<p>you can now import the project on any platform with which you want to work e.g for importing the project in intellijIdea just run the following commands. This will generate the &#8220;Test.iml&#8221; file within the project structure and you will be able to import this project in IntellijIdea.</p>
<p><pre class="brush: scala;">
&gt;  *sbtIdeaRepo at http://mpeltonen.github.com/maven/
 &gt; *idea is com.github.mpeltonen sbt-idea-processor 0.4.0
....
....
 &gt; update
....
....
 &gt; idea
</pre></p>
<div align="center"><strong>Fig: The generated Project hierarchy</strong></p>
<p><img src="http://phithoughts.files.wordpress.com/2011/11/blog3_5.png?w=600" alt="" /></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2587/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2587&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/11/03/getting-started-with-lift-web-framework-your-first-step/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6d5738e0562e77e8ce2a0fc8ea784d8e?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">neelsachdeva</media:title>
		</media:content>

		<media:content url="http://phithoughts.files.wordpress.com/2011/11/blog3_1.png" medium="image" />

		<media:content url="http://phithoughts.files.wordpress.com/2011/11/blog3_3.png" medium="image" />

		<media:content url="http://phithoughts.files.wordpress.com/2011/11/blog3_4.png" medium="image" />

		<media:content url="http://phithoughts.files.wordpress.com/2011/11/blog3_5.png" medium="image" />
	</item>
		<item>
		<title>Setting up environment to work with scala using play framework.</title>
		<link>http://thoughts.inphina.com/2011/10/27/setting-up-environment-to-work-with-scala-using-play-framework-3/</link>
		<comments>http://thoughts.inphina.com/2011/10/27/setting-up-environment-to-work-with-scala-using-play-framework-3/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 11:45:55 +0000</pubDate>
		<dc:creator>Neelkanth Sachdeva</dc:creator>
				<category><![CDATA[Play]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2578</guid>
		<description><![CDATA[Play is an open source web application framework base on model-view controller architecture. Play is written in java but also provides support for the scala programming language. Here we are going to elaborate the steps about the initial environment setup to start working with scala using play framework. 1. Install scala for play using following [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2578&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.playframework.org" target="_blank">Play</a> is an open source web application framework base on model-view controller architecture. Play is written in java but also provides support for the <a href="http://www.scala-lang.org/" target="_blank">scala</a> programming language. Here we are going to elaborate the steps about the initial environment setup to start working with scala using play framework.<br />
</br><br />
1. Install scala for play using following command.<br />
<pre class="brush: xml;">$ play install scala</pre><br />
2. Create new project as follows (Let us assume that application that is to be created has the name &#8220;Test&#8221;):<br />
<pre class="brush: xml;">$ play new Test --with scala</pre><br />
3. Make the project able to import in IntellijIdea. (This is completely your choice. You can use your desired Platform to work with e.g Eclipse etc. )<br />
<pre class="brush: xml;">$ play idealize Test</pre><br />
4. Run the Test application using following command:<br />
<pre class="brush: xml;">$ play run Test</pre><br />
5. Check the created application at <a href="http://localhost:9000">http://localhost:9000</a> and verify its working.</p>
<p>Now the created application can&#8217;t be directly imported in intellijIdea. Now do it as elaborated follow:</p>
<p>6. Create the new project in IntellijIdea. The location of the project must be the same as the directory where the play project is      created.Don&#8217;t forget to uncheck the create module option because the created play project itself acts as a module.<br />
<br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_1-copy.png?w=600" alt="" /><br />
<br />
7.Now select &#8216;Project Structure&#8217; option from the file menu. Click the Module option and press the &#8220;+&#8221; button. Select the &#8220;Import existing module&#8221; option and then point towards the (.iml) file.<br />
<br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog_2_2.png?w=600" alt="" /><br />
<br />
8.Let the Module selected,Then select the &#8216;tmp/generated&#8217; directory in the right one tree and press the &#8216;Sources&#8217; button. The HTML template pages are converted to scala source files by Play ,these source files are to be included in the project along with the source files in the Test directory.<br />
<br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_3.png?w=600" alt="" /><br />
<br />
9.Select Global Libraries &gt; scala-compiler-2.9.1, Then press the &#8216;Attach Classes&#8217; button and navigate to the &#8216;lib&#8217; directory in your Scala 2.9.1 directory. Then select the following files &amp; press Apply.<br />
-scala-compiler.jar<br />
-scala-library.jar<br />
<br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_4.png?w=600" alt="" /><br />
<br />
10. Now add another global library as Global Library &gt; scala-library-2.9.1, containing the files scala-dbc.jar, scala-library.jar and scala-swing.jar. Select these files and press OK.<br />
<br />
11.Now go to the Modules &gt; Dependencies, press Add button to add new library called &#8220;scala-library-2.9.1&#8243; to dependencies.<br />
<br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_6.png?w=600" alt="" /><br />
<br />
12. Go to Module,select the scala under Test branch and set the compiler library to the presented one on your machine e.g on my machine this is the &#8220;scala-compiler-2.9.1&#8243;.<br />
<br />
<img src="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_7.png?w=600" alt="" /><br />
<br />
13.Save the Project Structure by clicking the “Ok” button.Again verify the project at <a href="http://localhost:9000/" target="_blank">http://localhost:9000</a>. Your Project development environment is now ready.</p>
<p></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2578/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2578/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2578/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2578&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/10/27/setting-up-environment-to-work-with-scala-using-play-framework-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6d5738e0562e77e8ce2a0fc8ea784d8e?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">neelsachdeva</media:title>
		</media:content>

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_1-copy.png" medium="image" />

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog_2_2.png" medium="image" />

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_3.png" medium="image" />

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_4.png" medium="image" />

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_6.png" medium="image" />

		<media:content url="http://neelkanthsachdeva.files.wordpress.com/2011/10/blog2_7.png" medium="image" />
	</item>
		<item>
		<title>Happy Diwali 2011</title>
		<link>http://thoughts.inphina.com/2011/10/26/happy-diwali-2011/</link>
		<comments>http://thoughts.inphina.com/2011/10/26/happy-diwali-2011/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 10:44:45 +0000</pubDate>
		<dc:creator>Vikas Hazrati</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/2011/10/26/happy-diwali-2011/</guid>
		<description><![CDATA[Wishing you all a very Happy, Joyous and Fun-Filled Diwali 2011. We sincerely Thank you for all your support and hope the same for years to come.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2575&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Wishing you all a very Happy, Joyous and Fun-Filled <span style="color:#800000;">Diwali 2011</span>. We sincerely Thank you for all your support and hope the same for years to come.</p>
<p><a href="http://phithoughts.files.wordpress.com/2011/10/inphina-diwali.png"><img class="aligncenter size-full wp-image-2574" title="inphina-diwali" src="http://phithoughts.files.wordpress.com/2011/10/inphina-diwali.png?w=600&#038;h=349" alt="" width="600" height="349" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2575/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2575&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/10/26/happy-diwali-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>28.632778 77.219722</georss:point>
		<geo:lat>28.632778</geo:lat>
		<geo:long>77.219722</geo:long>
		<media:content url="http://1.gravatar.com/avatar/1876e6ddd19c043e5a4dfd68c9cacdfd?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">Vikas Hazrati</media:title>
		</media:content>

		<media:content url="http://phithoughts.files.wordpress.com/2011/10/inphina-diwali.png" medium="image">
			<media:title type="html">inphina-diwali</media:title>
		</media:content>
	</item>
		<item>
		<title>Create web application menus using the Lift web framework</title>
		<link>http://thoughts.inphina.com/2011/09/30/create-web-application-menus-using-the-lift-web-framework/</link>
		<comments>http://thoughts.inphina.com/2011/09/30/create-web-application-menus-using-the-lift-web-framework/#comments</comments>
		<pubDate>Fri, 30 Sep 2011 08:43:57 +0000</pubDate>
		<dc:creator>Neelkanth Sachdeva</dc:creator>
				<category><![CDATA[Scala]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[lift]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2474</guid>
		<description><![CDATA[Lift is a powerful &#38; secure web framework having elegant features and also stresses the importance of security, maintainability, scalability and performance. Lift applications are written in Scala. Here we will discuss about creating the menus in Lift. These are the approaches to create a menu: Define the url names and routes directly in Boot.scala. Create [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2474&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://liftweb.net" target="_blank">Lift</a> is a powerful &amp; secure web framework having elegant features and also stresses the importance of security, maintainability, scalability and performance. Lift applications are written in <a href="http://www.scala-lang.org" target="_blank">Scala</a>.</p>
<p>Here we will discuss about creating the menus in Lift. These are the approaches to create a menu:</p>
<ul>
<li>Define the url names and routes directly in <code>Boot.scala</code>.</li>
<li>Create the seperate Singleton for defining menu items</code>.</li>
</ul>
<p>Let us see how this works:</p>
<h2>Define the url names and routes in <code>Boot.scala</code></h2>
<p><pre class="brush: scala;">
class Boot {
  def boot {
    // where to search snippet
    LiftRules.addToPackages(&quot;demo.helloworld&quot;)

    // Build SiteMap
    val entries =
      Menu(Loc(&quot;Home&quot;, List(&quot;index&quot;), &quot;Home&quot;))::
      Menu(Loc(&quot;Items&quot;, List(&quot;items&quot;), &quot;Items&quot;)) ::
      Menu(Loc(&quot;Search&quot;, List(&quot;search&quot;), &quot;Search&quot;)) :: Nil

    // Sitemap
    LiftRules.setSiteMap(SiteMap(entries:_*))

  }
}
</pre></p>
<p>And here is the output:</p>
<p><img src="http://phithoughts.files.wordpress.com/2011/09/blog.png?w=600"></img><br />
</br></p>
<h2>Create the seperate Singleton for defining menu items</code></h2>
<p>We will define the sitemap in <code>Boot.scala</code>. Sitemap will obtained from the Application Singleton</p>
<p><pre class="brush: scala;">
class Boot {
  def boot {
    LiftRules.setSiteMap(SiteMap(Application.sitemap: _*))
  }
}
</pre></p>
<p>Now define your menu items in this seperate singleton say "Application" singleton.</p>
<p><pre class="brush: scala;">
object Application {
  // Sitemap
  val sitemap = List(
    Menu.i(&quot;Items&quot;) / &quot;items&quot;,
    Menu.i(&quot;Search&quot;) / &quot;search&quot;
  ) ::: User.menus
}
</pre></p>
<p>When working with html pages always provide the links to pages corresponds to as defined in your singleton's sitemap e.g</p>
<p><pre class="brush: xml;">
  &lt;li&gt;&lt;a href=&quot;/items&quot;&gt;Items&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;/search&quot;&gt;Search&lt;/a&gt;&lt;/li&gt;
</pre></p>
<p>Lift will search for corresponding HTML pages defined either in <code>Boot.scala</code> or in <code>Application.scala</code> in <code>src/main/webapp</code> folder.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2474/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2474/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2474/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2474&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/09/30/create-web-application-menus-using-the-lift-web-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6d5738e0562e77e8ce2a0fc8ea784d8e?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">neelsachdeva</media:title>
		</media:content>

		<media:content url="http://phithoughts.files.wordpress.com/2011/09/blog.png" medium="image" />
	</item>
		<item>
		<title>Hot reload / Build on save for Adobe Flex</title>
		<link>http://thoughts.inphina.com/2011/09/26/hot-reload-build-on-save-for-adobe-flex/</link>
		<comments>http://thoughts.inphina.com/2011/09/26/hot-reload-build-on-save-for-adobe-flex/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 06:52:41 +0000</pubDate>
		<dc:creator>Srirangan</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[adobe flex]]></category>
		<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://thoughts.inphina.com/?p=2441</guid>
		<description><![CDATA[If you&#8217;re not using Adobe Flash Builder for developing Adobe Flex apps, you might be missing the build on save (or build automatically / hot reload) feature. Here&#8217;s a little Node.js utility that does the same. While working on Flex with gedit (or any other text editor), just keep &#8220;hotflex&#8221; running in the background. It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2441&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re not using Adobe Flash Builder for developing Adobe Flex apps, you might be missing the  build on save (or build automatically / hot reload) feature. </p>
<p>Here&#8217;s a little Node.js utility that does the same. While working on Flex with gedit (or any other text editor), just keep &#8220;hotflex&#8221; running in the background. It watches all MXML and AS3 files and rebuilds the project on save.</p>
<h2>Screenshots</h2>
<a href="http://thoughts.inphina.com/2011/09/26/hot-reload-build-on-save-for-adobe-flex/#gallery-1-slideshow">Click to view slideshow.</a>
<h2>Dependencies</h2>
<p>Node.js and NPM are required, refer to &#8211; <a href="http://srirangan.net/2011-09-setup-node-js-and-npm-on-ubuntu">Setup Node.js and NPM on Ubuntu</a></p>
<p>For notifications on Ubuntu, install libnotify-bin:<br />
<pre class="brush: plain;">    sudo apt-get install libnotify-bin</pre></p>
<h2>Install</h2>
<p>From NPM:<br />
<pre class="brush: plain;">    sudo npm install hotflex -g</pre></p>
<p>From GitHub<br />
<pre class="brush: plain;">    git clone git://github.com/Srirangan/hotflex.git
    cd hotflex
    sudo npm install -g</pre></p>
<h2>Configure</h2>
<p>You will need to create a <code>hotflex.json</code> file containing the following parameters:<br />
<pre class="brush: plain;">    { &quot;source&quot;: &quot;./src/main/flex/main.mxml&quot;
    , &quot;sourceFolder&quot;: &quot;./src&quot;
    , &quot;target&quot;: &quot;./bin/main.swf&quot;
    , &quot;lib&quot;: &quot;./lib&quot;
    }</pre><br />
The <code>lib</code> parameter is optional while the rest are mandatory.</p>
<h2>Run</h2>
<p>Execute <code>hotflex</code> from the folder containing the <code>hotflex.json</code> file, preferably your project root.<br />
<pre class="brush: plain;">hotflex</pre></p>
<h2>Meta</h2>
<p>GitHub repository &#8211; <a href="https://github.com/Srirangan/hotflex">https://github.com/Srirangan/hotflex</a><br />
NPM &#8211; <a href="http://search.npmjs.org/#/hotflex">http://search.npmjs.org/#/hotflex</a></p>
<h2>To do</h2>
<ul>
<li>Integration with Adobe Flex Compiler Shell <code>fcsh</code> for faster builds</li>
<li>Integration for Growl for OSX notifications. Currently notifications work for Ubuntu.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phithoughts.wordpress.com/2441/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phithoughts.wordpress.com/2441/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phithoughts.wordpress.com/2441/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phithoughts.wordpress.com/2441/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phithoughts.wordpress.com/2441/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phithoughts.wordpress.com/2441/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phithoughts.wordpress.com/2441/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phithoughts.wordpress.com/2441/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thoughts.inphina.com&amp;blog=11743822&amp;post=2441&amp;subd=phithoughts&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thoughts.inphina.com/2011/09/26/hot-reload-build-on-save-for-adobe-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f87ef3ed78fcf73c9e1b97c6b4c2795d?s=96&#38;d=monsterid&#38;r=G" medium="image">
			<media:title type="html">sriinphina</media:title>
		</media:content>
	</item>
	</channel>
</rss>
