<?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>Gudasoft &#187; Development</title>
	<atom:link href="http://www.gudasoft.com/category/english/development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.gudasoft.com</link>
	<description>Impossible is nothing</description>
	<lastBuildDate>Mon, 26 Jul 2010 10:22:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>Hiring Juniors</title>
		<link>http://www.gudasoft.com/english/development/07/24/1292/hiring-juniors/2010</link>
		<comments>http://www.gudasoft.com/english/development/07/24/1292/hiring-juniors/2010#comments</comments>
		<pubDate>Sat, 24 Jul 2010 16:02:31 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1292</guid>
		<description><![CDATA[Starting a company or a team If you think that by hiring juniors you will save money and will get working application &#8211; you are wrong. You will loose much more than money. Yes they are low cost, but read the rest of the post to be not tricked. Forget for nice and reliable code [...]]]></description>
			<content:encoded><![CDATA[<h2>Starting a company or a team</h2>
<p>If you think that by hiring juniors you will save money and will get working application &#8211; you are wrong.<br />
You will loose much more than money.</p>
<p>Yes they are low cost, but read the rest of the post to be not tricked.<span id="more-1292"></span></p>
<h3>Forget for nice and reliable code</h3>
<p>Most of  the time the developing is done by using some standard patterns which  the experienced developers apply without even thinking. You don&#8217;t have this from a junior &#8211; you will have &#8220;private&#8221; code which in the best case will NOT work. In the worst case it will work only in one way and you will have to fix this code at the end of the project when your time is less. DO NOT give them to commit code &#8211; leave them for years working the most misarable work that you can find untill they show that they deserve to trust them.</p>
<h3>Rewrite their code</h3>
<p>Most of them produce code that have to been rewritten. All the code they  write is code that is invented. They hope their code will work but  their vision is limited because of their experience.  To know where  might your code will fail you have to been working for years in this  field.</p>
<p>If a developer writes a code the chance that it will be ideologically wrong is very small. But if a junior write a code &#8211; then be prepared to rewrite big portions of your application. Things get worse when you discover this late &#8211; near the time your customer waits his applications.</p>
<h3>Good working environment</h3>
<p>They take the power from the experienced developers by asking them questions. And instead your powerful developers to work at full power they get distracted from work and the those with the leak souls start to believe that they are The One (by answering easy questions from the newbies). Your good developers will become like the juniors.</p>
<h3>Prestige of the company</h3>
<p>If you work in a company which have a name &#8211; imagine what will other think if some junior says that he learned this (code) in your company!</p>
<h3>You are responsible for them</h3>
<p>If something breaks -  you are the one which is responsible for their actions.</p>
<p>I have been working with juniors for 2 years before I realize that this is not working. In case you have already juniors &#8211; make them suffer until they go away or become real pro :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/07/24/1292/hiring-juniors/2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Argh&#8230;this rmagick gem &#8211; aways difficult to install/maintain.</title>
		<link>http://www.gudasoft.com/english/development/05/11/1241/god-bless-google/2010</link>
		<comments>http://www.gudasoft.com/english/development/05/11/1241/god-bless-google/2010#comments</comments>
		<pubDate>Tue, 11 May 2010 14:12:28 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1241</guid>
		<description><![CDATA[I have recently upgraded to Ubuntu 10.04 and I got this nasty rmagick gem error: RMagick2.so: This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use. (RuntimeError) google for This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use. (RuntimeError) then found this page in [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently upgraded to Ubuntu 10.04 and I got this nasty rmagick gem error:</p>
<p>RMagick2.so: This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use. (RuntimeError)</p>
<p>google for <a href="http://www.google.com/search?hl=en&amp;q=t++This+installation+of+RMagick+was+configured+with+ImageMagick+6.5.5+but+ImageMagick+6.5.7-8+is+in+use.+%28RuntimeError%29&amp;aq=f&amp;aqi=&amp;aql=&amp;oq=&amp;gs_rfai=">This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use. (RuntimeError)</a></p>
<p>then found <a href="http://uperro.blogspot.com/2010/05/after-upgrading-ubuntu-904-to-1004-lts.html">this page</a> in mixed English/Chinees</p>
<p>and finally got a <a href="http://adelio.org/redmine-lauft-nach-upgrade-auf-ubuntu-10-04-lucid-lynx-nicht-mehr/comment-page-1/">page</a> in German :)</p>
<p>Then I decide to write this post in English and slightly modify the solution</p>
<p>instead of putting</p>
<p>RMAGICK_BYPASS_VERSION_TEST = true in the deploy.rb</p>
<p>I have put this in the development.rb</p>
<p>and all it works &#8211; this way on the production I will be forced to use real compatible library or at least check again for another solution or gem.</p>
<p>AUCH! This solution doesn&#8217;t work even in development I got weird core dumps :( &#8230;so here it is another try</p>
<h1>Here is the real working  solution:</h1>
<pre>su -
git clone http://github.com/rmagick/rmagick.git
cd rmagick/
ruby setup.rb
ruby setup.rb  install</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/05/11/1241/god-bless-google/2010/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nice code</title>
		<link>http://www.gudasoft.com/english/development/rails-development/04/20/1237/nice-code/2010</link>
		<comments>http://www.gudasoft.com/english/development/rails-development/04/20/1237/nice-code/2010#comments</comments>
		<pubDate>Tue, 20 Apr 2010 15:51:35 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1237</guid>
		<description><![CDATA[I have just finished one method and I was not happy with the code. Then I put a comment on top of the method &#8220;Far from perfect&#8230;.&#8221;. Then I read the class &#8211; it was ugly. here is the before def validate return if is_email == false found = InternetComunicatorType.find(:first, :conditions =&#62; { :is_email =&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>I have just finished one method and I was not happy with the code. Then I put a comment on top of the method &#8220;Far from perfect&#8230;.&#8221;.</p>
<p>Then I read the class &#8211; it was ugly.</p>
<p>here is the before</p>
<pre>def validate
 return if is_email == false
 found = InternetComunicatorType.find(:first, :conditions =&gt; {
 :is_email =&gt; true,
 })

 return unless found

 if found.id != id
 errors.add(:is_email, "We have already email type")
 return
 end
end
</pre>
<p>here is the after</p>
<pre>def validate
  if is_email
    found = InternetComunicatorType.find(:first, :conditions =&gt; {
      :is_email =&gt; true,
    })

    if found and found.id != id
      errors.add(:is_email, "We have already email type")
    end
  end
end</pre>
<p>The result is much far readable</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/rails-development/04/20/1237/nice-code/2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mongoid presentations</title>
		<link>http://www.gudasoft.com/english/development/04/15/1235/mongoid-presentations/2010</link>
		<comments>http://www.gudasoft.com/english/development/04/15/1235/mongoid-presentations/2010#comments</comments>
		<pubDate>Thu, 15 Apr 2010 19:54:10 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[mongoid]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1235</guid>
		<description><![CDATA[When starting with mongoid I have missed a lot some demo source code. How it works with controllers, does it plays nice with nested attributes, such things. Here is presentation of mongo  and here are some slides]]></description>
			<content:encoded><![CDATA[<p>When starting with mongoid I have missed a lot some demo source code.</p>
<p>How it works with controllers, does it plays nice with nested attributes, such things.</p>
<p>Here is <a href="http://vimeo.com/9864311">presentation</a> of mongo  and here are <a href="http://www.slideshare.net/jsmestad/mongodb-mongoid-with-rails">some slides</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/04/15/1235/mongoid-presentations/2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mongoid</title>
		<link>http://www.gudasoft.com/english/development/rails-development/04/01/1233/mongoid/2010</link>
		<comments>http://www.gudasoft.com/english/development/rails-development/04/01/1233/mongoid/2010#comments</comments>
		<pubDate>Thu, 01 Apr 2010 19:09:12 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1233</guid>
		<description><![CDATA[I writing this post for those who start using Mongo in their rails applications. I want to share my experience. First I discovered mongoid but then i saw mongo_mapper  &#8211; so I decide to go with the crowd. But! I was wrong. I there is no documentation for mongo_mapper but some blog posts arround, the [...]]]></description>
			<content:encoded><![CDATA[<p>I writing this post for those who start using Mongo in their rails applications. I want to share my experience. First I discovered mongoid but then i saw mongo_mapper  &#8211; so I decide to go with the crowd. But! I was wrong. I there is no documentation for mongo_mapper but some blog posts arround, the examples are not aways working and you have to fight with all the code &#8211; I don&#8217;t maybe I have found some old documentation. When you dive in the code &#8211; again no documentation and not clear behaviour. Maybe it is a good solution but for me it doesn&#8217;t work. I lost 1.5 days experimenting and hoping that the things will go.</p>
<p>Then I give a try with mongoid. It has wonderfull <a href="http://mongoid.org/docs/associations">documentation</a> for starters also it seems at first glance that the code in mongoid is more readably and human friendly. It took me 2hours to port all my models to mongoid.</p>
<p>The guy developing mongoid seems pretty active.</p>
<p>last words &#8211; it is pleasure to work with mongoid &#8211; I recommend it to all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/rails-development/04/01/1233/mongoid/2010/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Four websites in a two weeks</title>
		<link>http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009</link>
		<comments>http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:59:43 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1190</guid>
		<description><![CDATA[A lot of work last weeks. Check those The interesting think is that two of them are on Rails (www.mebelicomfort.com, shop.djibutzo.com) , one of them is on WordPress and the last one is on some custom PHP framework. And meanwhile we are doing a lot of refactoring on our company website psspy.se, which finally is [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of work last weeks.</p>
<p>Check those</p>

<a href='http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009/attachment/mebeli' title='mebeli'><img width="150" height="150" src="http://www.gudasoft.com/wp-content/uploads/2009/12/mebeli-150x150.png" class="attachment-thumbnail" alt="mebeli" title="mebeli" /></a>
<a href='http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009/attachment/next' title='next'><img width="150" height="150" src="http://www.gudasoft.com/wp-content/uploads/2009/12/next-150x150.png" class="attachment-thumbnail" alt="next" title="next" /></a>
<a href='http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009/attachment/orient' title='orient'><img width="150" height="150" src="http://www.gudasoft.com/wp-content/uploads/2009/12/orient-150x150.png" class="attachment-thumbnail" alt="orient" title="orient" /></a>
<a href='http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009/attachment/sxy' title='sxy'><img width="150" height="150" src="http://www.gudasoft.com/wp-content/uploads/2009/12/sxy-150x150.png" class="attachment-thumbnail" alt="sxy" title="sxy" /></a>

<p>The interesting think is that two of them are on Rails (<a href="http://www.mebelicomfort.com">www.mebelicomfort.com</a>, <a href="http://shop.djibutzo.com">shop.djibutzo.com</a>) , one of <a href="http://www.nextlevel-broker.com">them</a> is on WordPress and the last one is on some custom PHP framework.</p>
<p>And meanwhile we are doing a lot of refactoring on our company website psspy.se, which finally is starting to look good.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.gudasoft.com/wp-content/uploads/2009/12/psspy.png"><img class="aligncenter size-thumbnail wp-image-1205" title="psspy" src="http://www.gudasoft.com/wp-content/uploads/2009/12/psspy-150x150.png" alt="psspy" width="150" height="150" /></a></p>
<p>After so much work I think that I will be tired but I am ready now for 6 websites for 1 week.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/12/14/1190/two-websites-in-a-week/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting fast with rspec</title>
		<link>http://www.gudasoft.com/english/development/11/29/1179/getting-fast-with-rspec/2009</link>
		<comments>http://www.gudasoft.com/english/development/11/29/1179/getting-fast-with-rspec/2009#comments</comments>
		<pubDate>Sun, 29 Nov 2009 18:03:00 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1179</guid>
		<description><![CDATA[get the gem from here http://github.com/timcharper/spork &#160; How to fix the Missing error http://chrisblunt.com/blog/2009/08/28/rails-configuring-rspec-for-spork/ &#160;]]></description>
			<content:encoded><![CDATA[<p>get the gem from here</p>
<p>http://github.com/timcharper/spork</p>
<p>&nbsp;</p>
<p>How to fix the Missing error</p>
<p>http://chrisblunt.com/blog/2009/08/28/rails-configuring-rspec-for-spork/</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/11/29/1179/getting-fast-with-rspec/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fonts for coders</title>
		<link>http://www.gudasoft.com/english/linux/10/28/1123/fonts-for-coders/2009</link>
		<comments>http://www.gudasoft.com/english/linux/10/28/1123/fonts-for-coders/2009#comments</comments>
		<pubDate>Tue, 27 Oct 2009 22:19:41 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Cliparts/Images/etc]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1123</guid>
		<description><![CDATA[guda@guda-laptop:~$ sudo mkdir /usr/share/fonts/myfonts guda@guda-laptop:~$ cd myfonts/ guda@guda-laptop:~/myfonts$ sudo cp *.ttf /usr/share/fonts/myfonts/ guda@guda-laptop:~/myfonts$ sudo fc-cache -f guda@guda-laptop:~/myfonts$ Fonts: AnonymousPro and AnonymousTT from here Font sources: Fonts 101 Abstract Fonts 1001 Free Fonts Font Reactor TypeNow Font Village EKNP Free Fonts &#160; Make X11 fonts available to Java Perform one of the following: Open /etc/profile and [...]]]></description>
			<content:encoded><![CDATA[<p>guda@guda-laptop:~$ sudo mkdir /usr/share/fonts/myfonts<br />
guda@guda-laptop:~$ cd myfonts/<br />
guda@guda-laptop:~/myfonts$ sudo cp *.ttf /usr/share/fonts/myfonts/<br />
guda@guda-laptop:~/myfonts$ sudo fc-cache -f<br />
guda@guda-laptop:~/myfonts$</p>
<ul>
<li>Fonts:</li>
<li><a href="http://www.gudasoft.com/wp-content/uploads/2009/10/AnonymousPro.zip">AnonymousPro</a> and <a href="http://www.gudasoft.com/wp-content/uploads/2009/10/AnonymousTT.zip">AnonymousTT</a> from <a href="http://www.gudasoft.com/wp-content/uploads/2009/10/AnonymousPro.zip">here</a></li>
</ul>
<p>Font sources:</p>
<ul>
<li><a href="http://www.fonts101.com/" target="_blank">Fonts 101</a></li>
<li><a href="http://www.abstractfonts.com/" target="_blank">Abstract Fonts</a></li>
<li><a href="http://www.1001freefonts.com/" target="_blank">1001 Free Fonts</a></li>
<li><a href="http://www.fontreactor.com/" target="_blank">Font Reactor</a></li>
<li><a href="http://www.typenow.net/" target="_blank">TypeNow</a></li>
<li><a href="http://www.fontvillage.com/" target="_blank">Font Village</a></li>
<li><a href="http://eknp.com/" target="_blank">EKNP Free Fonts</a></li>
</ul>
<p>&nbsp;</p>
<h3>Make X11 fonts available to Java</h3>
<p>Perform one of the following:</p>
<ol>
<li>Open <tt>/etc/profile</tt> and add a new environment variable<tt>JAVA_FONTS=/usr/share/fonts/truetype</tt><br />
<tt>export JAVA_FONTS<br />
</tt></li>
<li>Open <tt>font.properties</tt> file under <tt>jre/lib</tt> directory,    uncommnent and set to the appropriate font directory<tt>appendedfontpath=/usr/share/fonts/truetype</tt></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/linux/10/28/1123/fonts-for-coders/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS round corner box &#8211; the easy way :)</title>
		<link>http://www.gudasoft.com/english/development/clipart/10/19/1106/css-round-corner-box-the-easy-way/2009</link>
		<comments>http://www.gudasoft.com/english/development/clipart/10/19/1106/css-round-corner-box-the-easy-way/2009#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:52:59 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Clipart]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1106</guid>
		<description><![CDATA[http://www.neuroticweb.com/recursos/css-rounded-box/]]></description>
			<content:encoded><![CDATA[<p>http://www.neuroticweb.com/recursos/css-rounded-box/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/clipart/10/19/1106/css-round-corner-box-the-easy-way/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create object in different languages</title>
		<link>http://www.gudasoft.com/english/development/08/27/1083/create-object-in-different-languages/2009</link>
		<comments>http://www.gudasoft.com/english/development/08/27/1083/create-object-in-different-languages/2009#comments</comments>
		<pubDate>Thu, 27 Aug 2009 21:24:06 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1083</guid>
		<description><![CDATA[Java, C++, Ruby, Python, etc&#8230; Read more.. Java public class Point { public int x = 0; public int y = 0; //constructor public Point(int a, int b) { x = a; y = b; } Point originOne = new Point(23, 94); C++ #include &#60;iostream&#62; class IntList { public: IntList(); // constructor; initialize the list [...]]]></description>
			<content:encoded><![CDATA[<h1>Java, C++, Ruby, Python, etc&#8230;</h1>
<p>Read more..</p>
<p><span id="more-1083"></span></p>
<h1>Java</h1>
<pre>public class Point {
    public int x = 0;
    public int y = 0;
    //constructor
    public Point(int a, int b) {
	x = a;
	y = b;
    }

Point originOne = new Point(23, 94);</pre>
<h1>C++</h1>
<pre>#include &lt;iostream&gt;

class IntList {
  public:
    IntList();                         // constructor; initialize the list to be empty
    void AddToEnd(int k);              // add k to the end of the list
    void Print(ostream &amp;output) const; // print the list to output

  private:
    static const int SIZE = 10;      // initial size of the array
    int *Items;                      // Items will point to the dynamically allocated array
    int numItems;                    // number of items currently in the list
    int arraySize;                   // the current size of the array
};

IntList L; 

OR

IntList *p;
p = new IntList;  // The no-arg constructor is called</pre>
<h1>Python</h1>
<pre>class MyClass:
    """A simple example class"""
    i = 12345
    def f(self):
        return 'hello world'

x = MyClass()</pre>
<h1>Perl</h1>
<pre>package Inventory_item;
    sub new {
        my($class) = shift;

        bless {
            "PART_NUM"    =&gt; undef,
            "QTY_ON_HAND" =&gt; undef
        }, $class;
    }

package main;
   $item = Inventory_item-&gt;new();</pre>
<h1>Ruby</h1>
<pre>class Person
  attr_accessor :name

  def initialize(name)
  	@first_name = name
  end

end

matz = Person.new</pre>
<h1>Javascript</h1>
<pre>person = new Object()
person.name = "Tim Scarfe"
person.height = "6Ft"

person.run = function() {
	this.state = "running"
	this.speed = "4ms^-1"
}</pre>
<h1>Javascript</h1>
<pre>person = new Object()
person.name = "Tim Scarfe"
person.height = "6Ft"

person.run = function() {
	this.state = "running"
	this.speed = "4ms^-1"
}</pre>
<h1>PHP 5</h1>
<pre>class ExtendClass extends SimpleClass
{
	function __construct() {
       parent::__construct();
       print "In SubClass constructor\n";
   }

    // Redefine the parent method
    function displayVar()
    {
        echo "Extending class\n";
        parent::displayVar();
    }
}

$extended = new ExtendClass();
$extended-&gt;displayVar();</pre>
<h1>PHP 4</h1>
<pre>class Cart {
    var $items;  // Items in our shopping cart

    // Add $num articles of $artnr to the cart

    function add_item($artnr, $num) {
        $this-&gt;items[$artnr] += $num;
    }

    // Take $num articles of $artnr out of the cart

    function remove_item($artnr, $num) {
        if ($this-&gt;items[$artnr] &gt; $num) {
            $this-&gt;items[$artnr] -= $num;
            return true;
        } elseif ($this-&gt;items[$artnr] == $num) {
            unset($this-&gt;items[$artnr]);
            return true;
        } else {
            return false;
        }
    }
}</pre>
<h1>C#</h1>
<pre>public class Person
{
    // Field
    public string name;

    // Constructor
    public Person()
    {
        name = "unknown";
    }

    // Method
    public void SetName(string newName)
    {
        name = newName;
    }
}
class TestPerson
{
    static void Main()
    {
        Person person1 = new Person();
        System.Console.WriteLine(person1.name);

        person1.SetName("John Smith");
        System.Console.WriteLine(person1.name);
    }
}</pre>
<h1>VB.NET</h1>
<pre>Public Class TheClass
  Public Sub DoSomething()
    MsgBox("Hello world", MsgBoxStyle.Information, "TheClass")
  End Sub
End Class</pre>
<h1>Smalltalk</h1>
<pre>Object subclass: #MessagePublisher
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Smalltalk Examples'

MessagePublisher new

OR

publisher := MessagePublisher new

OR

MessagePublisher new publish</pre>
<h1>Pike</h1>
<pre>class animal
{
  string name;
  float weight;

  void create(string n, float w)
  {
    name = n;
    weight = w;
  }

  void eat(string food)
  {
    write(name + " eats some " + food + ".\n");
    weight += 0.5;
  }
}

animal some_animal;
some_animal = animal();
animal my_dog = animal();</pre>
<h1>Objective-C</h1>
<pre>Stack.h

#import &lt; objc/Object.h&gt;

@interface Stack : Object
{
  StackLink *top;
  unsigned int size;
}

- free;
- push: (int) anInt;
- (int) pop;
- (unsigned int) size;

@end

Stack.m

#import "Stack.h"

@implementation Stack

#define NULL_LINK (StackLink *) 0

+ new
{
  self = [super new];
  top = (StackLink *) 0;
  return self;
}

- free
{
  StackLink *next;

  while (top != NULL_LINK)
    {
      next = top-&gt;next;
      free ((char *) top);
      top = next;
    }
  return [super free];
}

- push: (int) value
{
  StackLink *newLink;

  newLink = (StackLink *) malloc (sizeof (StackLink));
  if (newLink == 0)
    {
      fprintf(stderr, "Out of memory\n");
      return nil;
    }
  newLink-&gt;data = value;
  newLink-&gt;next = top;
  top = newLink;
  size++;

  return self;
}

- (int) pop
{
  int value;
  StackLink *topLink;

  if (0 != size)
    {
      topLink = top;
      top = top-&gt;next;
      value = topLink-&gt;data;
      free (topLink);
      size--;
    }
  else
    {
      value = 0;
    }
  return value;
}

- (unsigned int) size
{
  return size;
}

@end

id s;
s = [Stack new];

example is from <a href="http://www.cs.indiana.edu/classes/c304/ObjC.html">here</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/08/27/1083/create-object-in-different-languages/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wall of shame</title>
		<link>http://www.gudasoft.com/english/development/08/25/1080/wall-of-shame/2009</link>
		<comments>http://www.gudasoft.com/english/development/08/25/1080/wall-of-shame/2009#comments</comments>
		<pubDate>Tue, 25 Aug 2009 13:04:55 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[shame]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1080</guid>
		<description><![CDATA[Check this brilliant HTML I found in one of our projects All of them are certainly not the same &#8220;Export Products&#8221;]]></description>
			<content:encoded><![CDATA[<p>Check this brilliant HTML I found in one of our projects</p>
<p><a href="http://www.gudasoft.com/wp-content/uploads/2009/08/company_products.png"><img class="alignnone size-full wp-image-1081" title="company_products" src="http://www.gudasoft.com/wp-content/uploads/2009/08/company_products.png" alt="company_products" width="647" height="295" /></a></p>
<p>All of them are certainly not the same &#8220;Export Products&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/08/25/1080/wall-of-shame/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 2.3.2+, memcached and logger</title>
		<link>http://www.gudasoft.com/english/development/rails-development/08/17/1058/rails-2-3-2-memcached-and-logger/2009</link>
		<comments>http://www.gudasoft.com/english/development/rails-development/08/17/1058/rails-2-3-2-memcached-and-logger/2009#comments</comments>
		<pubDate>Mon, 17 Aug 2009 11:43:42 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1058</guid>
		<description><![CDATA[Finally our twitterized version of psspy.se is ready. But! When in production &#8211; read with many connection &#8211; the memcached get overloaded by not closed connections and on 1024 it says &#8220;accept(): Too many open file&#8221; and memcached dies. After 1 day investigating the problem  we have found that the following line in the initializers [...]]]></description>
			<content:encoded><![CDATA[<p>Finally our twitterized version of psspy.se is ready. But! When in production &#8211; read with many connection &#8211; the memcached get overloaded by not closed connections and on 1024 it says</p>
<p>&#8220;accept(): Too many open file&#8221; and memcached dies.</p>
<p>After 1 day investigating the problem  we have found that the following line in the initializers is causing the problem</p>
<p>RAILS_DEFAULT_LOGGER.level = Logger::DEBUG</p>
<p>We havent investigating deeper but when commenting this line everything works fine.</p>
<p>We have tested with Rails 2.3.2 and 2.3.3 with memcache-client-1.7.4</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/rails-development/08/17/1058/rails-2-3-2-memcached-and-logger/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Everyday git</title>
		<link>http://www.gudasoft.com/english/development/08/12/1008/everyday-git/2009</link>
		<comments>http://www.gudasoft.com/english/development/08/12/1008/everyday-git/2009#comments</comments>
		<pubDate>Wed, 12 Aug 2009 17:56:36 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1008</guid>
		<description><![CDATA[Good resources http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html http://gitready.com/ http://book.git-scm.com/]]></description>
			<content:encoded><![CDATA[<p>Good resources</p>
<ul>
<li>http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html</li>
<li> http://gitready.com/</li>
<li>http://book.git-scm.com/</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/08/12/1008/everyday-git/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entity name recognition</title>
		<link>http://www.gudasoft.com/english/development/search-engines/08/11/1048/entity-name-recognition/2009</link>
		<comments>http://www.gudasoft.com/english/development/search-engines/08/11/1048/entity-name-recognition/2009#comments</comments>
		<pubDate>Tue, 11 Aug 2009 19:06:58 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[search engines]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=1048</guid>
		<description><![CDATA[Book &#8211; http://www.manning.com/ingersoll/ LingPipe OpenCalais http://opennlp.sourceforge.net/ Tika is a content extraction framework + Apache Solr Content Extraction Library (Solr Cell) + varios packages of solr]]></description>
			<content:encoded><![CDATA[<p>Book &#8211; http://www.manning.com/ingersoll/</p>
<p><a title="LingPipe" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://alias-i.com/lingpipe/');" href="http://alias-i.com/lingpipe/" target="_blank">LingPipe</a></p>
<p><a title="OpenCalais" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://www.opencalais.com/');" href="http://www.opencalais.com/" target="_blank">OpenCalais</a></p>
<p>http://opennlp.sourceforge.net/</p>
<p><a href="http://www.lucidimagination.com/Community/Hear-from-the-Experts/Articles/Content-Extraction-Tika">Tika is a content extraction framework + Apache Solr Content Extraction Library (Solr Cell) + varios packages of solr<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/search-engines/08/11/1048/entity-name-recognition/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Ubuntu workstation configuration</title>
		<link>http://www.gudasoft.com/english/linux/06/24/989/my-ubutno-workstation-configuration/2009</link>
		<comments>http://www.gudasoft.com/english/linux/06/24/989/my-ubutno-workstation-configuration/2009#comments</comments>
		<pubDate>Wed, 24 Jun 2009 18:42:39 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[admini]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=989</guid>
		<description><![CDATA[XOrg configuration https://wiki.ubuntu.com/X/Config/Resolution cvt 1680 1050 75 xrandr &#8211;newmode &#8230;the output from cvt xrandr &#8211;newmode &#8220;1680x1050_75.00&#8243; 187.00 1680 1800 1976 2272 1050 1053 1059 1099 -hsync +vsync xrandr &#8211;addmode DVI-0 1680x1050_75.00 Lenovo Y510 You have to install the latest alsa. Then replace the existing kernel modules with the just build one. Then run depmod -a [...]]]></description>
			<content:encoded><![CDATA[<h1>XOrg configuration</h1>
<ul>
<li>https://wiki.ubuntu.com/X/Config/Resolution</li>
<li>cvt 1680 1050 75</li>
<li> xrandr &#8211;newmode &#8230;the output from cvt<br />
xrandr &#8211;newmode  &#8220;1680x1050_75.00&#8243;  187.00  1680 1800 1976 2272  1050 1053 1059 1099 -hsync +vsync</li>
<li> xrandr &#8211;addmode  DVI-0 1680x1050_75.00</li>
</ul>
<h1>Lenovo Y510</h1>
<p>You have to install the latest alsa.</p>
<p>Then replace the existing kernel modules with the just build one. Then run depmod -a as point kilbasar here</p>
<p>http://ubuntuforums.org/showthread.php?t=687663&amp;page=2</p>
<pre dir="ltr">sudo su
cd /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/
mv snd-hda-intel.ko snd-hda-intel.ko.bak
ln -s /lib/modules/2.6.22-14-generic/kernel/sound/pci/hda/snd-hda-intel.ko /lib/modules/2.6.22-14-generic/ubuntu/media/snd-hda-intel/snd-hda-intel.ko
cd /usr/src/alsa/alsa-driver-1.0.16rc2/modules
cp * /lib/modules/2.6.22-14-generic/kernel/sound/
depmod -a</pre>
<h1>Logitech Revolution MX</h1>
<p>http://x4.6times7.org/dokuwiki/doku.php/devlog/blog/howto_logitech_mx_revolution_on_ubuntu</p>
<ul>
<li>The mouse wheel control
<ul>
<li>Download from here http://goron.de/~froese/revoco/ or <a href="http://www.gudasoft.com/wp-content/uploads/2009/06/revoco-0.5.tar.gz">revoco-0.5.tar</a></li>
</ul>
<ul>
<li>make</li>
<li>sudo ./revoco manual=6</li>
<li><tt>lets try to add it in ~/.xprofile next time<br />
</tt></li>
</ul>
</li>
</ul>
<ul>
<li>Here is my xorg.conf</li>
</ul>
<pre>Section "Monitor"
 Identifier "External DVI"
 # 1680x1050 74.89 Hz (CVT 1.76MA) hsync: 82.31 kHz; pclk: 187.00 MHz
 Modeline "1680x1050_75.00"  187.00  1680 1800 1976 2272  1050 1053 1059 1099 -hsync +vsync
 # 1680x1050 59.95 Hz (CVT 1.76MA) hsync: 65.29 kHz; pclk: 146.25 MHz
 Modeline "1680x1050_60.00"  146.25  1680 1784 1960 2240  1050 1053 1059 1089 -hsync +vsync
 # 1680x1050 69.88 Hz (CVT) hsync: 76.58 kHz; pclk: 174.00 MHz
 Modeline "1680x1050_70.00"  174.00  1680 1800 1976 2272  1050 1053 1059 1096 -hsync +vsync
 Option "PreferedMode"    "1280x1024_75.00"
EndSection

Section "Screen"
 Identifier    "Configured Screen Device"
 Device    "Configured Video Device"
 SubSection "Display"
 Depth    24
 Modes "1680x1050" "1024x768" "640x480"
 Virtual    2960 1050
 EndSubSection
EndSection

Section "Device"
 Identifier    "Configured Video Device"
 Option    "Monitor-DVI-0" "External DVI"
EndSection</pre>
<h1>My Development setup commands</h1>
<p>I noticed simillar post <a href="http://yobine.tistory.com/?page=3">here</a></p>
<pre>sudo aptitude install mc vim subversion screen pidgin meld curl links2 vim-ruby vim-gnome vim-doc vim-scripts vim-ruby vim-perl \
subversion git-core bluefish kompozer\
libmysqlclient15off libmysqlclient15-dev mysql-common mysql-client \
libmysql-ruby1.8 irb ruby1.8 rdoc ri rake \
apt-utils build-essential ruby1.8-dev mysql-server memcached libxslt1-dev libpcre3-dev zlib1g-dev unzip gzip mytop openssl \
libopenssl-ruby libmagick9-dev imagemagick librmagick-ruby1.8 imagemagick librmagick-ruby-doc  libmagick9-dev ruby1.8-dev \
libdbd-sqlite3-ruby libsqlite3-ruby sqlite3 libsqlite3-dev

ln -s /usr/bin/ruby1.8 /usr/bin/ruby

mkdir ruby_install
cd ruby_install
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar xzvf ruby*
cd rubygems-1.3.5
ruby setup.rb
cd ..
cd ..

ln -s /usr/bin/gem1.8 /usr/bin/gem

gem install rails mysql mongrel mongrel_cluster rails paperclip will_paginate andand \
json feed-normalizer hpricot mechanize ruby-debug uuid ruport ruport-util acts_as_reportable \
rufus-scheduler annotate openwferu-scheduler production_log_analyzer capistrano-ext libxml-ruby twitter capistrano wirble RedCloth
rspec-rails sqlite3-ruby \
--no-ri --no-rdoc

gem install rmagick -v 1.15.12
ruby -rrubygems -e "require 'RMagick'; puts Magick::Long_version;"

cat &gt; /home/guda/.irbrc
require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize
require 'logger'
if ENV.include?('RAILS_ENV') &amp;&amp; !Object.const_defined?('RAILS_DEFAULT_LOGGER')
Object.const_set('RAILS_DEFAULT_LOGGER', Logger.new(STDOUT))
end

Gmail notification

http://www.workswithu.com/2009/10/06/gmail-notifier-applets-for-ubuntu/</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/linux/06/24/989/my-ubutno-workstation-configuration/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some nice software that I am looking arround</title>
		<link>http://www.gudasoft.com/english/development/06/05/942/some-nice-software-that-i-am-looking-arround/2009</link>
		<comments>http://www.gudasoft.com/english/development/06/05/942/some-nice-software-that-i-am-looking-arround/2009#comments</comments>
		<pubDate>Fri, 05 Jun 2009 10:24:33 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[spi]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=942</guid>
		<description><![CDATA[libhttp-access2 &#8211; lwp for ruby ruby ide http://github.com/danlucraft/redcar/tree/master]]></description>
			<content:encoded><![CDATA[<p>libhttp-access2 &#8211; lwp for ruby</p>
<p>ruby ide http://github.com/danlucraft/redcar/tree/master</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/06/05/942/some-nice-software-that-i-am-looking-arround/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rake mysql tasks</title>
		<link>http://www.gudasoft.com/english/development/rails-development/05/06/880/rake-mysql-tasks/2009</link>
		<comments>http://www.gudasoft.com/english/development/rails-development/05/06/880/rake-mysql-tasks/2009#comments</comments>
		<pubDate>Wed, 06 May 2009 19:06:13 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=880</guid>
		<description><![CDATA[I have found that I should be quicker if I put the following task in all my small projects. require &#8216;find&#8217; namespace :mysql do desc &#8220;Perform mysql dump on the RAILS_ENV environment&#8221; task :dump =&#62; :environment do db_config = ActiveRecord::Base.configurations[RAILS_ENV] backup_file = &#8220;#{db_config['database']}.sql&#8221; cmd = &#8220;mysqldump -u #{db_config['username']} -p#{db_config['password']} -Q &#8211;add-drop-table -O add-locks=FALSE -O lock-tables=FALSE [...]]]></description>
			<content:encoded><![CDATA[<p>I have found that I should be quicker if I put the following task in all my small projects.<br />
<span id="more-880"></span></p>
<p>require &#8216;find&#8217;<br />
namespace :mysql do<br />
desc &#8220;Perform mysql dump on the RAILS_ENV environment&#8221;<br />
task :dump =&gt; :environment do<br />
db_config = ActiveRecord::Base.configurations[RAILS_ENV]<br />
backup_file = &#8220;#{db_config['database']}.sql&#8221;<br />
cmd = &#8220;mysqldump -u #{db_config['username']} -p#{db_config['password']} -Q &#8211;add-drop-table -O add-locks=FALSE -O lock-tables=FALSE #{db_config['database']} -r #{backup_file}&#8221;<br />
puts cmd<br />
sh cmd<br />
end</p>
<p>desc &#8220;imports the dumped database in the mysql FILE&#8221;<br />
task :import =&gt; :environment do |t, args|<br />
version = ENV["FILE"] ? ENV["FILE"].to_i : nil<br />
raise &#8220;FILE is required&#8221; unless version</p>
<p>db_config = ActiveRecord::Base.configurations[RAILS_ENV]<br />
backup_file = ENV["FILE"]<br />
sh &#8220;mysql -u #{db_config['username']} -p#{db_config['password']} -e \&#8221;CREATE DATABASE IF NOT EXISTS #{db_config['database']}\&#8221; &#8221;<br />
sh &#8220;mysql -u #{db_config['username']} -p#{db_config['password']} #{db_config['database']} &lt; #{backup_file}&#8221;<br />
end</p>
<p>desc &#8220;runs the mysql console for the selected RAILS_ENV&#8221;<br />
task :console =&gt; :environment do<br />
db_config = ActiveRecord::Base.configurations[RAILS_ENV]<br />
backup_file = &#8220;#{db_config['database']}.sql&#8221;<br />
cmd = &#8220;mysql -u #{db_config['username']} -p#{db_config['password']} #{db_config['database']}&#8221;<br />
sh cmd<br />
end</p>
<p>end</p>
<p>The task dumps just make a mysql dump from the current environment. Hmm. The next step is to transfer it with scp to my host.</p>
<p>Grab from <a href="http://errtheblog.com/posts/31-rake-around-the-rosie">here</a> the mysql console task</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/rails-development/05/06/880/rake-mysql-tasks/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zip Codes and Distances</title>
		<link>http://www.gudasoft.com/english/development/04/23/842/zip-codes-and-distances/2009</link>
		<comments>http://www.gudasoft.com/english/development/04/23/842/zip-codes-and-distances/2009#comments</comments>
		<pubDate>Thu, 23 Apr 2009 15:08:23 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=842</guid>
		<description><![CDATA[The Haversine formula to calculate distances: #C example http://blogs.techrepublic.com.com/programming-and-development/?p=634 A lot of talking &#8230; http://mathforum.org/library/drmath/view/51879.html http://www.ruby-forum.com/topic/48815 Get ZIP codes in range http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/174783 http://forums.devshed.com/php-development-5/how-can-i-search-my-database-using-an-array-like-534211.html?p=2052453 http://www.hotscripts.com/listing/zip-code-range-and-distance-calculation-class/ Ruby Gems http://github.com/collectiveidea/graticule/tree/master http://github.com/andre/geokit-gem/tree/master http://github.com/andre/geokit-rails/tree/master Finding visitors via their IP address http://www.hostip.info/ Use Google Maps to display the results check this post here The next is taken from: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/174783 Below are [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.movable-type.co.uk/scripts/latlong.html">Haversine</a> formula to calculate distances:</p>
<ul>
<li>#C example http://blogs.techrepublic.com.com/programming-and-development/?p=634</li>
<li>A lot of talking &#8230; http://mathforum.org/library/drmath/view/51879.html</li>
<li>http://www.ruby-forum.com/topic/48815</li>
</ul>
<p>Get ZIP codes in range</p>
<ul>
<li>http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/174783</li>
<li>http://forums.devshed.com/php-development-5/how-can-i-search-my-database-using-an-array-like-534211.html?p=2052453</li>
<li>http://www.hotscripts.com/listing/zip-code-range-and-distance-calculation-class/</li>
</ul>
<p>Ruby Gems</p>
<ul>
<li>http://github.com/collectiveidea/graticule/tree/master</li>
<li>http://github.com/andre/geokit-gem/tree/master</li>
<li>http://github.com/andre/geokit-rails/tree/master</li>
</ul>
<p>Finding visitors via their IP address</p>
<ul>
<li>http://www.hostip.info/</li>
</ul>
<p>Use Google Maps to display the results check this post <a href="http://ilakeruby.blogspot.com/2009_03_01_archive.html">here</a></p>
<p><span id="more-842"></span></p>
<p>The next is taken from: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/174783</p>
<pre>Below are my zipcode notes. None of this originates from me, so I
really can't help much if you should have questions. Caveat emptor.
But there's probably a gem or two hidden somewhere in all the cruft.

-------------------------------------------------------------------

You can get zip code data and a MySQL schema here:

<a href="http://www.sanisoft.com/ziploc/" target="_top">http://www.sanisoft.com/ziploc/</a>

There is some PHP code there for searching that can easily be ported to Ruby:

class ZipCode &lt; ActiveRecord::Base

         def search(radius = 30)
                 ZipCode.find_by_sql("SELECT * FROM zip_codes WHERE
(POW((69.1*(lon-#{self.lon})*cos(#{self.lat}/57.3)),2)+
  POW((69.1*(lat-#{self.lat})),2))&lt;(#{radius}*#{radius})")
         end
end

OR

This can be done through the use of free Geocoding websites and a little math.

One such site is GeoCoder.us (Web based, or API for a fee ..I beleive), where you can input the addresses (not just zip codes... which is what you asked for, but its close.  "1 main street,
ZIP CODE" is usually a fair assumption.

<a href="http://geocoder.us/" target="_top">http://geocoder.us/</a>

Once you have both longitude/latitude coordinates for the addresses, you can then calculate the distance between the two. Here are two links which explain how:

<a href="http://jan.ucc.nau.edu/%7Ecvm/latlongdist.html" target="_top">http://jan.ucc.nau.edu/~cvm/latlongdist.html</a>
<a href="http://www.mathforum.com/library/drmath/view/51711.html" target="_top">http://www.mathforum.com/library/drmath/view/51711.html</a>

As for Rails/Ruby solutions.. I don't know of any off hand, but there is a Perl interface to Geocoder.us which may be easily ported or referenced to help you on your way:

<a href="http://search.cpan.org/%7Esderle/Geo-Coder-US-1.00/US.pm" target="_top">http://search.cpan.org/~sderle/Geo-Coder-US-1.00/US.pm</a>

OR

<a href="http://maps.huge.info/" target="_top">http://maps.huge.info/</a>

OR

<a href="http://www.zipcodedownload.com/" target="_top">http://www.zipcodedownload.com/</a>

OR

<a href="http://www.zipinfo.com/" target="_top">http://www.zipinfo.com</a>

OR

<a href="http://geocoder.us/" target="_top">http://geocoder.us/</a>
[<a href="http://www.hyperionreactor.net/node/87" target="_top">http://www.hyperionreactor.net/node/87</a>]

------------------------------------------------------------------------------------------
There is a 40,000+ zip code database in CivicSpace labs that has lat and long by zip code:

   <a href="http://civicspacelabs.org/home/developers/download" target="_top">http://civicspacelabs.org/home/developers/download</a>

   <a href="http://civicspacelabs.org/releases/zipcodes/zipcodes-csv-10-Aug-2004.zip" target="_top">http://civicspacelabs.org/releases/zipcodes/zipcodes-csv-10-Aug-2004.zip</a>

   Distance between two points (lat, long) is calculated using the Haversine formula:

   dlon = lon2 - lon1
   dlat = lat2 - lat1
   a = (sin(dlat/2))2 + cos(lat1) * cos(lat2) * (sin(dlon/2))2
   c = 2 * atan2(sqrt(a), sqrt(1-a))
   d = R * c

   See the following link or google for more:

   <a href="http://mathforum.org/library/drmath/view/51879.html" target="_top">http://mathforum.org/library/drmath/view/51879.html</a>

 &gt;<span style="color: #007700;">&gt; <span style="color: #d2691e;">Excellent!  The only thing remaining is an efficient algorithm for a search</span></span>
 &gt;<span style="color: #007700;">&gt; <span style="color: #d2691e;">for all zipcodes within a given radius.</span></span>

Using Ruby and SQLite3:

   pabs@halcyon:~/proj/zip&gt; ./import.rb zipcode.{csv,db}
   pabs@halcyon:~/proj/zip&gt; ./find.rb zipcode.db 22003 3
   "city","state","zip","distance (mi)"
   "Annandale","VA","22003","0.0"
   "Springfield","VA","22161","1.62363604423677"
   "Springfield","VA","22151","1.87190097838136"
   "Falls Church","VA","22042","2.97362028549975"

Here's the code for each piece (also available at the URL
<a href="http://pablotron.org/files/zipfind.tar.gz" target="_top">http://pablotron.org/files/zipfind.tar.gz</a>):

   ---- import.rb ----
   #!/usr/bin/env ruby

   # load libraries
   require 'rubygems' rescue nil
   require 'sqlite3'

   # constants
   SCAN_RE = /"(d{5})","([^"]+)","(..)","([d.-]+)","([d.-]+)","([d-]+)","(d)"/
   SQL = "INSERT INTO zips(zip, city, state, lat, long, timezone, dst)
                 VALUES (?, ?, ?, ?, ?, ?, ?)"
   TABLE_SCHEMA = "CREATE TABLE zips (
     id        INTEGER     NOT NULL PRIMARY KEY,

     zip       VARCHAR(5)  NOT NULL,
     city      TEXT        NOT NULL,
     state     VARCHAR(2)  NOT NULL,
     lat       FLOAT       NOT NULL,
     long      FLOAT       NOT NULL,
     timezone  INTEGER     NOT NULL,
     dst       BOOLEAN     NOT NULL
   );"

   # handle command-line arguments
   unless ARGV.size == 2
     $stderr.puts "Usage: #$0 &lt;csv&gt; &lt;db&gt;"
     exit -1
   end
   csv_path, db_path = ARGV

   # load database, create zip table and prepared statement
   db = SQLite3::Database.new(db_path)
   db.query(TABLE_SCHEMA)
   st = db.prepare(SQL)

   # parse CSV and add each line to the database
   db.transaction {
     File.read(csv_path).scan(SCAN_RE).each { |row| st.execute(*row) }
   }
   ----------

   ---- find.rb ----
   #!/usr/bin/env ruby

   require 'rubygems'
   require 'sqlite3'

   MI_R = 1.15

   # grab base zip code
   unless ARGV.size &gt; 1
     $stderr.puts "Usage: #$0 &lt;db&gt; &lt;zipcode&gt; [radius]"
     exit -1
   end
   db_path, src_zip, radius = ARGV
   radius = (radius || 50).to_i

   # open database
   db = SQLite3::Database.new(db_path)

   # get lat/long for specified zip code
   sql = "SELECT lat, long FROM zips WHERE zip = ?"
   src_lat, src_long = db.get_first_row(sql, src_zip).map { |v| v.to_f }

   unless src_lat &amp;&amp; src_long
     $stderr.puts "Unknown zip code '#{src_zip}'"
     exit -1
   end

   # calculate min/max lat/long
   ret, range = [], radius / 69.0

   # get all codes within given rectangle
   sql = "SELECT lat, long, city, state, zip
            FROM zips
           WHERE lat &gt; ? AND lat &lt; ?
             AND long &gt; ? AND long &lt; ?"
   args = [src_lat - range, src_lat + range,
           src_long - range, src_long + range]

   db.prepare(sql).execute(*args).each do |row|
     # get row values, convert lat/long to floats
     dst_lat, dst_long, dst_zip, dst_city, dist_st  = row
     dst_lat, dst_long = dst_lat.to_f, dst_long.to_f

     # calculate distance between zip codes.  if dst_zip is within the
     # specified radius, then add it to the list of results
     d = Math.sqrt((dst_lat - src_lat) ** 2 + (dst_long - src_long) ** 2)
     ret &lt;&lt; [dst_zip, dst_city, dist_st, d * 69.0] if d &lt;= range
   end

   # sort results by distance
   ret = ret.sort { |a, b| a[-1] &lt;=&gt; b[-1] }

   # print out results as a CSV
   puts '"city","state","zip","distance (mi)"',
        ret.map { |row| '"' &lt;&lt; row.join('","') &lt;&lt; '"' }
   ----

 &gt;<span style="color: #007700;">&gt; <span style="color: #d2691e;">I suppose one technique might be to first narrow the databse search within a</span></span>
 &gt;<span style="color: #007700;">&gt; <span style="color: #d2691e;">given a given square latitude/longitude range and then filter those results</span></span>
 &gt;<span style="color: #007700;">&gt; <span style="color: #d2691e;">by testing that they are within the given circle radius</span></span>

That's all the code above does.  There's some room for optimization
there; for example, you could create a region field, then calculate list
of regions that intersect with the search radius.  If you index on the
region field, then the query becomes essentially an index lookup instead
of a lat/long comparison (you still have to do the second distance
calculation, of course).

Landon wrote:

&gt; <span style="color: #007700;">Hello,</span>
&gt;
&gt; <span style="color: #007700;">I'm still very new to Ruby, however am growing to like the language more </span>
&gt; <span style="color: #007700;">and more as I use it.</span>
&gt;
&gt; <span style="color: #007700;">Presently, I'm looking for some classes(I'm used to java, sorry, not </span>
&gt; <span style="color: #007700;">sure what you'd call them in Ruby) that can measure geographic distances </span>
&gt; <span style="color: #007700;">based on information like zip, city, state, etc.</span>
&gt;
&gt; <span style="color: #007700;">An example of the sort of the functionality I'm looking for would be the </span>
&gt; <span style="color: #007700;">"find locations withing X miles of zip code 01234" searches you can do </span>
&gt; <span style="color: #007700;">with google maps or mapquest.</span>
&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/04/23/842/zip-codes-and-distances/2009/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mysql gem and the mkfm error</title>
		<link>http://www.gudasoft.com/english/development/rails-development/04/14/789/mysql-gem-and-the-mkfm-error/2009</link>
		<comments>http://www.gudasoft.com/english/development/rails-development/04/14/789/mysql-gem-and-the-mkfm-error/2009#comments</comments>
		<pubDate>Tue, 14 Apr 2009 15:44:32 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=789</guid>
		<description><![CDATA[The mysql gem was removed from the rails 2.3.2. and you need to install it via the gem install mysql command But! There is a problem compiling it. seems that the mysql cant find the libmysql so..here are the options: yum install openssl openssl-devel Configure with path to mysql_config and install the mysql api via [...]]]></description>
			<content:encoded><![CDATA[<pre>The mysql gem was removed from the rails 2.3.2. and you need to install it via the gem install mysql command
But! There is a problem compiling it. seems that the mysql cant find the libmysql so..here are the options:
yum install openssl openssl-devel

Configure with path to mysql_config and install the mysql api via gem:

# cd /usr/lib/ruby/gems/1.8/gems/mysql-2.7
# ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config
# make
# ruby ./test.rb [hostname [user [passwd [dbname [port [socket [flag]]]]]]]
# make install
# gem install mysql

Source: http://www.linuxweblog.com/ruby-on-rails-install

And after that you can read the README.html located in the mysql gem directory :)</pre>
<h1>Debian/Ubuntu</h1>
<pre> sudo aptitude install libmysqlclient-dev libmysql-ruby  libmysql++-dev ruby-dev</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/rails-development/04/14/789/mysql-gem-and-the-mkfm-error/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress themes</title>
		<link>http://www.gudasoft.com/english/development/04/13/734/wordpress-themes/2009</link>
		<comments>http://www.gudasoft.com/english/development/04/13/734/wordpress-themes/2009#comments</comments>
		<pubDate>Mon, 13 Apr 2009 15:59:00 +0000</pubDate>
		<dc:creator>guda</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.gudasoft.com/?p=734</guid>
		<description><![CDATA[Last week I have the honor to make one wordpress website and I was amazed how good it is wordpress for such small personal websites. Here I have found a list of wordpress templates in Internet (lost the source please forgive me). Nice collection of links WordPress Theme Viewer Top WordPress Themes &#8211; Best Free [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I have the honor to make one wordpress website and I was amazed how good it is wordpress for such small personal websites.</p>
<p>Here I have found a list of wordpress templates in Internet (lost the source please forgive me).</p>
<p>Nice collection of links</p>
<ul>
<li><a class="l" onmousedown="return clk(this.href,'','','res','1','')" href="http://themes.wordpress.net/">WordPress Theme Viewer</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','2','')" href="http://topwpthemes.com/">Top WordPress Themes &#8211; Best Free Themes for WordPress</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','3','')" href="http://www.wpthemespot.com/">WordPress Themes &#8211; The Best Of The Best!</a></li>
</ul>
<p>more&#8230;.</p>
<p><span id="more-734"></span></p>
<ul>
<li><a class="l" onmousedown="return clk(this.href,'','','res','4','')" href="http://www.nattywp.com/">Best WordPress Themes collection WP themes WordPress templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','6','')" href="http://www.templatesbrowser.com/wordpress-themes/">Free WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','8','')" href="http://www.zchaos.com/">WordPress Themes &#8211; Free WP WordPress Themes Templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','9','')" href="http://www.siteground.com/wordpress-hosting/wordpress-themes.htm">New WordPress themes release every week! Free Professional themes </a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','11','')" href="http://www.themeporter.com/">Theme Porter &#8211; WordPress Themes , WordPress Templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','45','')" href="http://www.wpthemesfree.com/">WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','12','')" href="http://www.ndesign-studio.com/resources/wp-themes/">WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','13','')" href="http://www.justskins.com/">WordPress Themes, vBulletin Styles, Skins, Joomla Templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','14','')" href="http://www.themelab.com/">Free WordPress Themes and WordPress Tutorials at Theme Lab</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','15','')" href="http://www.wpthemesarchive.com/">Free WordPress themes &amp; templates. WP themes </a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','16','')" href="http://wpthemeland.com/">WordPress Theme Land &#8211; Free WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','17','')" href="http://www.freewpthemes.net/">Download free WordPress themes &#8211; Free WP Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','18','')" href="http://www.solostream.com/">WordPress Themes. WordPress Themes Tutorials. Blog Design</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','19','')" href="http://wpmix.com/">Free WordPress Themes, WordPress Designer &#8211; Custom WP Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','22','')" href="http://wpthemesplugin.com/">WordPress Themes, WordPress Plugins, Blog Tips</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','23','')" href="http://www.skinpress.com/">Free wordpress themes, Css &amp; flash website design templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','26','')" href="http://www.wpfreethemes.com/">Free wordpress theme downloads</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','27','')" href="http://dinothemes.com/">WordPress Themes Dinothemes.com</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','34','')" href="http://www.themebox.org/">Free WordPress Themes &amp; phpLD Templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','36','')" href="http://www.wordpress.pro/">WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','39','')" href="http://www.prowordpressthemes.com/">Free WordPress Themes, Professional WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','42','')" href="http://www.itcouldbethisone.com/">WordPress themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','46','')" href="http://wordpresshome.com/">Free WordPress Themes, Templates, Skins and Plugins </a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','47','')" href="http://www.wordpressthemes.com/">WordPress Themes</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','53','')" href="http://www.wpthemespress.com/">FREE Premium WordPress Themes : WordPress Templates : Blog Templates</a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','57','')" href="http://wpthemepark.com/">WordPress Theme Park </a></li>
<li><a class="l" onmousedown="return clk(this.href,'','','res','35','')" href="http://www.osdesigner.net/">OS Designer &#8211; Open source templates &#8211; WordPress themes</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gudasoft.com/english/development/04/13/734/wordpress-themes/2009/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
