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

<channel>
	<title>Jigyasa Makkar</title>
	<atom:link href="http://jigyasamakkar.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jigyasamakkar.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jul 2010 17:14:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Ruby on Rails views : Time ago in words for string time</title>
		<link>http://jigyasamakkar.com/ruby-on-rails-views-time-ago-in-words-for-string-time/</link>
		<comments>http://jigyasamakkar.com/ruby-on-rails-views-time-ago-in-words-for-string-time/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 04:54:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[time zone]]></category>
		<category><![CDATA[time_ago_in_words]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=204</guid>
		<description><![CDATA[I worked my way around an interesting information tidbit discovery yesterday. The use case seemed pretty simple and direct. I needed to display the &#8220;n hours ago&#8221; text in my view. I used the awesome view helper &#8216;time_ago_in_words&#8217; to do that and it worked, well almost. Here&#8217;s what I&#8217;m talking about: In console, time_string = [...]]]></description>
			<content:encoded><![CDATA[<p>I worked my way around an interesting information tidbit discovery yesterday. The use case seemed pretty simple and direct. I needed to display the &#8220;n hours ago&#8221; text in my view. I used the awesome view helper &#8216;time_ago_in_words&#8217; to do that and it worked, well almost.</p>
<p>Here&#8217;s what I&#8217;m talking about:<br />
In console,</p>
<p><code> time_string = "2010-07-21 11:52:31"<br />
helper.time_ago_in_words(time_string) # => about 5 hours<br />
</code></p>
<p>The catch here is that the &#8220;5 hours&#8221; duration is incorrect. This was hardly 5 minutes ago! So, the problem here was in time zones.<br />
By default, </p>
<p><code>time_string.to_time # => Wed Jul 21 11:52:31 UTC 2010<br />
</code><br />
Notice the time zone offset. It has been set to &#8220;UTC&#8221; by default. But the original time zone of this string time was different. And the tricky part is, it was different for different environments. So how&#8217;d we get past this? Here&#8217;s the entire snippet:<br />
<code><br />
  def custom_time_ago_in_words(time_str)<br />
      time = time_str.to_time + (-Time.zone_offset(Time.now.zone))<br />
      "#{time_ago_in_words(time)} ago"<br />
  end<br />
</code><br />
This essentially adjusts the time according to the server time zone and gives correct output as &#8220;5 minutes ago&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/ruby-on-rails-views-time-ago-in-words-for-string-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ActiveRecord Object to Hash assignment in Ruby on Rails</title>
		<link>http://jigyasamakkar.com/activerecord-object-to-hash-assignment-in-ruby-on-rails/</link>
		<comments>http://jigyasamakkar.com/activerecord-object-to-hash-assignment-in-ruby-on-rails/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 10:48:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[object]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=198</guid>
		<description><![CDATA[I find a frequent scenario in Ruby on Rails code base. A local hash variable is assigned a partial subset of an ActiveRecord object, or worse the variable gets the entire AR object. And may be you don&#8217;t already do it the way I have seen it, but its still worth discussing, being as frequent [...]]]></description>
			<content:encoded><![CDATA[<p>I find a frequent scenario in Ruby on Rails code base. A local hash variable is assigned a partial subset of an ActiveRecord object, or worse the variable gets the entire AR object. And may be you don&#8217;t already do it the way I have seen it, but its still worth discussing, being as frequent a requirement as it is.</p>
<p>1. If we want to assign an entire AR object to a local hash:<br />
A direct assignment is possible with &#8220;attributes&#8221;</p>
<p><code>local_hash = session_user.attributes</code></p>
<p>the &#8216;local_hash&#8217; now has an attribute-value hash of the session_user object, an ActiveRecord object of model User ]</p>
<p>2. If we need the local_hash to have only a subset of the AR object attributes:</p>
<p><code>desired_keys = ['address' , 'zipcode' , 'city' , 'country']<br />
local_array = session_user.attributes.select{|key,value| desired_keys.include?(key) }<br />
local_hash = Hash[*local_array.flatten]</code></p>
<p>the &#8216;local_hash&#8217; now has only the desired attribute values. This can easily be extended by simply adding more keys to &#8216;desired_keys&#8217;.<br />
Instead of what I usually see,</p>
<p><code>local_hash = {<br />
                       'address' => session_user.address,<br />
                       'zipcode' => session_user.zipcode,<br />
                       'city'        => session_user.city,<br />
                       'country'  => session_user.country<br />
                      }</code></p>
<p>What do you think of this snippet? Is there a shorter/smarter way of doing this? Think on!</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/activerecord-object-to-hash-assignment-in-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YAML Oddity for Ruby arrays</title>
		<link>http://jigyasamakkar.com/yaml-oddity-for-ruby-arrays/</link>
		<comments>http://jigyasamakkar.com/yaml-oddity-for-ruby-arrays/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 07:37:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[YAML]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=194</guid>
		<description><![CDATA[I discovered this interesting nugget of oddity today. While normal Ruby arrays are &#8216;comma separated&#8221; and space agnostic ie. >> array = [2,3 ,4, 5] => [2, 3, 4, 5] >> array.size => 4 >> array_spaces = [2 , 3 , 4 , 5] => [2, 3, 4, 5] >> array_spaces.size => 4 In case [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered this interesting nugget of oddity today. While normal Ruby arrays are &#8216;comma separated&#8221; and space agnostic ie.<br />
<code><br />
>> array = [2,3 ,4, 5]<br />
=> [2, 3, 4, 5]<br />
>> array.size<br />
=> 4<br />
>> array_spaces = [2 , 3 , 4 , 5]<br />
=> [2, 3, 4, 5]<br />
>> array_spaces.size<br />
=> 4<br />
</code></p>
<p>In case of YAML, the spaces between array elements makes a difference. A much needed code snippet :</p>
<p>A file &#8216;myfile.yml&#8217;<br />
<code><br />
array: [ 1 , 2 ,3, 4]<br />
array_spaces: [1 , 2 , 3 , 4]<br />
</code><br />
Loading this file in &#8216;irb&#8217;:<br />
<code><br />
>> f =YAML.load_file('myfile.yml')<br />
=> {"array"=>[1, "2 ,3", 4], "array_spaces"=>[1, 2, 3, 4]}<br />
>> f["array"]<br />
=> [1, "2 ,3", 4]<br />
>> f["array"].size<br />
=> 3<br />
>> f["array_spaces"]<br />
=> [1, 2, 3, 4]<br />
>> f["array_spaces"].size<br />
=> 4<br />
</code></p>
<p>Now that&#8217;s not Ruby-ish. But then, as a seasoned co-developer pointed out, YAML should be language agnostic. I still find it a bit odd, though. Hmmm, interesting. Point taken.</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/yaml-oddity-for-ruby-arrays/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails Must follow RSS feeds</title>
		<link>http://jigyasamakkar.com/ruby-on-rails-must-follow-rss-feeds/</link>
		<comments>http://jigyasamakkar.com/ruby-on-rails-must-follow-rss-feeds/#comments</comments>
		<pubDate>Fri, 21 May 2010 05:46:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=183</guid>
		<description><![CDATA[Ruby on Rails community is fast growing. Too much is happening, and too fast. Its important to keep ourselves abreast of the latest in our community. Following are some RSS feeds I follow religiously [ well, I try]. So configure your favorite Reader and put on your reading caps: Always begin by looking at RoR [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby on Rails community is fast growing. Too much is happening, and too fast. Its important to keep ourselves abreast of the latest in our community. Following are some RSS feeds I follow religiously [ well, I try]. So configure your favorite Reader and put on your reading caps:</p>
<p>Always begin by looking at RoR guides:<br />
<a href="http://guides.rubyonrails.org/">Ruby on Rails guides</a></p>
<p>The BEST Ruby on Rails resource that gives a consolidated set from many relevant RoR resources:<br />
<a href="http://www.drinkrails.com/feeds/posts/default?alt=rss">Drink Rails</a></p>
<p>The renowned railscasts<br />
<a href="http://feeds.feedburner.com/railscasts">Railscasts</a></p>
<p>RoR @SlideShare<br />
<a href="http://www.slideshare.net/rss/tag/ruby">Ruby @SlideShare</a><br />
<a href="http://www.slideshare.net/rss/tag/rails">Rails @SlideShare</a></p>
<p>Awesome RoR screen casts. Short and concise.<br />
<a href="http://feeds.feedburner.com/rubyplus">Ruby Plus</a></p>
<p>Not very frequently updated, but has good content.<br />
<a href="http://feeds.feedburner.com/monkeyonrails">Monkey on Rails</a></p>
<p>Elaborate content on a wide variety of RoR subjects. By Yehuda Katz is a member of the Ruby on Rails core team.<br />
<a href="http://feeds.feedburner.com/KatzGotYourTongue">Katz Got Your Tongue</a></p>
<p>Usually covered by &#8220;drinkrails&#8221;. Good resource.<br />
<a href="http://feeds.feedburner.com/lindsaar-net">Lindsaar Net</a></p>
<p>Updated, concise and good information resource.<br />
<a href="http://www.railsdispatch.com/posts/feed.rss">Rails Dispatch</a></p>
<p>Latest on Rails. Tonnes of new and interesting stuff.<br />
<a href="http://feeds.feedburner.com/RailsInside">Rails Inside</a></p>
<p>Short concise everyday Rails tips.<br />
<a href="http://feeds.feedburner.com/railsquicktips">Rails Quick Tips</a></p>
<p>The latest developments in Rails, all in one place<br />
<a href="http://feeds.feedburner.com/RidingRails">Riding Rails</a></p>
<p>Rails notes. Solutions to every day &#8220;how-tos&#8221;.<br />
<a href="http://feeds.feedburner.com/railsnotes">Rails Notes</a></p>
<p>Get your Ruby right with quick Ruby tips.<br />
<a href="http://feeds.feedburner.com/RubyQuicktips">Ruby Quick Tips</a></p>
<p>Awesome Ruby resource. 5 minutes of Ruby goodness.<br />
<a href="http://feeds.feedburner.com/Ruby5">Ruby5</a></p>
<p>Another amazing Ruby resource. Concise episodes. Really useful.<br />
<a href="http://feeds.feedburner.com/rubypulse_episodes">Ruby Pulse Episodes</a></p>
<p>A good collection.<br />
<a href="http://feeds.feedburner.com/RailsCoach">Rails Coach</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/ruby-on-rails-must-follow-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Databases don’t bite!</title>
		<link>http://jigyasamakkar.com/databases-don%e2%80%99t-bite/</link>
		<comments>http://jigyasamakkar.com/databases-don%e2%80%99t-bite/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 17:47:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=178</guid>
		<description><![CDATA[Checkout my post at Sapna Blog. http://sappsdreams.wordpress.com/2010/02/19/databases-dont-bite/]]></description>
			<content:encoded><![CDATA[<p>Checkout my post at Sapna Blog.</p>
<p><a href="http://sappsdreams.wordpress.com/2010/02/19/databases-dont-bite/">http://sappsdreams.wordpress.com/2010/02/19/databases-dont-bite/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/databases-don%e2%80%99t-bite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpotMyHotel</title>
		<link>http://jigyasamakkar.com/spotmyhotel/</link>
		<comments>http://jigyasamakkar.com/spotmyhotel/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 14:12:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=9</guid>
		<description><![CDATA[A mobile platform application to provide details ( including name, address and phone numbers) of hotels and food joints situated within the area selected by the user. The application is designed to fetch the required data from the backend web interface and parse it suitably to display results to the user in a pre-defined format. [...]]]></description>
			<content:encoded><![CDATA[<p>A mobile platform application to provide details ( including name, address and phone numbers) of hotels and food joints situated within the area selected by the user. The application is designed to fetch the required data from the backend web interface and parse it suitably to display results to the user in a pre-defined format. Further, the data fetched is paginated with five records fetched per query. More results, if available, can be viewed by selecting the option for “More”.</p>
<p><strong>Underlying Technologies </strong>- The application is built on Java 2 Micro Edition[J2ME] technology and is compliant with all Java supporting mobile devices.</p>
<p><strong>Enhancements</strong> – The application supports “Over the Air” upgrade to “Mobile Yellow Pages” where in the user can query not only for hotels but for various categories like hospitals, movie theatres, schools, colleges, travel agents, consultaants etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/spotmyhotel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>photoGenie</title>
		<link>http://jigyasamakkar.com/photogenie/</link>
		<comments>http://jigyasamakkar.com/photogenie/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 14:10:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=7</guid>
		<description><![CDATA[Photo Genie is an attractive web portal that enables users to order pencil sketches, oil paintings, color paintings and pencil drawings created from the photographs that they can send through email or post. The website displays some sample transformation works through an attractive Javascript image gallery. The users can drop in and view comments from [...]]]></description>
			<content:encoded><![CDATA[<p>Photo Genie is an attractive web portal that enables users to order pencil sketches, oil paintings, color paintings and pencil drawings created from the photographs that they can send through email or post. The website displays some sample transformation works through an attractive Javascript image gallery. The users can drop in and view comments from other users and visitors. Orders can be made online through Paypal’s secure payment gateway.</p>
<p><strong>Underlying Technologies</strong> – Java 2 Platform, Enterprise Edition (<em><strong>J2EE</strong></em>) and HTML, Javascript have been used to develop this web portal&#8217;s front end. The back end has been provided by Microsoft Access.</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/photogenie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canvass</title>
		<link>http://jigyasamakkar.com/canvass/</link>
		<comments>http://jigyasamakkar.com/canvass/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 14:10:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/?p=5</guid>
		<description><![CDATA[Canvass is an interactive web portal that enables users to register and create an account for image sharing. The registered users can upload images they would like other users to see, browse images uploaded by others, search images based on keywords and view a comprehensive list of their own files. An attractive Javascript image gallery [...]]]></description>
			<content:encoded><![CDATA[<p>Canvass is an interactive web portal that enables users to register and create an account for image sharing. The registered users can upload images they would like other users to see, browse images uploaded by others, search images based on keywords and view a comprehensive list of their own files. An attractive Javascript image gallery is available to view thumbnails as well as original sized images.</p>
<p><strong>Underlying Technologies</strong> – Canvass has been developed on Ruby on Rails web development platform for the front end and My SQL database for the back end.</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/canvass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ShareSend</title>
		<link>http://jigyasamakkar.com/sharesend/</link>
		<comments>http://jigyasamakkar.com/sharesend/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 14:08:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://jigyasamakkar.com/sharesend/</guid>
		<description><![CDATA[This is an online file sharing application which gives the user unlimited storage space using the cloud storage provided by integrating Amazon S3 service along with this. This application also includes the PayPal payment gateway to make secure payments between the user and the service provider. This was developed on Ruby on Rails which makes [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jigyasamakkar.com/wp-content/uploads/2009/08/sharesend_626.png"><img class="alignnone size-full wp-image-58" title="sharesend_626" src="http://jigyasamakkar.com/wp-content/uploads/2009/08/sharesend_626.png" alt="sharesend_626" width="626" height="375" /></a></p>
<p>This is an online file sharing application which gives the user unlimited storage space using the cloud storage provided by integrating Amazon S3 service along with this. This application also includes the PayPal payment gateway to make secure payments between the user and the service provider.</p>
<p>This was developed on Ruby on Rails which makes web development fairly easy and fast. This is a growing platform which allows developers to make better and bigger applications in fairly less time.</p>
]]></content:encoded>
			<wfw:commentRss>http://jigyasamakkar.com/sharesend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
