<?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>eXpand yOur cReativity</title>
	<atom:link href="http://blog.bhushangahire.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bhushangahire.net</link>
	<description>by Bhushan G Ahire</description>
	<lastBuildDate>Mon, 26 Jul 2010 10:25:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Is your Netbeans running slower? Try this trick.</title>
		<link>http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/</link>
		<comments>http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 10:25:25 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[GC]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=223</guid>
		<description><![CDATA[
I use NetBeans 6 all the time on my laptop and have learned how to configure it
to run more effectively for me.
NetBeans, like any Java application needs room to work, and the default memory settings
for Java and NetBeans are usually not what I consider ideal.
Of course how would they know what is ideal, you need [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F07%2F26%2Fis-your-netbeans-running-slower-try-this-trick%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p>I use NetBeans 6 all the time on my laptop and have learned how to configure it<br />
to run more effectively for me.<br />
NetBeans, like any Java application needs room to work, and the default memory settings<br />
for Java and NetBeans are usually not what I consider ideal.<br />
Of course how would they know what is ideal, you need to tell it.<br />
Granted my solution may not be ideal for others, but it&#8217;s worth playing with.<br />
I&#8217;m using jdk6 update 17.<br />
And even this should work for NetBeans 6, this should work on any platform.</p>
<pre class="brush: ruby;">
on MAC/Linux/Windows netbeans/6.0/etc/netbeans.conf
netbeans_default_options=&quot;-J-Xms256m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m
-J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:+UseConcMarkSweepGC
-J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled&quot;
</pre>
<p>Any change to this file will require a reboot.</p>
<p>Also, turn on the View-&gt;Toolbars-&gt;Memory to keep track of the NetBeans memory usage, clicking<br />
on it will force a GC, and you can get a feeling for how much memory your NetBeans<br />
session needs, making adjustments to the maximums above.<br />
And my recommendation is that the maximum (-J-Xmx) setting should never be more than<br />
the RAM on the machine minus 512m, or system memory thrashing may occur.</p>
<p>Additional information can be found at<br />
<a href="http://www.netbeans.org/kb/faqs/performance.html#FaqGCPauses">the NetBeans FAQ on GC pauses</a><br />
and<br />
<a href="http://wiki.netbeans.org/FaqNetbeansConf">the NetBeans FAQ on configuration</a>.</p>
<p>The above settings make a world of difference in the way NetBeans performs for me.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/&amp;title=Is+your+Netbeans+running+slower%3F+Try+this+trick." rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/&amp;title=Is+your+Netbeans+running+slower%3F+Try+this+trick." rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/&amp;title=Is+your+Netbeans+running+slower%3F+Try+this+trick." rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/&amp;t=Is+your+Netbeans+running+slower%3F+Try+this+trick." rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Is+your+Netbeans+running+slower%3F+Try+this+trick.+-+http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/&amp;title=Is+your+Netbeans+running+slower%3F+Try+this+trick.&amp;summary=I%20use%20NetBeans%206%20all%20the%20time%20on%20my%20laptop%20and%20have%20learned%20how%20to%20configure%20it%0D%0Ato%20run%20more%20effectively%20for%20me.%0D%0ANetBeans%2C%20like%20any%20Java%20application%20needs%20room%20to%20work%2C%20and%20the%20default%20memory%20settings%0D%0Afor%20Java%20and%20NetBeans%20are%20usually%20not%20what%20I%20consider%20ideal.%0D%0AOf%20course%20how%20would%20they%20know%20what%20&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F07%2F26%2Fis-your-netbeans-running-slower-try-this-trick%2F&amp;t=Is+your+Netbeans+running+slower%3F+Try+this+trick." rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/07/26/is-your-netbeans-running-slower-try-this-trick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Run acts_as_solr in JRuby in background mode</title>
		<link>http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/</link>
		<comments>http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 12:43:07 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[fork]]></category>
		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=217</guid>
		<description><![CDATA[<p class="ArticleSummary">When you try and run rake solr:start or rake solr:stop it uses Kernel.fork to spawn of a child process. However in JRuby this is disabled by default due to concurrency issues. And this prevents your solr rake tasks from running under a JRuby environment...</p>

<div class="extended">
<h3>The Problem</h3>
When you try and run rake solr:start or rake solr:stop it uses Kernel.fork to spawn of a child process.
However in JRuby this is disabled by default due to concurrency issues. There is an option to enabling fork (jruby -J-Djruby.fork.enabled=true)
within JRuby but it is experimental and as the warning says, "WARNING: fork is highly unlikely to be safe or stable on the JVM." as it can cause all sorts of weird and wonderful side-effects.
<h3>The Solution</h3>
The solution therefore is to simply alter the solr:start and solr:stop tasks to use Kernel.exec instead.
To do this find the solr rake tasks usually in {RAILS_ROOT}/vendor/acts_as_solr/lib/tasks/solr.rake. In the start task all that is required is to comment out the start of the fork block. so you only have the exec method call,
This will not start the solr process in the background. To do so you just have to add <strong>"&#38;"</strong> at the end of the exec command, which causes the jar file to run in background mode.
]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F07%2F12%2Frun-acts_as_solr-in-jruby-in-background-mode%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p class="ArticleSummary">When you try and run rake solr:start or rake solr:stop it uses Kernel.fork to spawn of a child process. However in JRuby this is disabled by default due to concurrency issues. And this prevents your solr rake tasks from running under a JRuby environment&#8230;</p>
<div class="extended">
<h3>The Problem</h3>
<p>When you try and run rake solr:start or rake solr:stop it uses Kernel.fork to spawn of a child process.<br />
However in JRuby this is disabled by default due to concurrency issues. There is an option to enabling fork (jruby -J-Djruby.fork.enabled=true)<br />
within JRuby but it is experimental and as the warning says, &#8220;WARNING: fork is highly unlikely to be safe or stable on the JVM.&#8221; as it can cause all sorts of weird and wonderful side-effects.</p>
<h3>The Solution</h3>
<p>The solution therefore is to simply alter the solr:start and solr:stop tasks to use Kernel.exec instead.<br />
To do this find the solr rake tasks usually in {RAILS_ROOT}/vendor/acts_as_solr/lib/tasks/solr.rake. In the start task all that is required is to comment out the start of the fork block. so you only have the exec method call,<br />
This will not start the solr process in the background. To do so you just have to add <strong>&#8220;&amp;&#8221;</strong> at the end of the exec command, which causes the jar file to run in background mode.</p>
<pre class="brush: ruby;">
task :start do
      require &quot;#{File.dirname(__FILE__)}/../../config/solr_environment.rb&quot;
      begin
        n = Net::HTTP.new('127.0.0.1', SOLR_PORT)
        n.request_head('/').value

      rescue Net::HTTPServerException #responding
        puts &quot;Port #{SOLR_PORT} in use&quot; and return

      rescue Errno::ECONNREFUSED #not responding
        Dir.chdir(SOLR_PATH) do
            exec &quot;java #{SOLR_JVM_OPTIONS}
-Dsolr.data.dir=#{SOLR_DATA_PATH} -Djetty.logs=#{SOLR_LOGS_PATH}
-Djetty.port=#{SOLR_PORT} -jar start.jar &amp;&quot;
          sleep(5)
          File.open(&quot;#{SOLR_PIDS_PATH}/#{ENV['RAILS_ENV']}_pid&quot;, &quot;w&quot;){ |f| f &amp;lt;&amp;lt; pid}
          puts &quot;#{ENV['RAILS_ENV']} Solr started successfully on #{SOLR_PORT}, pid: #{pid}.&quot;
        end
      end
    end
</pre>
<p>and in the end task just comment out the begining of the fork block so you are left with</p>
<pre class="brush: ruby;">
  task :stop do
    require &quot;#{File.dirname(__FILE__)}/../../config/solr_environment.rb&quot;
      file_path = &quot;#{SOLR_PIDS_PATH}/#{ENV['RAILS_ENV']}_pid&quot;
      if File.exists?(file_path)
        File.open(file_path, &quot;r&quot;) do |f|
          pid = f.readline
          Process.kill('TERM', pid.to_i)
        end
        File.unlink(file_path)
        Rake::Task[&quot;solr:destroy_index&quot;].invoke if ENV['RAILS_ENV'] == 'test'
        puts &quot;Solr shutdown successfully.&quot;
      else
        puts &quot;PID file not found at #{file_path}. Either Solr is not running or no PID file was written.&quot;
      end
  end
</pre>
<p>you should now be able to run your solr rake tasks under jruby with out any problems..</p>
</div>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/&amp;title=Run+acts_as_solr+in+JRuby+in+background+mode" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/&amp;title=Run+acts_as_solr+in+JRuby+in+background+mode" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/&amp;title=Run+acts_as_solr+in+JRuby+in+background+mode" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/&amp;t=Run+acts_as_solr+in+JRuby+in+background+mode" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Run+acts_as_solr+in+JRuby+in+background+mode+-+http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/&amp;title=Run+acts_as_solr+in+JRuby+in+background+mode&amp;summary=When%20you%20try%20and%20run%20rake%20solr%3Astart%20or%20rake%20solr%3Astop%20it%20uses%20Kernel.fork%20to%20spawn%20of%20a%20child%20process.%20However%20in%20JRuby%20this%20is%20disabled%20by%20default%20due%20to%20concurrency%20issues.%20And%20this%20prevents%20your%20solr%20rake%20tasks%20from%20running%20under%20a%20JRuby%20environment...%0D%0A%0D%0A%0D%0AThe%20Problem%0D%0AWhen%20you%20try%20and%20run%20rake&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F07%2F12%2Frun-acts_as_solr-in-jruby-in-background-mode%2F&amp;t=Run+acts_as_solr+in+JRuby+in+background+mode" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/07/12/run-acts_as_solr-in-jruby-in-background-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Mixin Tutorial</title>
		<link>http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/</link>
		<comments>http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 05:08:28 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[mixin]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=195</guid>
		<description><![CDATA[
In Java you just have classes (both abstract and concrete) and interfaces.  The Ruby language provides classes, modules, and a mix of both.  In this post I want to dive into mixins in Ruby.
In the Ruby language a mixin is a class that is mixed with a module.  In other words the [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F06%2F03%2Fruby-mixin-tutorial%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p>In Java you just have classes (both abstract and concrete) and interfaces.  The Ruby language provides classes, modules, and a mix of both.  In this post I want to dive into mixins in Ruby.</p>
<p>In the Ruby language a mixin is a class that is mixed with a module.  In other words the implementation of the class and module are joined, intertwined, combined, etc.  A mixin is a different mechanism to the extend construct used to add concrete implementation to a class.  With a mixin you can extend from a module instead of a class.  Before we get started with the mixin examples let me first explain what a module is.</p>
<p>I think of a module as a degenerate abstract class.  A module can’t be instantiated and no class can directly extend it but a module can fully implement methods.  A class can leverage the implementation of a module by including the module’s methods.  A module can define methods that can be shared in different and seperate classes either at the class or instance level.</p>
<p>Let me define a module, albeit a trivial one, that would convert a numeric integer value to English.</p>
<pre class="brush: ruby;">
# Convert a integer value to English.
module Stringify
  # Requires an instance variable @value
  def stringify
    if @value == 1
      &amp;amp;quot;One&amp;amp;quot;
    elsif @value == 2
      &amp;amp;quot;Two&amp;amp;quot;
    elsif @value == 3
      &amp;amp;quot;Three&amp;amp;quot;
    end
  end
end
</pre>
<p>Note that the Stringify module makes use of a @value instance variable.  The class that will be mixed with this module needs to define and set a @value instance variable since the Stringify module uses it but does not define it.  In addition to instance variables a module could invoke methods defined not in the module itself but in the class that it will be mixed with.</p>
<p>Now let me construct a self contained module that is not dependent on the implementation of any class that it can be mixed with.</p>
<pre class="brush: ruby;">
# A Math module akin to Java Math class.
module Math
  # Could be called as a class, static, method
  def add(val_one, val_two)
    BigInteger.new(val_one + val_two)
  end
end
</pre>
<p>The methods in the Math module are intended to be invoked like class methods, also known as static methods.  The add method in the Math module accepts two integer values and returns an instance of BigInteger.  Let me now define the mixin BigInteger class.</p>
<pre class="brush: plain;">
# Base Number class
class Number
  def intValue
    @value
  end
end

# BigInteger extends Number
class BigInteger &lt; Number

  # Add instance methods from Stringify
  include Stringify

  # Add class methods from Math
  extend Math

  # Add a constructor with one parameter
  def initialize(value)
    @value = value
  end
end
</pre>
<p>I loosely modeled the BigInteger and Number classes after the Java versions.  The BigInteger class defines one constructor and directly inherits one method from the Number base class.  To mix in the methods implemented in the Stringify and Math modules with the BigInteger class you will note the usage of the include and extend methods, respectively.</p>
<pre class="brush: plain;">
# Create a new object
bigint1 = BigInteger.new(10)
# Call a method inherited from the base class
puts bigint1.intValue   # --&gt; 10
</pre>
<p>The extend method will mix a module’s methods at the class level.  The method defined in the Math module can be used as a class/static method.</p>
<pre class="brush: plain;">
# Call class method extended from Math
bigint2 = BigInteger.add(-2, 4)
puts bigint2.intValue   # --&gt; 2
</pre>
<p>The include method will mix a module’s methods at the instance level, meaning that the methods will become instance methods.  The method defined in the Stringify module can be used as an instance method.</p>
<pre class="brush: plain;">
# Call a method included from Stringify
puts bigint2.stringify   # --&gt; 'Two'
</pre>
<p>There is another use of the extend method.  You can enhance an object instance by mixing it with a module at run time!  This is a powerful  feature.  Let me create a module that will be used to extend an object, changing it’s responsibilities at runtime.</p>
<pre class="brush: plain;">
# Format a numeric value as a currency
module CurrencyFormatter
  def format
    &quot;$#{@value}&quot;
  end
end
</pre>
<p>To mix an object instance with a module you can do the following:</p>
<pre class="brush: plain;">
# Add the module methods to
# this object instance, only!
bigint2.extend CurrencyFormatter
puts bigint2.format   # --&gt; '$2'
</pre>
<p>Calling the extend method on an an instance will only extend that one object, objects of the same class will not be extended with the new functionality.</p>
<pre class="brush: plain;">
puts bigint1.format   # will generate an error
</pre>
<p>Modules that will be mixed with a class via the include or extend method could define something like a contructor or initializer method to the module.  The module initializer method will be invoked at the time the module is mixed with a class.  When a class extends a module the module’s self.extended method will be invoked:</p>
<pre class="brush: plain;">
module Math
  def self.extended(base)
    # Initialize module.
  end
end
</pre>
<p>The self prefix indicates that the method is a static module level method.  The base parameter in the static extended method will be either an instance object or class object of the class that extended the module depending whether you extend a object or class, respectively.</p>
<p>When a class includes a module the module’s self.included method will be invoked.</p>
<pre class="brush: plain;">
module Stringify
  def self.included(base)
    # Initialize module.
  end
end
</pre>
<p>The base parameter will be a class object for the class that includes the module.</p>
<p>It is important to note that inside the included and extended initializer methods you can include and extend other modules, here is an example of that:</p>
<pre class="brush: plain;">
module Stringify
  def self.included(base)
    base.extend SomeOtherModule
  end
end
</pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/&amp;title=Ruby+Mixin+Tutorial" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/&amp;title=Ruby+Mixin+Tutorial" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/&amp;title=Ruby+Mixin+Tutorial" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/&amp;t=Ruby+Mixin+Tutorial" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Ruby+Mixin+Tutorial+-+http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/&amp;title=Ruby+Mixin+Tutorial&amp;summary=In%20Java%20you%20just%20have%20classes%20%28both%20abstract%20and%20concrete%29%20and%20interfaces.%20%20The%20Ruby%20language%20provides%20classes%2C%20modules%2C%20and%20a%20mix%20of%20both.%20%20In%20this%20post%20I%20want%20to%20dive%20into%20mixins%20in%20Ruby.%0D%0A%0D%0AIn%20the%20Ruby%20language%20a%20mixin%20is%20a%20class%20that%20is%20mixed%20with%20a%20module.%20%20In%20other%20words%20the%20implementation%20of%20&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F06%2F03%2Fruby-mixin-tutorial%2F&amp;t=Ruby+Mixin+Tutorial" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/06/03/ruby-mixin-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Center Page Horizontal &amp; Vertical with plane CSS &amp; HTML</title>
		<link>http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/</link>
		<comments>http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/#comments</comments>
		<pubDate>Mon, 31 May 2010 08:41:35 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[center align]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=193</guid>
		<description><![CDATA[
Vertical centering has always been awkward with css as vertical-align only refers to inline elements within a single line and not to block level elements. However vertical align does apply to table-cells also so we can use this to our advantage in browsers that support display:table such as mozilla and opera.
We can also cater for [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F31%2Fcenter-page-horizontal-vertical-with-plane-css-html%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p class="intro2">Vertical centering has always been awkward with css as vertical-align only refers to inline elements within a single line and not to block level elements. However vertical align does apply to table-cells also so we can use this to our advantage in browsers that support display:table such as mozilla and opera.</p>
<p>We can also cater for all IE (IE5 &#8211; IE7) via conditional comments and supply them with their own vertical centering routine.</p>
<p>Firstly I&#8217;ll describe what&#8217;s needed for mozilla. Here&#8217;s the main css code:</p>
<p><strong>Code:</strong></p>
<div class="code">* {margin:0;padding:0}<br />
/* mac hide \*/<br />
html,body{height:100%;width:100%;}<br />
/* end hide */<br />
body {<br />
background-color: #cccccc;<br />
text-align:center;<br />
min-height:468px;/* for good browsers*/<br />
min-width:552px;/* for good browsers*/<br />
}<br />
#outer{<br />
height:100%;<br />
width:100%;<br />
display:table;<br />
vertical-align:middle;<br />
}<br />
#container {<br />
text-align: center;<br />
position:relative;<br />
vertical-align:middle;<br />
display:table-cell;<br />
height: 468px;<br />
}<br />
#inner {<br />
width: 552px;<br />
background:red;<br />
height: 468px;<br />
text-align: center;<br />
margin-left:auto;<br />
margin-right:auto;<br />
border:1px solid #000;<br />
}</div>
<p>The html would look like this:</p>
<p><strong>Html:</strong></p>
<div class="code">&lt;body&gt;<br />
&lt;div id=&#8221;outer&#8221;&gt;<br />
&lt;div id=&#8221;container&#8221;&gt;<br />
&lt;div id=&#8221;inner&#8221;&gt;<br />
&lt;h1&gt;Centered Vertical and Horizontal&lt;/h1&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;</div>
<p>Most of the above should be familiar to you but the bit we are interested in is the display:table in #outer. This tells the browser to display this element with the same characteristics of a table which allows us to then use vertical-align:middle. We then nest an inner #container that is set to display:table-cell and this table-cell will then 				be vertically aligned to the parent as would a table cell.</p>
<p>The inner #inner element is then horizontally centered using margin:auto and that completes the solution for mozilla and Opera. It&#8217;s a shame that we need the extra wrappers but this is the safest way to do this. Unlike other vertical centering methods (where you position the element 50% from the top and then drag it back up with a negative top 				margin equal to half the elements height) the method I describe will always stay in the viewport and will not slide off the top or the side of the screen which is a bad failing of other methods used.</p>
<p>To bring IE into the game we need to do something else because it doesn&#8217;t understand display:table. Luckily we can draw on a behaviour that is consistent from ie5 &#8211; ie7 and simply involves positioning the outer element 50% from the top using relative positioning and the dragging the inner element back up with a negative 50% relative top position. 				In other browsers this would bring the element back to the same position but IE drags the inner element back only half its height therefore perfectly centering the element.</p>
<p><strong>Code:</strong></p>
<div class="code">&lt;!&#8211;[if lt IE 8]&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
#container{top:50%}<br />
#inner{top:-50%;position:relative;}<br />
&lt;/style&gt;<br />
&lt;![endif]&#8211;&gt;</div>
<p>We also need to add overflow:hidden to the outer for IE7 otherwise we get a vertical scrollbar where its not needed.</p>
<div class="code">&lt;!&#8211;[if IE 7]&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
#outer{<br />
position:relative;<br />
overflow:hidden;<br />
}<br />
&lt;/style&gt;<br />
&lt;![endif]&#8211;&gt;</div>
<p>Nothing else needs to be changed as IE7 and under doesn&#8217;t understand display:table and just ignores it. The html stays the same and the only extra css is the 2 lines above. It couldn&#8217;t really be much simpler.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/&amp;title=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/&amp;title=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/&amp;title=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/&amp;t=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML+-+http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/&amp;title=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML&amp;summary=Vertical%20centering%20has%20always%20been%20awkward%20with%20css%20as%20vertical-align%20only%20refers%20to%20inline%20elements%20within%20a%20single%20line%20and%20not%20to%20block%20level%20elements.%20However%20vertical%20align%20does%20apply%20to%20table-cells%20also%20so%20we%20can%20use%20this%20to%20our%20advantage%20in%20browsers%20that%20support%20display%3Atable%20such%20as%20mozilla%20&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F31%2Fcenter-page-horizontal-vertical-with-plane-css-html%2F&amp;t=Center+Page+Horizontal+%26+Vertical+with+plane+CSS+%26+HTML" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/05/31/center-page-horizontal-vertical-with-plane-css-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Essential Plugins For Your Wordpress Portfolio</title>
		<link>http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/</link>
		<comments>http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/#comments</comments>
		<pubDate>Wed, 19 May 2010 05:12:50 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=184</guid>
		<description><![CDATA[
One of the best things about Wordpress is the thousands of plugins available for free. No matter how you want to customise your site, there’s probably a plugin to do it. From turning it into an ecommerce store to automatically pulling in content, the possibilities are endless.
When it comes to portfolio sites, you don’t really [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F19%2F10-essential-plugins-for-your-wordpress-portfolio%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p>One of the best things about Wordpress is the thousands of plugins available for free. No matter how you want to customise your site, there’s probably a plugin to do it. From turning it into an ecommerce store to automatically pulling in content, the possibilities are endless.</p>
<p>When it comes to portfolio sites, you don’t really need a lot of bells and whistles. Your portfolio is all about your work and presenting it in the best possible way, so which Wordpress plugins are the best to achieve this? Which will help your <a href="http://www.frogsthemes.com/wordpress-portfolio-themes/">Wordpress portfolio</a> really perform?</p>
<h2>Tweet This</h2>
<p>Chances are you have a Twitter account, so what better way to show off your work than to put it in front of your followers? The <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/tweet-this/" target="blank">Tweet This plugin</a> installs a cool button on all of your posts and pages, allowing people to Tweet a link to your work. It can also be set up to Tweet new posts so you don’t have to sign up to a service like <a onclick="javascript:pageTracker._trackPageview('/outbound/article/twitterfeed.com');" rel="external nofollow" href="http://twitterfeed.com/" target="blank">Twitterfeed</a>.</p>
<p>Our favourite thing about this plugin is that it lets you shortern URLs using a service of your choice. If you’ve got your own URL shortener this is very nifty indeed.</p>
<h2>Sociable</h2>
<p>Fantastic for generating traffic spikes, <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/sociable/" target="blank">Sociable</a> lets you add social bookmarking links on your posts, pages and RSS feeds. Good art, design or photography is social networking gold, so this is definitely a plugin you want to install.</p>
<h2>Xavins Review Ratings</h2>
<p>It might be a bit old-school, but star ratings are great for visitor interaction. Our favourite plugin for this is <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/xavins-review-ratings/" target="blank">Xavin’s Review Ratings</a>. It’s entirely customisable from the number of stars to the size of the fractions to the design of the stars themselves. Intended mainly for review websites, we think it’s cool to let people review your work, so give this a try on your portfolio.</p>
<h2>NextGen Gallery</h2>
<p>Probably the most comprehensive image gallery plugin for Wordpress, <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="blank">NextGen Gallery</a> provides a huge set of options for displaying your images. From adding custom templates and multiple CSS stylesheets, to using watermarks and slideshows, it’s the only plugin you need for an instant, professional-looking gallery.</p>
<h2>FlippingBook</h2>
<p>Some people love them and some people hate them, but page-flip sites stand out from the crowd. If you want your portfolio in picture-book format, <a onclick="javascript:pageTracker._trackPageview('/outbound/article/pageflipgallery.com');" rel="external nofollow" href="http://pageflipgallery.com/" target="blank">FlippingBook</a> is the plugin for you. It lets you easily create an interactive Flash album complete with pages that, well, flip!</p>
<h2>Smush.it</h2>
<p>This neat little plugin is a FrogsThemes favourite, optimising your images in a ‘lossless’ way. As any web designer knows, saving bytes is a good thing. Your portfolio loads faster and there’s less stress on your bandwidth. <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/wp-smushit/" target="blank">Smush.it</a> makes it easy for everyone to optimise their image file sizes – once installed, it optimises new images automagically!</p>
<h2>Wordpress Super Cache</h2>
<p>This plugin also cuts down on your page load time by generating a static HTML file to serve to most of your users. It’s a lot quicker than serving normal Wordpress php scripts and a really useful talent for image-heavy sites like your portfolio. If your work is popular on social media sites, <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/wp-super-cache/" target="blank">Wordpress Super Cache</a> can help your site handle the resulting heavy traffic. Neat huh?</p>
<h2>Audio Player 2.0</h2>
<p>Want to add audio to your portfolio? Look no further than <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/audio-player/" target="blank">Audio Player 2.0</a>. From autostart to autoloop, it has everything you need to make your portfolio literally speak to your visitors. The top advantage for portfolio sites? You can customise the colour scheme to blend in with your design.</p>
<h2>Wordpress Backup</h2>
<p>Now you’ve installed all these plugins and your portfolio is ace, it’s time to make it safe and secure. Currently, the best plugin that backs up your Wordpress portfolio is simply called <a onclick="javascript:pageTracker._trackPageview('/outbound/article/wordpress.org');" rel="external nofollow" href="http://wordpress.org/extend/plugins/wordpress-backup/" target="blank">Wordpress Backup</a>. It performs regular backups of your upload directory (i.e. images), your theme and your plugin directory. This takes care of a lot of your content, but unfortunately leaves out your database.</p>
<p>For that we recommend a newcomer – <a onclick="javascript:pageTracker._trackPageview('/outbound/article/www.backup-technology.com');" rel="external nofollow" href="http://www.backup-technology.com/online-backup-for-wordpress/" target="blank">Online Backup for Wordpress</a>. This plugin comes with 50MiB of free space in a real life datacentre – your blog posts have never been so secure! We’ve been assured that in the coming months this plugin will backup images, plugins and other file-level items, so watch this space for an update.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/&amp;title=10+Essential+Plugins+For+Your+Wordpress+Portfolio" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/&amp;title=10+Essential+Plugins+For+Your+Wordpress+Portfolio" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/&amp;title=10+Essential+Plugins+For+Your+Wordpress+Portfolio" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/&amp;t=10+Essential+Plugins+For+Your+Wordpress+Portfolio" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=10+Essential+Plugins+For+Your+Wordpress+Portfolio+-+http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/&amp;title=10+Essential+Plugins+For+Your+Wordpress+Portfolio&amp;summary=One%20of%20the%20best%20things%20about%20Wordpress%20is%20the%20thousands%20of%20plugins%20available%20for%20free.%20No%20matter%20how%20you%20want%20to%20customise%20your%20site%2C%20there%E2%80%99s%20probably%20a%20plugin%20to%20do%20it.%20From%20turning%20it%20into%20an%20ecommerce%20store%20to%20automatically%20pulling%20in%20content%2C%20the%20possibilities%20are%20endless.%0D%0A%0D%0AWhen%20it%20comes%20to%20&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F19%2F10-essential-plugins-for-your-wordpress-portfolio%2F&amp;t=10+Essential+Plugins+For+Your+Wordpress+Portfolio" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/05/19/10-essential-plugins-for-your-wordpress-portfolio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Firewall and non-secure FTP traffic Rule for firewall</title>
		<link>http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/</link>
		<comments>http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/#comments</comments>
		<pubDate>Thu, 13 May 2010 05:59:21 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=179</guid>
		<description><![CDATA[
Windows firewall can be configured from command line using netsh command. 2 simple steps are required to setup Windows Firewall to allow non-secure FTP traffic
 
1) Open port 21 on the firewall
netsh advfirewall firewall add rule name=&#8221;FTP (no SSL)&#8221; action=allow protocol=TCP dir=in localport=21
2) Activate firewall application filter for FTP (aka Stateful FTP) that will dynamically [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F13%2Fwindows-firewall-and-non-secure-ftp-traffic%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p><strong>Windows firewall can be configured from command line using netsh command. 2 simple steps are required to setup Windows Firewall to allow non-secure FTP traffic</strong></p>
<p><span style="font-family: Arial; font-size: x-small;"> </span></p>
<p align="left"><strong>1)</strong> Open port 21 on the firewall</p>
<p><em><span style="color: #4f6228; font-size: x-small;"><strong>netsh advfirewall firewall add rule name=&#8221;FTP (no SSL)&#8221; action=allow protocol=TCP dir=in localport=21</strong></span></em></p>
<p><span style="font-size: x-small;"><strong>2)</strong> Activate firewall application filter for FTP (aka Stateful FTP) that will dynamically open ports for data connections</span></p>
<p><em><span style="color: #4f6228; font-size: x-small;"><strong>netsh advfirewall set global StatefulFtp enable</strong></span></em></p>
<p><em>Hope this information is helpful for you&#8230;.</em></p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/&amp;title=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/&amp;title=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/&amp;title=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/&amp;t=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall+-+http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/&amp;title=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall&amp;summary=Windows%20firewall%20can%20be%20configured%20from%20command%20line%20using%20netsh%20command.%202%20simple%20steps%20are%20required%20to%20setup%20Windows%20Firewall%20to%20allow%20non-secure%20FTP%20traffic%0D%0A%0D%0A%20%0D%0A1%29%20Open%20port%2021%20on%20the%20firewall%0D%0Anetsh%20advfirewall%20firewall%20add%20rule%20name%3D%22FTP%20%28no%20SSL%29%22%20action%3Dallow%20protocol%3DTCP%20dir%3Din%20localport%3D21&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F13%2Fwindows-firewall-and-non-secure-ftp-traffic%2F&amp;t=Windows+Firewall+and+non-secure+FTP+traffic+Rule+for+firewall" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/05/13/windows-firewall-and-non-secure-ftp-traffic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Do I Enable remote access to PostgreSQL database server?</title>
		<link>http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/</link>
		<comments>http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/#comments</comments>
		<pubDate>Tue, 11 May 2010 12:11:22 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=177</guid>
		<description><![CDATA[



By default, PostgreSQL database server remote access disabled for security reasons. However, some time you need to provide the remote access to database server from home computer or from web server.
Step # 1: Login over ssh if server is outside your IDC
Login over ssh to remote PostgreSQL  database server:
$ ssh user@remote.pgsql.server.com
Step # 2: Enable [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F11%2Fhow-do-i-enable-remote-access-to-postgresql-database-server%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<div class="format_text entry-content">
<div style="float: right; margin-top: 0px; margin-left: 5px;"><a title="See all Postgresql related tips/articles" href="http://www.cyberciti.biz/tips/category/postgresql/"><br />
<img src="http://figs.cyberciti.biz/3rdparty/pgsql-logo.png" border="0" alt="" /></a></div>
<p>By default, PostgreSQL database server remote access disabled for security reasons. However, some time you need to provide the remote access to database server from home computer or from web server.</p>
<h2>Step # 1: Login over ssh if server is outside your IDC</h2>
<p>Login over ssh to remote PostgreSQL  database server:</p>
<p><code>$ ssh user@remote.pgsql.server.com</code></p>
<h2>Step # 2: Enable client authentication</h2>
<p>Once connected, you need edit the PostgreSQL configuration file, edit the PostgreSQL configuration file <strong>/var/lib/pgsql/data/pg_hba.conf</strong> (or <strong>/etc/postgresql/8.2/main/pg_hba.conf</strong> for latest 8.2 version) using a text editor such as vi.</p>
<p>Login as postgres user using su / sudo command, enter:</p>
<p><code>$ su - postgres</code></p>
<p>Edit the file:</p>
<p><code>$ vi /var/lib/pgsql/data/pg_hba.conf</code></p>
<p>OR</p>
<p><code>$ vi /etc/postgresql/8.2/main/pg_hba.conf</code></p>
<p>Append the following configuration lines to give access to 10.10.29.0/24 network:</p>
<p><code>host all all 10.10.29.0/24 trust</code></p>
<p>Save and close the file.  Make sure you replace 10.10.29.0/24 with  actual network IP address range of the clients system in your own network.</p>
<h2>Step # 2: Enable networking for PostgreSQL</h2>
<p>You need to enable TCP / IP networking. Use either step #3 or #3a as per your PostgreSQL database server version.</p>
<h2>Step # 3: Allow TCP/IP socket</h2>
<p>If you are using <strong>PostgreSQL version 8.x or newer</strong> use the following instructions or skip to <a href="#3a">Step # 3a</a> for older version (7.x or older).</p>
<p>You need to open PostgreSQL configuration file /var/lib/pgsql/data/postgresql.conf or /etc/postgresql/8.2/main/postgresql.conf.</p>
<p><code># vi /etc/postgresql/8.2/main/postgresql.conf</code></p>
<p>OR</p>
<p><code># vi /var/lib/pgsql/data/postgresql.conf </code></p>
<p>Find configuration line that read as follows:</p>
<p><code>listen_addresses='localhost'</code></p>
<p>Next set IP address(es) to listen on; you can use comma-separated list of addresses; defaults to &#8216;localhost&#8217;, and &#8216;*&#8217; is all ip address:</p>
<p><code>listen_addresses='*'</code></p>
<p>Or just bind to 202.54.1.2 and 202.54.1.3 IP address</p>
<p><code>listen_addresses='202.54.1.2 202.54.1.3'</code></p>
<p>Save and close the file. Skip to <a href="#4">step # 4</a>.</p>
<h3>Step #3a &#8211; Information for old version 7.x  or older</h3>
<p>Following configuration only required for <strong>PostgreSQL version 7.x or older</strong>. Open config file, enter:</p>
<p><code># vi /var/lib/pgsql/data/postgresql.conf </code></p>
<p>Bind and open TCP/IP port by setting tcpip_socket to true.  Set / modify tcpip_socket to true:</p>
<p><code>tcpip_socket = true</code></p>
<p>Save and close the file.</p>
<h2>Step # 4: Restart PostgreSQL Server</h2>
<p>Type the following command:</p>
<p><code># /etc/init.d/postgresql restart</code></p>
<h2>Step # 5: Iptables firewall rules</h2>
<p>Make sure iptables is not blocking communication, <a href="http://www.cyberciti.biz/tips/howto-iptables-postgresql-open-port.html">open port 5432</a> (append rules to your iptables scripts or file <a href="http://www.cyberciti.biz/faq/howto-block-ipaddress-of-spammers-with-firewall/">/etc/sysconfig/iptables</a>):</p>
<pre>iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 20.04.23.22  --dport 5432 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -s 20.04.23.22 --sport 5432 -d 0/0 --dport 1024:65535 -m state --state ESTABLISHED -j ACCEPT</pre>
<p>Restart firewall:</p>
<p><code># /etc/init.d/iptables restart</code></p>
<h2>Step # 6: Test your setup</h2>
<p>Use psql command from client system. Connect to remote server using IP address 20.04.23.22 and login using postgres username and testdatabase database, enter:</p>
<p><code>$ psql -h 20.04.23.22 -U postgres -d testdatabase</code></p>
</div>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/&amp;title=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/&amp;title=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/&amp;title=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/&amp;t=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F+-+http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/&amp;title=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F&amp;summary=%0D%0A%0D%0A%0D%0ABy%20default%2C%20PostgreSQL%20database%20server%20remote%20access%20disabled%20for%20security%20reasons.%20However%2C%20some%20time%20you%20need%20to%20provide%20the%20remote%20access%20to%20database%20server%20from%20home%20computer%20or%20from%20web%20server.%0D%0AStep%20%23%201%3A%20Login%20over%20ssh%20if%20server%20is%20outside%20your%20IDC%0D%0ALogin%20over%20ssh%20to%20remote%20PostgreSQL%20%20d&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F05%2F11%2Fhow-do-i-enable-remote-access-to-postgresql-database-server%2F&amp;t=How+Do+I+Enable+remote+access+to+PostgreSQL+database+server%3F" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/05/11/how-do-i-enable-remote-access-to-postgresql-database-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paginating multiple models using will_paginate on the same page</title>
		<link>http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/</link>
		<comments>http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 12:22:08 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[will paginate]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=169</guid>
		<description><![CDATA[

The will_paginate plugin makes pagination for your models in Ruby on Rails ridiculously simple. However sometimes you’ll find yourself wanting to paginate over two or more models on a single page. For instance, you might want to display a list of users and administrators on a single page along with a pager for each model [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F04%2F13%2Fpaginating-multiple-models-using-will_paginate-on-the-same-page%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<div class="snap_preview">
<p>The <a title="will_paginate plugin" href="http://wiki.github.com/mislav/will_paginate" target="_blank">will_paginate</a> plugin makes pagination for your models in Ruby on Rails ridiculously simple. However sometimes you’ll find yourself wanting to paginate over two or more models on a single page. For instance, you might want to display a list of users and administrators on a single page along with a pager for each model (assuming that users and administrators are stored in separate tables).</p>
<h3>Controller code</h3>
<p>The code is pretty simple, except that I am specifying the page to show to be equal to params[:user_page] and params[:administrator_page] respectively. Since we are allowing the ability to page over two models, we need two separate parameters to determine which page of users or administrators to show.</p>
<pre class="brush: jscript;">
@users = User.paginate(:page =&gt; params[:user_page], :per_page =&gt; 10)&lt;br/&gt;
@administrators = Administrator.paginate(:page =&gt; params[:administrator_page], :per_page =&gt; 10)
</pre>
<h3>View code</h3>
<p>In the view all we need to do is make sure to set the param_value to the correct value to indicate to the plugin that we want to use a different parameter name for the page. The default is simply called ‘page’, but we need to make sure to use ‘user_page’ and ‘administrator_page’ instead for the two different models.</p>
<pre class="brush: jscript;">
&lt;%= will_paginate @users, :param_name =&gt; 'user_page' %&gt;&lt;br/&gt;
&lt;%= will_paginate @administrators, :param_name =&gt; 'administrator_page' %&gt;
</pre>
<p>That’s it, you should now be able to page through your users and administrators on the same page.</p>
</div>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/&amp;title=Paginating+multiple+models+using+will_paginate+on+the+same+page" rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/&amp;title=Paginating+multiple+models+using+will_paginate+on+the+same+page" rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/&amp;title=Paginating+multiple+models+using+will_paginate+on+the+same+page" rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/&amp;t=Paginating+multiple+models+using+will_paginate+on+the+same+page" rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Paginating+multiple+models+using+will_paginate+on+the+same+page+-+http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/&amp;title=Paginating+multiple+models+using+will_paginate+on+the+same+page&amp;summary=The%20will_paginate%20plugin%20makes%20pagination%20for%20your%20models%20in%20Ruby%20on%20Rails%20ridiculously%20simple.%20However%20sometimes%20you%E2%80%99ll%20find%20yourself%20wanting%20to%20paginate%20over%20two%20or%20more%20models%20on%20a%20single%20page.%20For%20instance%2C%20you%20might%20want%20to%20display%20a%20list%20of%20users%20and%20administrators%20on%20a%20single%20page%20along%20wit&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F04%2F13%2Fpaginating-multiple-models-using-will_paginate-on-the-same-page%2F&amp;t=Paginating+multiple+models+using+will_paginate+on+the+same+page" rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/04/13/paginating-multiple-models-using-will_paginate-on-the-same-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 is Fail&#8230;</title>
		<link>http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/</link>
		<comments>http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 07:20:51 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[htc]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=162</guid>
		<description><![CDATA[
No file system access:
No file system access means
a) you can not use it as USB thumb drive
b) you can not share files with different computers
c) there is no file downloads from web and no useful ftp clients and similar apps because they are useless without fsa
d) you can not open files with different apps unless [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F03%2F26%2Fwindows-phone-7-is-fail%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<p><b>No file system access:</b><br />
No file system access means</p>
<p>a) you can not use it as USB thumb drive<br />
b) you can not share files with different computers<br />
c) there is no file downloads from web and no useful ftp clients and similar apps because they are useless without fsa<br />
d) you can not open files with different apps unless maybe you email them to yourself, which is complicated but is the common way to get files on iPhones and it will also be like that crap on WP7</p>
<p><b>No SD cards</b><br />
I hope I don&#8217;t have to explain why that sucks. Terabyte SDXC cards are on the way and WP7 buyers are stuck with built in 8-32GB. And you have no thumb drive mode and no SD card to take out and load files on it.</p>
<p><b>No copy and paste</b><br />
No, you are not dreaming to live in 2007. It really is 2010 and WP7 really has no copy&amp;paste. Is this ridiculous or what?</p>
<p><b>No multitasking</b><br />
People always talk crap like multitasking makes phones slow and makes battery life bad but really with a bit of thinking multitasking can be implemented in ways that do not have any bad effects at all and it even speeds things up because there is no loading times and of course push notifications also hurt battery life.</p>
<p>Plus there is lots of things that are not possible without multitasking. Say byebye to GPS tracking and stuff.</p>
<p><b>Marketplace censorship</b><br />
They say it will be &#8220;objective&#8221; but everyone knows that is crap talk just look at current WM6.5 policies they are the same censorship as in Apple AppStore.</p>
<p><b>No native coding and no deep customization</b><br />
Say byebye to apps that let you customize buttons or replace built in apps or let you adjust any advanced settings.<br />
It is for sure that MS will not include all settings that users may need and there is no way users can change anything that is not in settings by default, because there is no file system or registry access for apps.</p>
<p>All the mentioned things make the user experience worse. Emailing everything to yourself sucks it&#8217;s complicated and it is also complicated to have quick looks at info inside apps without multitasking and much more problems because of the stupid limitations.</p>
<p>To me WP7 is a complete FAIL. It can not compete to anything except for iPhone. I totally hate Apple and iPhone but I hope they kill WP7 so that MS realize how they fucked up WP7.</p>
<p>I don&#8217;t know why but in US, iPhone is a lot more popular and there is no Symbian. There WP7 can fight against iPhone.</p>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/&amp;title=Windows+Phone+7+is+Fail..." rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/&amp;title=Windows+Phone+7+is+Fail..." rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/&amp;title=Windows+Phone+7+is+Fail..." rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/&amp;t=Windows+Phone+7+is+Fail..." rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=Windows+Phone+7+is+Fail...+-+http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/&amp;title=Windows+Phone+7+is+Fail...&amp;summary=No%20file%20system%20access%3A%0D%0ANo%20file%20system%20access%20means%0D%0A%0D%0Aa%29%20you%20can%20not%20use%20it%20as%20USB%20thumb%20drive%0D%0Ab%29%20you%20can%20not%20share%20files%20with%20different%20computers%0D%0Ac%29%20there%20is%20no%20file%20downloads%20from%20web%20and%20no%20useful%20ftp%20clients%20and%20similar%20apps%20because%20they%20are%20useless%20without%20fsa%0D%0Ad%29%20you%20can%20not%20open%20files%20with&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F03%2F26%2Fwindows-phone-7-is-fail%2F&amp;t=Windows+Phone+7+is+Fail..." rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/03/26/windows-phone-7-is-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of useful rake tasks for Rails&#8230;</title>
		<link>http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/</link>
		<comments>http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 12:12:11 +0000</pubDate>
		<dc:creator>Bhushan G Ahire</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://blog.bhushangahire.net/?p=159</guid>
		<description><![CDATA[
rake cache:clear
# Clears all cached pages
rake db:bootstrap
# Loads a schema.rb file into the database and then loads the initial database fixtures.
rake db:bootstrap:copy_default_theme
# Copy default theme to site theme
rake db:migrate
# Migrate the database through scripts in db/migrate. Target specific version with VERSION=x
rake db:schema:dump
# Create a db/schema.rb file that can be portably used against any DB supported [...]]]></description>
			<content:encoded><![CDATA[<div class="fblike_button" style="margin: 10px 0;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F03%2F25%2Flist-of-useful-rake-tasks-for-rails%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=recommend&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px"></iframe></div>
<pre>rake cache<span style="color: #aa6600;">:clear</span>
<span style="color: #888888;"># Clears all cached pages</span>
rake db<span style="color: #aa6600;">:bootstrap</span>
<span style="color: #888888;"># Loads a schema.rb file into the database and then loads the initial database fixtures.</span>
rake db<span style="color: #aa6600;">:bootstrap</span><span style="color: #aa6600;">:copy_default_theme</span>
<span style="color: #888888;"># Copy default theme to site theme</span>
rake db<span style="color: #aa6600;">:migrate</span>
<span style="color: #888888;"># Migrate the database through scripts in db/migrate. Target specific version with VERSION=x</span>
rake db<span style="color: #aa6600;">:schema</span><span style="color: #aa6600;">:dump</span>
<span style="color: #888888;"># Create a db/schema.rb file that can be portably used against any DB supported by AR</span>
rake db<span style="color: #aa6600;">:schema</span><span style="color: #aa6600;">:load</span>
<span style="color: #888888;"># Load a schema.rb file into the database
</span>rake db<span style="color: #aa6600;">:bootstrap</span><span style="color: #aa6600;">:load</span>
<span style="color: #888888;"># Load initial database fixtures (in db/bootstrap/*.yml) into the current environment's database.  Load specific fixtures using FIXTURES=x,y</span>
rake db<span style="color: #aa6600;">:fixtures</span><span style="color: #aa6600;">:load</span>
<span style="color: #888888;"># Load fixtures into the current environment's database.  Load specific fixtures using FIXTURES=x,y</span>
rake db<span style="color: #aa6600;">:sessions</span><span style="color: #aa6600;">:clear</span>
<span style="color: #888888;"># Clear the sessions table</span>
rake db<span style="color: #aa6600;">:sessions</span><span style="color: #aa6600;">:create</span>
<span style="color: #888888;"># Creates a sessions table for use with CGI::Session::ActiveRecordStore</span>
rake db<span style="color: #aa6600;">:structure</span><span style="color: #aa6600;">:dump</span>
<span style="color: #888888;"># Dump the database structure to a SQL file</span>
rake db<span style="color: #aa6600;">:test</span><span style="color: #aa6600;">:clone</span>
<span style="color: #888888;"># Recreate the test database from the current environment's database schema</span>
rake db<span style="color: #aa6600;">:test</span><span style="color: #aa6600;">:clone_structure</span>
<span style="color: #888888;"># Recreate the test databases from the development structure</span>
rake db<span style="color: #aa6600;">:test</span><span style="color: #aa6600;">:prepare</span>
<span style="color: #888888;"># Prepare the test database and load the schema</span>
rake db<span style="color: #aa6600;">:test</span><span style="color: #aa6600;">:purge</span>
<span style="color: #888888;"># Empty the test database</span>
rake deploy
<span style="color: #888888;"># Push the latest revision into production using the release manager</span>
rake diff_from_last_deploy
<span style="color: #888888;"># Describe the differences between HEAD and the last production release</span>
rake doc<span style="color: #aa6600;">:app</span>
<span style="color: #888888;"># Build the app HTML Files</span>
rake doc<span style="color: #aa6600;">:clobber_app
</span><span style="color: #888888;"># Remove rdoc products</span>
rake doc<span style="color: #aa6600;">:clobber_plugins</span>
<span style="color: #888888;"># Remove plugin documentation</span>
rake doc<span style="color: #aa6600;">:clobber_rails</span>
<span style="color: #888888;"># Remove rdoc products</span>
rake doc<span style="color: #aa6600;">:plugins</span>
<span style="color: #888888;"># Generate documation for all installed plugins</span>
rake doc<span style="color: #aa6600;">:rails</span>
<span style="color: #888888;"># Build the rails HTML Files</span>
rake doc<span style="color: #aa6600;">:reapp</span>
<span style="color: #888888;"># Force a rebuild of the RDOC files</span>
rake doc<span style="color: #aa6600;">:rerails</span>
<span style="color: #888888;"># Force a rebuild of the RDOC files</span>
rake edge
<span style="color: #888888;"># freeze rails edge</span>
rake log<span style="color: #aa6600;">:clear</span>
<span style="color: #888888;"># Truncates all *.log files in log/ to zero bytes</span>
rake rails<span style="color: #aa6600;">:freeze</span><span style="color: #aa6600;">:edge
</span><span style="color: #888888;"># Lock to latest Edge Rails or a specific revision with REVISION=X (ex: REVISION=4021) or a tag with TAG=Y (ex: TAG=rel_1-1-0)</span>
rake rails<span style="color: #aa6600;">:freeze</span><span style="color: #aa6600;">:gems</span>
<span style="color: #888888;"># Lock this application to the current gems (by unpacking them into vendor/rails)</span>
rake rails<span style="color: #aa6600;">:unfreeze</span>
<span style="color: #888888;"># Unlock this application from freeze of gems or edge and return to a fluid use of system gems</span>
rake rails<span style="color: #aa6600;">:update</span>
<span style="color: #888888;"># Update both configs, scripts and public/javascripts from Rails</span>
rake rails<span style="color: #aa6600;">:update</span><span style="color: #aa6600;">:configs</span>
<span style="color: #888888;"># Update config/boot.rb from your current rails install</span>
rake rails<span style="color: #aa6600;">:update</span><span style="color: #aa6600;">:javascripts</span>
<span style="color: #888888;"># Update your javascripts from your current rails install</span>
rake rails<span style="color: #aa6600;">:update</span><span style="color: #aa6600;">:scripts
</span><span style="color: #888888;"># Add new scripts to the application script/ directory</span>
rake remote_exec
<span style="color: #888888;"># Execute a specific action using the release manager</span>
rake rollback
<span style="color: #888888;"># Rollback to the release before the current release in production</span>
rake show_deploy_tasks
<span style="color: #888888;"># Enumerate all available deployment tasks</span>
rake stats
<span style="color: #888888;"># Report code statistics (KLOCs, etc) from the application</span>
rake test
<span style="color: #888888;"># Test all units and functionals</span>
rake test<span style="color: #aa6600;">:functionals</span>                 <span style="color: #888888;">
# Run tests for functionalsdb:test:prepare</span>
rake test<span style="color: #aa6600;">:integration</span>
<span style="color: #888888;"># Run tests for integrationdb:test:prepare</span>
rake test<span style="color: #aa6600;">:plugins</span>                     <span style="color: #888888;">
# Run tests for pluginsenvironment</span>
rake test<span style="color: #aa6600;">:recent</span>
<span style="color: #888888;"># Run tests for recentdb:test:prepare</span>
rake test<span style="color: #aa6600;">:uncommitted</span>                 <span style="color: #888888;">
# Run tests for uncommitteddb:test:prepare</span>
rake test<span style="color: #aa6600;">:units</span>
<span style="color: #888888;"># Run tests for unitsdb:test:prepare</span>
rake tmp<span style="color: #aa6600;">:cache</span><span style="color: #aa6600;">:clear</span>
<span style="color: #888888;"># Clears all files and directories in tmp/cache</span>
rake tmp<span style="color: #aa6600;">:clear</span>                        <span style="color: #888888;">
# Clear session, cache, and socket files from tmp/</span>
rake tmp<span style="color: #aa6600;">:create</span>                       <span style="color: #888888;">
# Creates tmp directories for sessions, cache, and sockets</span>
rake tmp<span style="color: #aa6600;">:pids</span><span style="color: #aa6600;">:clear</span>                   <span style="color: #888888;">
# Clears all files in tmp/pids</span>
rake tmp<span style="color: #aa6600;">:sessions</span><span style="color: #aa6600;">:clear</span>               <span style="color: #888888;">
# Clears all files in tmp/sessions</span>
rake tmp<span style="color: #aa6600;">:sockets</span><span style="color: #aa6600;">:clear</span>
<span style="color: #888888;"># Clears all files in tmp/sockets</span>
rake update_dialog_helper
<span style="color: #888888;"># Copies the latest dialog.js to the application's public directory</span></pre>


<!-- Begin SexyBookmarks Menu Code -->
<div class="sexy-bookmarks sexy-bookmarks-expand sexy-bookmarks-center">
<ul class="socials">
		<li class="sexy-delicious">
			<a href="http://del.icio.us/post?url=http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/&amp;title=List+of+useful+rake+tasks+for+Rails..." rel="nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="sexy-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/&amp;title=List+of+useful+rake+tasks+for+Rails..." rel="nofollow" title="Digg this!">Digg this!</a>
		</li>
		<li class="sexy-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/&amp;title=List+of+useful+rake+tasks+for+Rails..." rel="nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="sexy-technorati">
			<a href="http://technorati.com/faves?add=http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/" rel="nofollow" title="Share this on Technorati">Share this on Technorati</a>
		</li>
		<li class="sexy-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/&amp;t=List+of+useful+rake+tasks+for+Rails..." rel="nofollow" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="sexy-twitter">
			<a href="http://twitter.com/home?status=List+of+useful+rake+tasks+for+Rails...+-+http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/+(via+@bhushangahire)" rel="nofollow" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="sexy-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/&amp;title=List+of+useful+rake+tasks+for+Rails...&amp;summary=rake%20cache%3Aclear%0D%0A%23%20Clears%20all%20cached%20pages%0D%0Arake%20db%3Abootstrap%20%20%20%20%20%20%0D%0A%23%20Loads%20a%20schema.rb%20file%20into%20the%20database%20and%20then%20loads%20the%20initial%20database%20fixtures.%0D%0Arake%20db%3Abootstrap%3Acopy_default_theme%0D%0A%23%20Copy%20default%20theme%20to%20site%20theme%0D%0Arake%20db%3Amigrate%0D%0A%23%20Migrate%20the%20database%20through%20scripts%20in%20db%2Fmigr&amp;source=eXpand yOur cReativity" rel="nofollow" title="Share this on Linkedin">Share this on Linkedin</a>
		</li>
		<li class="sexy-tumblr">
			<a href="http://www.tumblr.com/share?v=3&amp;u=http%3A%2F%2Fblog.bhushangahire.net%2F2010%2F03%2F25%2Flist-of-useful-rake-tasks-for-rails%2F&amp;t=List+of+useful+rake+tasks+for+Rails..." rel="nofollow" title="Share this on Tumblr">Share this on Tumblr</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>
<!-- End SexyBookmarks Menu Code -->

<div style='clear:both'></div>]]></content:encoded>
			<wfw:commentRss>http://blog.bhushangahire.net/2010/03/25/list-of-useful-rake-tasks-for-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
