<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Spritle's Blog</title>
	
	<link>http://www.spritle.com/blogs</link>
	<description>Web and Mobile apps made</description>
	<lastBuildDate>Fri, 12 Apr 2013 12:27:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Spritle" /><feedburner:info uri="spritle" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>More about observable arrays in Knockoutjs</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/_gZeD44PPCw/</link>
		<comments>http://www.spritle.com/blogs/2013/04/10/more-about-observable-arrays-in-knockoutjs/#comments</comments>
		<pubDate>Wed, 10 Apr 2013 12:22:11 +0000</pubDate>
		<dc:creator>Surendran Sukumaran</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://198.211.115.49/blogs/?p=2979</guid>
		<description><![CDATA[ObservableArray is a nice way to update a collection in Knockoutjs, if we want to repeat certain UI sections like name of the products to get the desired html output we can use Observablearray along with foreach. Lets see them now. Expected output : &#60;ul&#62; &#60;li&#62; iPhone &#60;/li&#62; &#60;li&#62; Samsung Galaxy &#60;/li&#62; &#60;li&#62; Nokia Lumia [...]]]></description>
				<content:encoded><![CDATA[<p>ObservableArray is a nice way to update a collection in Knockoutjs, if we want to repeat certain UI sections like name of the products to get the desired html  output we can use Observablearray along with foreach.<br />
Lets see them now.<span id="more-2979"></span></p>
<p><img src="http://wakeupandcode.com/wp-content/uploads/2013/03/knockoutjs1.png"/></p>
<p>Expected output :</p>
<pre class="brush: html">

&lt;ul&gt;
  &lt;li&gt;
    iPhone
  &lt;/li&gt;
  &lt;li&gt;
    Samsung Galaxy
  &lt;/li&gt;
  &lt;li&gt;
    Nokia  Lumia
  &lt;/li&gt;
&lt;/ul&gt; 

</pre>
<p>We use foreach to loop through  a section of markup for each entry in an array.</p>
<pre class="brush: html">

&lt;ul data-bind=&quot;foreach: products&quot;&gt;
  &lt;li data-bind=&quot;text: product_name&quot;&gt; &lt;/li&gt;
&lt;/ul&gt; 

</pre>
<p>Here is the script to update values in the html.</p>
<pre class="brush: javascript">

&lt;script type=&quot;text/javascript&quot;&gt;

var ProductViewModel  = { self.products = ko.observableArray([]) }
ko.applyBindings(ProductViewModel);

&lt;/script&gt;
</pre>
<p>So when the page loads we are not assigning any values to the products, we just keep it as empty array.<br />
When we run this in browser we can see a single list with no values.<br />
Okay so let&#8217;s hide that list if the products array size is not greater than 0</p>
<pre class="brush: ruby">
  data-bind=&quot;visible: products().length &gt; 0
</pre>
<p>The item will be visible only if &#8220;products().length &gt; 0&#8243;<br />
This is how the actual html will look like.	</p>
<pre class="brush: html">	

&lt;ul data-bind=&quot;foreach: products, visible: products().length &gt; 0&quot;&gt;
  &lt;li data-bind=&quot;text: product_name&quot;&gt; &lt;/li&gt;
&lt;/ul&gt; 

</pre>
<p>Now try it in the browser, oh nice the list isn&#8217;t appearing.<br />
Our next job would be filling up a list of products with observable array.<br />
We can have a products_list array of hashes which has the &#8220;product_name&#8221; as the key and a value for it. </p>
<pre class="brush: javascript">

&lt;script type=&quot;text/javascript&quot;&gt;
   var products_list = [{product_name : &quot;iPhone&quot;},
                        {product_name : &quot;Samsung Galaxy&quot;},
                        {product_name : &quot;Nokia Lumia&quot;}]
&lt;/script&gt;

</pre>
<p>Let&#8217;s have a link, once we click on the link we will fill the products.</p>
<pre class="brush: ruby">
&lt;a href=&quot;#&quot;&gt;Fill Products&lt;/a&gt;
</pre>
<p>We are adding a click event for this link which will call the fillProducts products method, where we gonna update the products UI</p>
<p>So the final js code would look like this</p>
<pre class="brush: javascript">

&lt;script type=&quot;text/javascript&quot;&gt;
var products_list = [{product_name : &quot;iPhone&quot;},
                     {product_name : &quot;Samsung Galaxy&quot;},
                     {product_name : &quot;Nokia Lumia&quot;}];
var ProductViewModel  = {
			 products : ko.observableArray([]),
			 fillProducts : function() { this.products(products_list); }
                        }
ko.applyBindings(ProductViewModel);
&lt;/script&gt;

</pre>
<p>Now run this in the browser, Wow.<br />
You will see the products list filled with values.My next blog would be about nested observablearray.</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2979&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/_gZeD44PPCw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/04/10/more-about-observable-arrays-in-knockoutjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/04/10/more-about-observable-arrays-in-knockoutjs/</feedburner:origLink></item>
		<item>
		<title>Domain name registration using eNom API</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/ItBogWVhIX0/</link>
		<comments>http://www.spritle.com/blogs/2013/04/05/domain-name-registration-using-enom-api/#comments</comments>
		<pubDate>Fri, 05 Apr 2013 12:14:14 +0000</pubDate>
		<dc:creator>Prabu D</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2580</guid>
		<description><![CDATA[One of the most crucial requirements for establishing an online identity is registering a domain name. I came to know about eNom API which does the job in easier way. I have opportunity to learn about domain registration using eNom API. eNom makes it easy for anybody to sell online services at prices that fit [...]]]></description>
				<content:encoded><![CDATA[<p>One of the most crucial requirements for establishing an online identity is registering a domain name. I came to know about eNom API which does the job in easier way. I have opportunity to learn about domain registration using eNom API.<br />
eNom makes it easy for anybody to sell online services at prices that fit your core business, volume, and size. As a reseller you&#8217;ll have access to all eNom selling options. eNom offering over 70 TLDs from all over the world it will attract customers. For more detail refer http://www.enom.com/resellers/benefits-domains.aspx<br />
<span id="more-2580"></span></p>
<p>So, you want to integrate your eNom reseller API ? Create your reseller account <a href="https://www.enom.com/signup/create-account.aspx?" title="Click here"></a>. and the steps you need to follow as,<br />
<a href="http://www.spritle.com/blogs/wp-content/uploads/2013/02/API.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/02/API-300x161.png" alt="API" width="300" height="161" class="alignright size-medium wp-image-2598" /></a></p>
<p>1. IP Registration<br />
   In order to use the Enom API, you must first contact them and let them know the server IP address. This is part of Enom&#8217;s security to prevent unauthorised users being able to submit registration requests to your account. </p>
<p>2. Test Mode<br />
   eNom offers to demonstrate all API call in test mode. see the API interface setup <a href="www.enom.com/resellers/reseller-testaccount.aspx?" title="here">here</a><br />
Note : actually no domain will be registered and you will not be charged for test interface. </p>
<p>3. Run a demo API call<br />
   Make sure that you Add/Edit/Delete public IP addresses that are allowed to access your account on the test servers. To find your public IP <a href="http://whatismyipaddress.com/" title="Click here" target="_blank">click here</a></p>
<p>Construct a URL by appending the key/value pairs as a query string to enom API Interface URL. Then make a simple HTTP request and That&#8217;s it!</p>
<p>1. To Check specific domain name available ( CHECK )</p>
<pre class="brush: php">

    URL http://resellertest.enom.com/interface.asp?command=check&amp;
                                     uid=resellid&amp;
                                     pw=resellpw&amp;
                                     sld=example&amp;tld=com&amp;responsetype=xml

</pre>
<p>2. To list available domain names ( NAMESPINNER )</p>
<pre class="brush: php">

    URL http://resellertest.enom.com/interface.asp?command=NameSpinner&amp;
                                     UID=resellid&amp;
                                     pw=resellpw&amp;
                                     SLD=example&amp;TLD=com&amp;
                                     UseHyphens=true&amp;UseNumbers=true
                                     &amp;MaxResults=10&amp;ResponseType=XML

</pre>
<p>3. To bill and register a domain name ( PURCHASE )</p>
<pre class="brush: php">

     URL http://resellertest.enom.com/interface.asp?command=Purchase&amp;
                                      uid=resellid&amp;
                                      pw=resellpw&amp;sld=resellerdocs104
                                      &amp;tld=com&amp;ResponseType=XML

</pre>
<p>4. To get domain status information ( GETDOMININFO )</p>
<pre class="brush: php">

     URL http://resellertest.enom.com/interface.asp?command=GetDomainInfo&amp;
                                      UID=resellid&amp;
                                      PW=resellpw&amp;sld=resellerdocs&amp;
                                      tld=com&amp;ResponseType=XML
</pre>
<p>5. To set domain name server (DNS)</p>
<pre class="brush: php">

      URL http://resellertest.enom.com/interface.asp?command=UpDateCusPreferences&amp;
                                       uid=resellid&amp;
                                       pw=resellpw&amp;
                                       usedns=0&amp;dns1=ns1.name-services.com&amp;
                                       dns2=ns2.name-services.com&amp;responsetype=xml

</pre>
<p>6. To set host records ( SETHOSTS )</p>
<pre class="brush: php">

       URL http://resellertest.enom.com/interface.asp?command=SetHosts&amp;
                                        uid=resellid&amp;
                                        pw=resellpw&amp;sld=resellerdocs&amp;tld=com&amp;
                                        HostName1=@&amp;RecordType1=A&amp;Address1=66.150.5.189
                                        &amp;HostName2=photos&amp;RecordType2=CNAME&amp;Address2=photos.msn.com.&amp;
                                        HostName3=yahoo&amp;RecordType3=URL&amp;Address3=204.71.200.72&amp;
                                        HostName4=msn&amp;RecordType4=FRAME&amp;
                                        Address4=http://www.msn.com&amp;responsetype=xml
</pre>
<p>See more catalog enom provides http://www.enom.com/APICommandCatalog/index.htm</p>
<p>Sample code using ruby to search availability of doeazy.com domain using eNom API</p>
<pre class="brush: php">
check_url = &quot;http://resellertest.enom.com/interface.asp?
command=check&amp;uid=resellid&amp;pw=resellpw&amp;sld=doeazy&amp;tld=com&amp;responsetype=xml&quot;
@available_domain_list =[]
reader = Nokogiri::XML(open(check_url))
reader.search(&quot;interface-response&quot;).each do |node| 
  node.search(&quot;RRPText&quot;).each { |att|  @status = att.content }
  node.search(&quot;DomainName&quot;).each { |att| @available_domain_list &lt;&lt; att.content }
end
if @status == &quot;Domain available&quot;
  available = true
  response = &quot;Congratulations! &lt;br/&gt; #{@available_domain_list} is available.&quot; 
else
  response = &quot;#{@available_domain_list} is not available.&quot;
  @available_domain_list = []
end
return response
</pre>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2580&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/ItBogWVhIX0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/04/05/domain-name-registration-using-enom-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/04/05/domain-name-registration-using-enom-api/</feedburner:origLink></item>
		<item>
		<title>Make Parallel HTTP Requests Using Typhoeus</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/Vqx4e8dfpPo/</link>
		<comments>http://www.spritle.com/blogs/2013/04/01/make-parallel-http-requests-using-typhoeus/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 19:31:05 +0000</pubDate>
		<dc:creator>Balaji D Loganathan</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2880</guid>
		<description><![CDATA[Parallel http request using Typhoeus and Httparty. Typhoeus took 0.99148906 seconds Httparty took 3.370132528 seconds You can find the gist at https://gist.github.com/spritle/5261906 Read more at http://typhoeus.github.com/articles/getting_started.html#installation Credit goes to Paul and https://github.com/i0rek]]></description>
				<content:encoded><![CDATA[<p>Parallel http request using Typhoeus and Httparty.</p>
<p>Typhoeus took 0.99148906 seconds<br />
Httparty took 3.370132528 seconds<br />
You can find the gist at https://gist.github.com/spritle/5261906<br />
<span id="more-2880"></span></p>
<p><script src="https://gist.github.com/spritle/5261906.js"></script><br />
Read more at http://typhoeus.github.com/articles/getting_started.html#installation</p>
<p>Credit goes to Paul and https://github.com/i0rek</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2880&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/Vqx4e8dfpPo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/04/01/make-parallel-http-requests-using-typhoeus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/04/01/make-parallel-http-requests-using-typhoeus/</feedburner:origLink></item>
		<item>
		<title>Sync Two Cloud Servers Files</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/heyhD-bqJzM/</link>
		<comments>http://www.spritle.com/blogs/2013/03/30/sync-two-cloud-servers-files/#comments</comments>
		<pubDate>Sat, 30 Mar 2013 12:22:46 +0000</pubDate>
		<dc:creator>Sivakumar V</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2887</guid>
		<description><![CDATA[Recently I have implemented two-way files synchronization between two Ubuntu Cloud servers using unison and inotifywait. Thought I would share it here as a blog for future references. Requirements: 1. Setup: Two Rackspace Cloud server running Ubuntu or your own VPS server. 2. Smile Unison is a file-synchronization tool for Unix and Windows. It allows to [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I have implemented two-way files synchronization between two Ubuntu Cloud servers using <strong>unison</strong> and <strong>inotifywait</strong>.<br />
Thought I would share it here as a blog for future references. </p>
<p>Requirements:<br />
1. Setup: Two Rackspace Cloud server running Ubuntu or your own VPS server.<br />
2. Smile<br />
<span id="more-2887"></span></p>
<p><em>Unison is a file-synchronization tool for Unix and Windows. It allows to replicate a collection of files and directories between two servers (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.</em></p>
<p><em>inotifywait is an Linux utility to notify file changes.</em></p>
<p>Now, lets use both of them</p>
<p>Install unison on both servers</p>
<pre class="brush: php">

$ apt-get install unison openssh-server ssh

</pre>
<p>Unison requires password less ssh-key authentication between servers. Lets set them.<br />
Server1:</p>
<p>Generate public/private key on server1.</p>
<pre class="brush: php">
$ ssh-keygen -t rsa
</pre>
<p>Copy the ssh keys and paste it into server2 authorized_keys which would be typically located at ~/.ssh/authorized_keys. (if not create it)</p>
<p>To make sure SSH working with password try login to server2 from server 1, it should connect without asking password.</p>
<p>Server1:</p>
<pre class="brush: php">
$ ssh root@server2_ip_address
</pre>
<p>Install inotifywait on both servers</p>
<pre class="brush: php">

$ sudo apt-get install inotify-tools
</pre>
<p>Now unison and inotifywait are ready to use. Run the unison to listen for folder between two servers.</p>
<pre class="brush: php">
$ unison /var/www/proj1/images ssh://192.168.0.5//var/www/proje1/images/
</pre>
<p>Open server1 terminal and try to create some file inside /var/www/proj1/folder on server1. Unison will detect the file and prompt to user to enter.<br />
To skip prompting use -batch option.</p>
<pre class="brush: php">
$ unison -batch /var/www/proj1/images ssh://192.168.0.101//var/www/proje1/images/
</pre>
<p>Once file synchronized with server2 unison will stop. To make unison to listen always for file changes create small shell script that you can run in background.</p>
<pre class="brush: php">
$ nano sync_file.sh
  #!/bin/bash
   LOCATION=&quot;/var/www/proj1/images/&quot;
   RSYNC_OPTIONS=...
   while true
   do
    inotifywait -r $LOCATION
    unison -batch $LOCATION ssh://&lt;IP ADDRESS&gt;///$LOCATION
   done&lt;/pre&gt;
</pre>
<p>Run the shell script</p>
<pre class="brush: php">
$ sh sync_file.sh
</pre>
<p>Run the shell script in background(add &amp; symbol at the end).</p>
<pre class="brush: php">
$ nohub sh sync_file.sh &amp;
</pre>
<p>It should work fine if not please post your issue as a comment.</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2887&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/heyhD-bqJzM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/30/sync-two-cloud-servers-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/30/sync-two-cloud-servers-files/</feedburner:origLink></item>
		<item>
		<title>My First-hand Experience With KnockoutJS</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/w4xKcouWUsc/</link>
		<comments>http://www.spritle.com/blogs/2013/03/27/my-first-hand-experience-with-knockoutjs/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 13:15:17 +0000</pubDate>
		<dc:creator>Surendran Sukumaran</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[knockoutjs]]></category>
		<category><![CDATA[underscorjs]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2822</guid>
		<description><![CDATA[Why Knockout ? When I worked for a single pager cross platform mobile application, there were lot of UI need to be updated very frequently, Initially I did that using Jquery which is an awesome js library, but still I need to write lots of code to find and update the element every time there [...]]]></description>
				<content:encoded><![CDATA[<h3>Why Knockout ? </h3>
<p>When I worked for a single pager cross platform mobile application, there were lot of UI need to be updated very frequently, Initially I did that using Jquery which is an awesome js library, but still I need to write lots of code to find and update the element every time there is a change in the UI.<span id="more-2822"></span></p>
<p>So I was looking out for some JavaScript libraries to simplify my work and came through <a href="http://knockoutjs.com/" title="Knockoutjs">Knockout </a>js library, which is a dynamic JavaScript library using MVVM pattern. </p>
<h3>No Other JS Library Dependencies</h3>
<p>It has dynamic bindings, automatic ui refresh, dependency tracking and templating. The good thing is that it is not dependent on any JavaScript libraries like jQuery or Prototype. Just knockout.js library is enough in your app.</p>
<p>They have a very good interactive tutorial on their website which can help you to get started quickly. You can try it out at <a href="http://learn.knockoutjs.com/" title="Knockout Tutorial" target="_blank">Knockout Tutorial</a>.</p>
<h3>External Templating Engines</h3>
<p>Knockout has bindings for almost all the elements with text, values and events as well. Templating is also available.<br />
I am a big fan of <a href="underscorejs.org/" title="Underscore js" target="_blank">Underscore.js</a> and Knockout also allows us to integrate some external string based templating engine like <a href="#">Jquery template</a> and underscore templating engine. </p>
<h3>Simple Code Snippet</h3>
<pre class="brush: html">
&lt;!-- This is a *view* - HTML markup that defines the appearance of your UI --&gt;
&lt;div&gt;Name: &lt;span&gt;Samsumg Grand&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;Price:&lt;span&gt;22,000&lt;/span&gt;&lt;/div&gt;
</pre>
<p><strong>Step 1 : </strong> add &#8220;data-bind&#8221; attribute</p>
<pre class="brush: html">
&lt;div&gt;Name: &lt;span data-bind=&quot;text : product_name&quot;&gt;Samsumg Grand&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;Price:&lt;span data-bind=&quot;text : product_price&quot;&gt;22,000&lt;/span&gt;&lt;/div&gt;
</pre>
<p><strong>Step 2 : </strong>  apply bindings</p>
<pre class="brush: javascript">
// This is a simple *viewmodel* - JavaScript that defines the data and behavior of your UI
function updateValues() {
    this.product_name= &quot;Apple iPhone 4s&quot;;
    this.product_price= &quot;35,000&quot;;
}

// Activates knockout.js
ko.applyBindings(new updateValues());
&lt;/pre&gt;
</pre>
<p><strong> Output : </strong></p>
<pre>
Name: Apple iPhone 4s
Price: 35,000
</pre>
<p>I am almost done with one of my one pager mobile application with Knockout js, will share more about my experience with knockoutjs and code samples in my next blog.</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2822&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/w4xKcouWUsc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/27/my-first-hand-experience-with-knockoutjs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/27/my-first-hand-experience-with-knockoutjs/</feedburner:origLink></item>
		<item>
		<title>File Upload using Backbone.js, paperclip and jquery upload in rails</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/JxR7VDULZZ4/</link>
		<comments>http://www.spritle.com/blogs/2013/03/21/file-upload-using-backbone-js-paperclip-and-jquery-upload-in-rails/#comments</comments>
		<pubDate>Thu, 21 Mar 2013 04:53:14 +0000</pubDate>
		<dc:creator>Dhepthi L Narasimhan</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[backbone.js]]></category>
		<category><![CDATA[jquery-fileupload]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rails 3.2]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2784</guid>
		<description><![CDATA[Learning new things is quite common for developers. Now its time to learn an interesting topic which is evolving around RoR developers. A concept that provides models, collections, views and connects all existing API over RESTful JSON interface which is Backbone.js Now let see how to perform basic CRUD operation using backbone.js in rails. First [...]]]></description>
				<content:encoded><![CDATA[<p>Learning new things is quite common for developers. Now its time to learn an interesting topic which is evolving around RoR developers. A concept that provides models, collections, views and connects all existing API over RESTful JSON interface which is <a href="http://backbonejs.org/" target="_blank">Backbone.js</a> <span id="more-2784"></span></p>
<p>Now let see how to perform basic CRUD operation using backbone.js in rails. </p>
<p>First let create a sample app named <strong>&#8220;Inspection&#8221;</strong></p>
<pre class="brush: ruby">
rails new Inspection
</pre>
<p>In your Gemfile, add this line</p>
<pre class="brush: ruby">
gem &quot;rails-backbone&quot;, &#039;0.9.10&#039;
</pre>
<p><strong>rails-backbone</strong> gem makes our task easier to use backbone in our rails application</p>
<p>Run the following commands from terminal</p>
<pre class="brush: ruby">
bundle install
rails g backbone:install
</pre>
<p>This command creates the basic structure for our backbone files</p>
<p>Now lets create a scaffold for <strong>Checklist</strong></p>
<pre class="brush: ruby">
rails g scaffold Checklist title:string comments:string 
rake db:migrate
</pre>
<p>The above usually generates rails server side crud scaffolding.</p>
<p>We can generate backbone.js crud scaffolding to perform simple single page crud operation using</p>
<pre class="brush: ruby"> 
rails g backbone:scaffold Checklist title:string comments:string
</pre>
<p>Now finally we have to edit <strong>app/views/posts/index.html.erb</strong> with following</p>
<pre class="brush: ruby">
&lt;div id=&quot;checklists&quot;&gt;&lt;/div&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
  $(function() {
  window.router = new Inspection.Routers.ChecklistsRouter({checklists: &lt;%= @checklists.to_json.html_safe -%&gt;});
  Backbone.history.start();
  });
&lt;/script&gt;
</pre>
<p>This creates a new instance of our Router which will handle the whole CRUD.</p>
<p>Now starting our server, we can access fully functioning single page crud app for Checklist models. The interesting part is to deal with file uploads. File upload in rails can be done easily with <strong>paperclip</strong> gem</p>
<p>But if in case we are dealing with backbone.js, we have to approach another way to send attachment to server. In that case we can use <strong>jquery-fileupload-rails</strong> gem. </p>
<p>To achieve file-upload in our backbone rails application, some additional steps are</p>
<p>Add below lines to your Gemfile</p>
<pre class="brush: ruby">
gem &#039;jquery-fileupload-rails&#039;,&#039;0.3.0&#039;
gem &#039;paperclip&#039;,&#039;3.4.1&#039;
</pre>
<p>and run</p>
<pre class="brush: ruby">
bundle install
</pre>
<p>Now In order to upload images to our model,we will run Paperclip generator command to save our images.</p>
<pre class="brush: ruby">
rails generate paperclip Checklist photo
</pre>
<p>Add below line to <strong>application.js</strong></p>
<pre class="brush: ruby">
//= require jqueryfileuploadbackbone
</pre>
<p>Add below lines to <strong>Checklist.rb</strong> file</p>
<pre class="brush: ruby">
attr_accessible :photo
has_attached_file :photo
</pre>
<p>Edit your <strong>new.jst.ejs template</strong> as</p>
<pre class="brush: ruby">
&lt;form id=&quot;new-checklist&quot; name=&quot;checklist&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot; action=&quot;/checklists&quot; accept-charset=&quot;UTF-8&quot;&gt;
  ....
 &lt;input type=&quot;file&quot; id=&quot;photo&quot; name=&quot;photo&quot;&gt;
&lt;/form&gt;
</pre>
<p>Edit your <strong>new_view.js.coffee</strong> file to attach file using fileupload gem as</p>
<pre class="brush: ruby">
save: (e) -&gt;
   	@$el.fileupload
     add: (e, data) -&gt;
       data.submit()

     done: (e, data) =&gt;
       window.location = &quot;/&quot;
</pre>
<p>Now in the <strong>checklist_controller.rb</strong> file, change the params in create method the following way</p>
<pre class="brush: ruby">
@checklist = Checklist.new(:photo=&gt; params[&quot;photo&quot;],:title =&gt; params[&quot;title&quot;],:comments =&gt; params[&quot;comments&quot;])
@checklist.save
</pre>
<p>Now the image will be saved in public folder. In general, paperclip uses helper(<strong>Model.attribute.url</strong>) to get the full path of image but it will not work in backbone.js view </p>
<p>We will modify the index action to get the full path of the image. Replace the following line in index action</p>
<pre class="brush: ruby">
@checklists = Checklist.find(:all)
@checklists.map{|k,v| k.photo_file_name = k.photo.url }
</pre>
<p>In above, we are replacing the photo_file_name with full path. </p>
<p>Finally, we have done with all necessary changes needed to upload an image to rails backbone using paperclip and jquery fileupload gem.</p>
<p>The output of Inspection application looks like this</p>
<p><a href="http://www.spritle.com/blogs/wp-content/uploads/2013/03/Screen-shot-2013-03-20-at-10.04.37-PM.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/03/Screen-shot-2013-03-20-at-10.04.37-PM-300x272.png" alt="Screen shot 2013-03-20 at 10.04.37 PM" width="300" height="270" class="aligncenter size-medium wp-image-2793" /></a>  <a href="http://www.spritle.com/blogs/wp-content/uploads/2013/03/Screen-shot-2013-03-20-at-10.06.47-PM.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/03/Screen-shot-2013-03-20-at-10.06.47-PM.png" alt="Screen shot 2013-03-20 at 10.06.47 PM" width="370" height="300" class="aligncenter size-full wp-image-2794" /></a><br />
I hope this blog will be helpful for understanding backbone fileuplaod concept. Source code of inspection application is available at <a href="https://github.com/Dhepthi/inspection">https://github.com/Dhepthi/inspection</a>. Please feel free to improve and send me a pull request. Any suggestion or comments are welcome. </p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2784&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/JxR7VDULZZ4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/21/file-upload-using-backbone-js-paperclip-and-jquery-upload-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/21/file-upload-using-backbone-js-paperclip-and-jquery-upload-in-rails/</feedburner:origLink></item>
		<item>
		<title>Image Uploading With Rhodes, RhoConnect &amp; Rails3</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/dEUzlywZfWM/</link>
		<comments>http://www.spritle.com/blogs/2013/03/15/image-uploading-with-rhodes-rhoconnect-rails3/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 11:14:08 +0000</pubDate>
		<dc:creator>Visnu Priya</dc:creator>
				<category><![CDATA[Rhomobile]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[paperclip]]></category>
		<category><![CDATA[rhoconnect]]></category>
		<category><![CDATA[rhodes]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2686</guid>
		<description><![CDATA[Recently I working on an app project which involves uploading and transferring images from smartphones to Web and vice-versa. My stack was Rhodes, RhoConnect, Rails 3. Thought I would share pieces of code snippets that would help you get this all integrated in your RhoMobile apps. Lets say we have an App that got Product [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I working on an app project which involves uploading and transferring images from smartphones to Web and vice-versa. My stack was Rhodes, RhoConnect, Rails 3. Thought I would share <b>pieces of code snippets</b> that would help you get this all integrated in your RhoMobile apps.<br />
<span id="more-2686"></span><br />
Lets say we have an App that got Product model with some attributes along with product image.<br />
<strong>Rails part:</strong><br />
Used the famous Paperclip gem and while exposing the API to RhoConnect, I used the base64.encode64 method.</p>
<pre class="brush: ruby">
require &#039;base64&#039;
product= Product.new(params[:product])
product.save
if product.image_file_name != nil
product.update_attributes({:encoded_image =&amp;gt; Base64.encode64(open(product.image.path,&quot;rb&quot;) { |io| io.read })})
end
</pre>
<p><strong>Rhodes part:</strong><br />
Enabled the camera capability to upload picture or take new picture.</p>
<pre class="brush: ruby">
capabilities:
  - camera
</pre>
<p>Sample Take picture code from Rhodes controller</p>
<pre class="brush: ruby">
def take_picture
    width =100
    height =100
    settings = {:desired_width =&gt; width, :desired_height =&gt; height }
    Camera::take_picture(url_for(:action =&gt; :camera_callback), settings)
    redirect :action =&gt; :wait
end
</pre>
<p>Sample Choose picture code from Rhodes controller</p>
<pre class="brush: ruby">
def choose_picture
    width =100
    height =100
    settings = {:desired_width =&gt; width, :desired_height =&gt; height }
    Camera::take_picture(url_for(:action =&gt; :camera_callback), settings)
    redirect :action =&gt; :wait
end
</pre>
<p>Now the <b>key thing</b> is to encode the image and store it in image_uri attribute while camera_callback is called</p>
<pre class="brush: ruby">
require &#039;base64&#039;
def camera_callback
    imagebase64= Base64.encode64(open(Rho::RhoApplication::get_blob_path(@params[&#039;image_uri&#039;])) { |io| io.read }).gsub(/\r/,&quot;&quot;).gsub(/\n/,&quot;&quot;)
    @product=Product.create({:image_uri =&gt; imagebase64})
end
</pre>
<p><strong>RhoConnect part</strong><br />
Generate the RhoConnect model called Product which by default have several methods.</p>
<p>The code snippet from query method (check the image_uri hash)</p>
<pre class="brush: ruby">
def query(params=nil)
    @products=JSON.parse(RestClient.get(&quot;http://localhost:3000/products.json&quot;).body)
    @result={}
    @products.each do |product|
      @result[product[&quot;id&quot;].to_s] = {:name =&gt; product[&#039;name&#039;],:image_uri =&gt; product[&#039;encoded_image&#039;]}
    end if @products
    @result
end
</pre>
<p>The code snippet from create method</p>
<pre class="brush: ruby">
def create(create_hash)
    url = &quot;http://localhost:3000/products.json&quot;
    product = RestClient.post( url, create_hash.to_json, :content_type =&gt; &#039;application/json&#039;)
end
</pre>
<p>Let me know if you want me to publish a simple Android app on Google Play so that you can actually play with the whole application.</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2686&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/dEUzlywZfWM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/15/image-uploading-with-rhodes-rhoconnect-rails3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/15/image-uploading-with-rhodes-rhoconnect-rails3/</feedburner:origLink></item>
		<item>
		<title>Using Facebook Realtime Updates in Ruby on Rails</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/YjNeELxjqWw/</link>
		<comments>http://www.spritle.com/blogs/2013/03/11/using-facebook-realtime-updates-in-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 11:07:47 +0000</pubDate>
		<dc:creator>Rajeswari K</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2695</guid>
		<description><![CDATA[Recently I got chance to try Facebook real time API in one of our project. Realtime Updates enables applications to subscribe to changes in data. For Facebook apps, instead of continuously polling the Facebook Graph API for updated data we can get update only when the data is changed in Facebook. Whenever a subscribed change [...]]]></description>
				<content:encoded><![CDATA[<p>Recently I got chance to try Facebook real time API in one of our project. Realtime Updates enables applications to subscribe to changes in data. For Facebook apps, instead of continuously polling the Facebook Graph API for updated data we can get update only when the data is changed in Facebook.<br />
<span id="more-2695"></span></p>
<p>Whenever a subscribed change occurs, Facebook makes a HTTP POST request to a callback URL that we specify by sending list of changes happened. Facebook app will generally receive notification of the change within a couple of minutes of its occurrence. </p>
<p>We can get updates for following objects with certain fields in it:</p>
<ul>
<li>User</li>
<li>Page</li>
<li>Permissions</li>
<li>Payments</li>
<li>Errors</li>
</ul>
<p>Let me share my experience on implementing real time updates for user object in a Rails app. There are two steps to set up a subscription for Realtime Updates:</p>
<ol>
<li>
Set up a public endpoint URL that receives both HTTP <strong>GET</strong> (for subscription verification) and <strong>POST</strong> (for actual change data) requests from Facebook.</li>
<li>
Set up subscriptions for the updates we want to receive for Facebook app.</li>
</ol>
<p><strong>Step 1:</strong> Handle GET and POST requests from Facebook in Rails app.</p>
<ul>
<li>
Added a method in rails controller to handle both GET and POST requests. </p>
<pre class="brush: ruby">
def subscription
    if request.method == &quot;GET&quot;
     if params[&#039;hub.mode&#039;] ==&#039;subscribe&#039; &amp;&amp; params[&#039;hub.verify_token&#039;] ==&#039;stringToken&#039; 
       render :text =&gt; params[&#039;hub.challenge&#039;]
     else 
       render :text =&gt; &#039;Failed to authorize facebook challenge request&#039;
     end
    elsif request.method == &quot;POST&quot;
     updated_obj = JSON.parse(request.body.read)
     puts updated_obj
     render :text =&gt; &quot;Thanks for the update&quot;
    end
end
</pre>
<p>Also updated the routes.rb as </p>
<pre class="brush: ruby">
match &quot;facebook/subscription&quot;, :controller =&gt; :facebook_realtime_updates, :action =&gt; :subscription, :as =&gt; &#039;facebook_subscription&#039;, :via =&gt; [:get,:post]
</pre>
</li>
</ul>
<p><strong>Step 2:</strong> Set subscriptions for user object in Facebook app developer dashboard.</p>
<ul>
<li>We need to create an app in Facebook app developer dashboard <a href="https://developers.facebook.com/apps" title="Facebook developers" target="_blank">https://developers.facebook.com/apps</a> </li>
<li>
After the app was created, go to the Settings -> Realtime Updates<br />
<a href="http://www.spritle.com/blogs/wp-content/uploads/2013/03/real_time_before_update.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/03/real_time_before_update.png" alt="real_time_before_update" width="664" height="304" class="aligncenter size-full wp-image-2737" /></a>
</li>
<li>Select -> Add a Subscription to Get Started. This will show a dialog to choose which object we need realtime updates.<br />
<a href="http://www.spritle.com/blogs/wp-content/uploads/2013/03/selected_get_started.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/03/selected_get_started.png" alt="selected_get_started" width="664" height="304" class="aligncenter size-full wp-image-2743" /></a>
</li>
<li>Select -> Confirm. Then fill the Fields, Callback and Verify token. <a href="http://www.spritle.com/blogs/wp-content/uploads/2013/03/added_for_user.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/03/added_for_user.png" alt="added_for_user" width="664" height="304" class="aligncenter size-full wp-image-2746" /></a><br />
Here we added &#8220;likes,checkins,feed&#8221; fields for user object. So any of these fields get updated by user of this app will get POST call specified in the callback field. This should not be localhost/ Heroku(btw i learnt an interesting fact in Heroku that it is fully multi-threaded to support fb realtime). Verify token field is for verification that we specified in the callback server.
</li>
<li>After adding the required fields, click &#8220;Test&#8221;. This will generate a GET request for the callback url when we add/modify a subscription. This GET request contains a query string with following parameters.
<ul>
<li>hub.mode &#8211; The string &#8220;subscribe&#8221; is passed in this parameter</li>
<li>hub.challenge &#8211; A random string</li>
<li>hub.verify_token &#8211; The verify_token value we specified when created the subscription</li>
</ul>
<p>Now, the rails app should then echo just the hub.challenge value back, which confirms to Facebook that this server is configured to accept callbacks, and prevents denial-of-service (DDoS) vulnerabilities.</li>
<li>If everything handled successfully, following dialog will appear with hub.challenge value.<br />
<a href="http://www.spritle.com/blogs/wp-content/uploads/2013/03/response_for_subscription.png"><img src="http://www.spritle.com/blogs/wp-content/uploads/2013/03/response_for_subscription.png" alt="response_for_subscription" width="664" height="304" class="aligncenter size-full wp-image-2750" /></a></li>
<li>After these steps, the Facebook app is now ready to receive realtime updates. For each update of user using this app, Facebook will make POST request to the callback server within a couple of minutes. The response we get for any updates in subscribed fields will have the following format.
<pre class="brush: ruby">
{
    &quot;object&quot;: &quot;user&quot;,
    &quot;entry&quot;: [
        {
            &quot;uid&quot;: &quot;100003239436215&quot;,
            &quot;id&quot;: &quot;100003239436215&quot;,
            &quot;time&quot;: 1362240615,
            &quot;changed_fields&quot;: [
                &quot;feed&quot;,
                &quot;likes&quot;
            ]
        }
    ]
}
</pre>
<p>In this response, the uid and id fields are same which is the id of user. The changed_fields represents two field changes were batched together. Note that this response does not include the actual data values (either from before or after the update). To obtain those, our app can request via GET request to Graph API.
</li>
</ul>
<p>Hope you found this blog useful. If you are looking for live demo please let me know via the comments so that I can host for you.</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2695&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/YjNeELxjqWw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/11/using-facebook-realtime-updates-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/11/using-facebook-realtime-updates-in-ruby-on-rails/</feedburner:origLink></item>
		<item>
		<title>Emerging Big Data in Enterprise Mobile Applications</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/pIcCN8SW17c/</link>
		<comments>http://www.spritle.com/blogs/2013/03/06/emerging-big-data-in-enterprise-mobile-applications/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 17:54:37 +0000</pubDate>
		<dc:creator>Surendran Sukumaran</dc:creator>
				<category><![CDATA[IBM Worklight]]></category>
		<category><![CDATA[Rhomobile]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bigdata]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[ibmworklight]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[rhomobile]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2059</guid>
		<description><![CDATA[The new Smart phone era has changed the way people live, smart phones were not just used as an instrument to communicate but also perform their business tasks. The biggest challenge faced by large and SMB organizations is how to handle the large set of data, and how to secure those data access. We all [...]]]></description>
				<content:encoded><![CDATA[<p>The new Smart phone era has changed the way people live, smart phones were not just used as an instrument to communicate but also perform their business tasks.<br />
The biggest challenge faced by large and SMB organizations is how to handle the large set of data, and how to secure those data access. We all know enterprise data (big data) contains sensitive informations.<br />
<span id="more-2059"></span><br />
<img class="alignright" src="http://cdn2.business2community.com/wp-content/uploads/2012/02/MobileLandingPagesConvert.jpg" /></p>
<p>The information that is sent from the server to the device has to be accessible even when the device is offline, large amount of data has to sent back to the server in secured way as well. In general, majority of the business data comes from the back end, resides in the device and sent back to the servers via the cloud like platform.</p>
<p>So the first thing would be processing the data in the device and loading them in the device database, so that the user can access those datas even when there is no proper network connectivity.</p>
<p>In my perspective, the most important thing to be analysed while developing enterprise Tablet and Mobile applications were</p>
<ol>
<li>Processing large set of data</li>
<li>Offline access to the data</li>
<li>Data security during lost and theft</li>
</ol>
<h3 class="title">Processing large set of data : </h3>
<p><img class="medium_images" src="http://www.spritle.com/blogs/wp-content/uploads/2013/01/data-300x196.png" alt="data" width="300" height="196" style="float:left" class="alignnone size-medium wp-image-2384" /><br />
     Enterprise applications needs more data to be shipped to the device every day. A business analytics needs large data of set datas that he/she would analyse before making a decision. He/She may plot those data over several charts to make a decision. He/she may also process those datas by applying specific algorithms predefined by the application.</p>
<p>     Sending a chunk of data to the device may take some time and not sure how reliable it would be.There comes the Synchronization server platforms like <strong>Motorola <a target="_new" href="http://www.motorola.com/Business/US-EN/Business+Product+and+Services/Software+and+Applications/RhoMobile+Suite" title="Rhomobile">RhoMobile </a></strong> providing good solutions to solve these kind of problems. <strong>RhoConnect</strong> which is a part of the RhoMobile suite, gets the data from the Enterprise servers and constructs sql dump, archive it and send the dump file to the device. The device then can download, un-archive, populate the data in to the device database. In this way the processing speed would be decent even when the data size is big (<strong>how big can be big will be analysed as part of my next blog posts</strong>).</p>
<h3  class="title">Offline access for data analytics: </h3>
<p><img  class="medium_images" src="http://www.spritle.com/blogs/wp-content/uploads/2013/01/iPhone-White-Apple-icon.png" alt="iPhone-White-Apple-icon" width="256" height="256" style="float:right" class="alignnone size-full wp-image-2374" /></p>
<p>     There are several chances of not having network connection while using a business applications in smart phones. Example: The CEO/CXO is on flight.<br />
The truck driver carrying Bill of lading documents inside an underground levels/floors.<br />
Chief Doctor in a surgery room.<br />
     In such cases, the logical actions taken by the users should be stored in the mobile database and then sync when network is available again.</p>
<h3  class="title">Data security during lost and theft : </h3>
<p><img src="http://dailytechwire.com/wp-content/uploads/2012/12/ESET-Mobile-Security-app.jpg" alt=""  class="medium_images" width="130" style="float:left; margin-right:10px;"><br />
    The information in the device should not be accessible to other people in case of theft or lost. For instance Dropbox wipes its data if someone tries to enter wrong password thrice.<br />
Mobile Banking analytics applications should wipe the data itself when accessed incorrect users.<br />
External applications should not override the sandbox used by Company applications and so on.<br />
  So the data that is stored in the device has to be encrypted and even in the case of theft or lost the data won&#8217;t be accessible to the outside world or atleast hard to decrypt. RhoMobile (Rhodes) provide such encryption features out of the box.</p>
<p><a href="www.ibm.com/software/in/worklight/" title="IBM Worklight" target="_new">IBM Worklight</a> has taken Mobile Security Measures to achieve a high level of data security, like &#8220;Encrypted Offline Cache&#8221; that helps to protect sensitive information from malware attacks or device theft.</p>
<p><!--<a href="http://www.spritle.com/blogs/wp-content/uploads/2013/01/tablet.png"><img  class="medium_images" src="http://www.spritle.com/blogs/wp-content/uploads/2013/01/tablet-300x206.png" alt="tablet" width="300" height="206" class="alignnone size-medium wp-image-2383" /></a>&#8211;></p>
<p>More to follow on this topic on my next blog post.</p>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2059&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/pIcCN8SW17c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/06/emerging-big-data-in-enterprise-mobile-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/06/emerging-big-data-in-enterprise-mobile-applications/</feedburner:origLink></item>
		<item>
		<title>Tip: Curl JSON Output formatting</title>
		<link>http://feedproxy.google.com/~r/Spritle/~3/PdvMgW_G4XE/</link>
		<comments>http://www.spritle.com/blogs/2013/03/01/tip-curl-json-output-formatting/#comments</comments>
		<pubDate>Fri, 01 Mar 2013 07:43:03 +0000</pubDate>
		<dc:creator>Neelkanth Ram</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.spritle.com/blogs/?p=2873</guid>
		<description><![CDATA[If you use curl http://www.changebadtogood.com/api/v1/get_recent_issues &#124; python -mjson.tool you will see fantastic formatting of json result. Let&#8217;s see the &#8220;before&#8221; and &#8220;after&#8221; effects. Before: If I hit curl http://www.changebadtogood.com/api/v1/get_recent_issues I see would see {&#34;success&#34;:true,&#34;response&#34;:[{&#34;issue_id&#34;:75,&#34;title&#34;:&#34;Incomplete stormwater drains&#34;,&#34;lat_long&#34;:&#34;13.0405, 80.2337&#34;},{&#34;issue_id&#34;:76,&#34;title&#34;:&#34;Burning of garbage&#34;,&#34;lat_long&#34;:&#34;11.3422, 77.7275&#34;},{&#34;issue_id&#34;:73,&#34;title&#34;:&#34;Wading through a flood of troubles&#34;,&#34;lat_long&#34;:&#34;13.0692, 80.1914&#34;},{&#34;issue_id&#34;:70,&#34;title&#34;:&#34;Overflowing garbage bins raise a stink&#34;,&#34;lat_long&#34;:&#34;17.3914, 78.5065&#34;},{&#34;issue_id&#34;:68,&#34;title&#34;:&#34;Mosquito menace back with [...]]]></description>
				<content:encoded><![CDATA[<p>If you use <em>curl  http://www.changebadtogood.com/api/v1/get_recent_issues | python -mjson.tool</em> you will see fantastic formatting of json result. </p>
<p>Let&#8217;s see the &#8220;before&#8221; and &#8220;after&#8221; effects.<br />
<span id="more-2873"></span></p>
<h3>Before:</h3>
<p>If I hit <em>curl  http://www.changebadtogood.com/api/v1/get_recent_issues</em><br />
I see would see</p>
<pre class="brush: javascript">
{&quot;success&quot;:true,&quot;response&quot;:[{&quot;issue_id&quot;:75,&quot;title&quot;:&quot;Incomplete stormwater drains&quot;,&quot;lat_long&quot;:&quot;13.0405, 80.2337&quot;},{&quot;issue_id&quot;:76,&quot;title&quot;:&quot;Burning of garbage&quot;,&quot;lat_long&quot;:&quot;11.3422, 77.7275&quot;},{&quot;issue_id&quot;:73,&quot;title&quot;:&quot;Wading through a flood of troubles&quot;,&quot;lat_long&quot;:&quot;13.0692, 80.1914&quot;},{&quot;issue_id&quot;:70,&quot;title&quot;:&quot;Overflowing garbage bins raise a stink&quot;,&quot;lat_long&quot;:&quot;17.3914, 78.5065&quot;},{&quot;issue_id&quot;:68,&quot;title&quot;:&quot;Mosquito menace back with a vengeance&quot;,&quot;lat_long&quot;:&quot;13.0271, 80.2649&quot;},{&quot;issue_id&quot;:66,&quot;title&quot;:&quot;damage in drainage&quot;,&quot;lat_long&quot;:&quot;13.0475, 80.1992&quot;},{&quot;issue_id&quot;:65,&quot;title&quot;:&quot;this is for testing&quot;,&quot;lat_long&quot;:&quot;13.0472, 80.2008&quot;},{&quot;issue_id&quot;:63,&quot;title&quot;:&quot;Pothole&quot;,&quot;lat_long&quot;:&quot;12.9717, 77.5132&quot;},{&quot;issue_id&quot;:61,&quot;title&quot;:&quot;No white marking in speed breaker.&quot;,&quot;lat_long&quot;:&quot;10.7549, 78.69&quot;},{&quot;issue_id&quot;:60,&quot;title&quot;:&quot;Unclosed sewage line&quot;,&quot;lat_long&quot;:&quot;10.7546, 78.6909&quot;}]}
</pre>
<h3>After:</h3>
<p>If I hit <em>curl  http://www.changebadtogood.com/api/v1/get_recent_issues | python -mjson.tool</em><br />
I see would see</p>
<pre class="brush: javascript">
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   850    0   850    0     0   1203      0 --:--:-- --:--:-- --:--:--  1995
{
    &quot;response&quot;: [
        {
            &quot;issue_id&quot;: 75, 
            &quot;lat_long&quot;: &quot;13.0405, 80.2337&quot;, 
            &quot;title&quot;: &quot;Incomplete stormwater drains&quot;
        }, 
        {
            &quot;issue_id&quot;: 76, 
            &quot;lat_long&quot;: &quot;11.3422, 77.7275&quot;, 
            &quot;title&quot;: &quot;Burning of garbage&quot;
        }, 
        {
            &quot;issue_id&quot;: 73, 
            &quot;lat_long&quot;: &quot;13.0692, 80.1914&quot;, 
            &quot;title&quot;: &quot;Wading through a flood of troubles&quot;
        }, 
        {
            &quot;issue_id&quot;: 70, 
            &quot;lat_long&quot;: &quot;17.3914, 78.5065&quot;, 
            &quot;title&quot;: &quot;Overflowing garbage bins raise a stink&quot;
        }, 
        {
            &quot;issue_id&quot;: 68, 
            &quot;lat_long&quot;: &quot;13.0271, 80.2649&quot;, 
            &quot;title&quot;: &quot;Mosquito menace back with a vengeance&quot;
        }, 
        {
            &quot;issue_id&quot;: 66, 
            &quot;lat_long&quot;: &quot;13.0475, 80.1992&quot;, 
            &quot;title&quot;: &quot;damage in drainage&quot;
        }, 
        {
            &quot;issue_id&quot;: 65, 
            &quot;lat_long&quot;: &quot;13.0472, 80.2008&quot;, 
            &quot;title&quot;: &quot;this is for testing&quot;
        }, 
        {
            &quot;issue_id&quot;: 63, 
            &quot;lat_long&quot;: &quot;12.9717, 77.5132&quot;, 
            &quot;title&quot;: &quot;Pothole&quot;
        }, 
        {
            &quot;issue_id&quot;: 61, 
            &quot;lat_long&quot;: &quot;10.7549, 78.69&quot;, 
            &quot;title&quot;: &quot;No white marking in speed breaker.&quot;
        }, 
        {
            &quot;issue_id&quot;: 60, 
            &quot;lat_long&quot;: &quot;10.7546, 78.6909&quot;, 
            &quot;title&quot;: &quot;Unclosed sewage line&quot;
        }
    ], 
    &quot;success&quot;: true
}
</pre>
<img src="http://www.spritle.com/blogs/wp-content/plugins/pixelstats/trackingpixel.php?post_id=2873&amp;ts=1368432183" style="display:none;" alt="pixelstats trackingpixel"/><img src="http://feeds.feedburner.com/~r/Spritle/~4/PdvMgW_G4XE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.spritle.com/blogs/2013/03/01/tip-curl-json-output-formatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.spritle.com/blogs/2013/03/01/tip-curl-json-output-formatting/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.447 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-13 13:33:03 --><!-- Compression = gzip -->
