<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>4 Lines of Code</title>
	<atom:link href="http://4loc.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://4loc.wordpress.com</link>
	<description>A blog about software development and Ruby on Rails</description>
	<lastBuildDate>Sun, 29 Nov 2009 11:55:37 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='4loc.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e0beef5698edbb0a3475431d093dd39c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>4 Lines of Code</title>
		<link>http://4loc.wordpress.com</link>
	</image>
			<item>
		<title>Every Line of Code (Is A Child Of Mine)</title>
		<link>http://4loc.wordpress.com/2009/11/28/every-line-of-code-is-a-child-of-mine/</link>
		<comments>http://4loc.wordpress.com/2009/11/28/every-line-of-code-is-a-child-of-mine/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 19:36:06 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[geek and poke]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=824</guid>
		<description><![CDATA[Another nice cartoon from Oliver Widder: usually commenting out code does not lead to clean code, but sometimes we do it nevertheless. This explanation is nice: every line of code is a child of mine

Posted in fun       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=824&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Another nice cartoon from <a href="http://www.geekandpoke.com/">Oliver Widder</a>: usually commenting out code does not lead to clean code, but sometimes we do it nevertheless. This explanation is nice: <a href="http://geekandpoke.typepad.com/geekandpoke/2009/11/every-line-is-a-child-of-mine.html">every line of code is a child of mine</a><br />
<a href="http://4loc.files.wordpress.com/2009/11/lines_of_code.jpg"><img src="http://4loc.files.wordpress.com/2009/11/lines_of_code.jpg?w=500&#038;h=707" alt="" title="lines_of_code" width="500" height="707" class="aligncenter size-full wp-image-823" /></a></p>
Posted in fun  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/824/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/824/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/824/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/824/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/824/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/824/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/824/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/824/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/824/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/824/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=824&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/11/28/every-line-of-code-is-a-child-of-mine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://4loc.files.wordpress.com/2009/11/lines_of_code.jpg" medium="image">
			<media:title type="html">lines_of_code</media:title>
		</media:content>
	</item>
		<item>
		<title>C-Level Titles</title>
		<link>http://4loc.wordpress.com/2009/11/26/c-level-titles/</link>
		<comments>http://4loc.wordpress.com/2009/11/26/c-level-titles/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 22:00:01 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[dilbert]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=812</guid>
		<description><![CDATA[You have heard of CEOs (chief executive officer), CTOs (chief technical officer), and CIOs (chief information officer). C-Level titles for jobs with high salaries. Dilbert has some more: CJO (chief janitorial officer) ..

.. CPO (chief people officer) and CACCO (chief artificial coffee creamer officer) 

Posted in fun       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=812&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>You have heard of CEOs (chief executive officer), CTOs (chief technical officer), and CIOs (chief information officer). C-Level titles for jobs with high salaries. Dilbert has some more: CJO (chief janitorial officer) ..</p>
<p><a href="http://dilbert.com/strips/comic/2009-11-20/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/70000/4000/100/74151/74151.strip.gif" border="0" alt="Dilbert.com" width="510" /></a></p>
<p>.. CPO (chief people officer) and CACCO (chief artificial coffee creamer officer) </p>
<p><a href="http://dilbert.com/strips/comic/2009-11-21/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/70000/4000/100/74152/74152.strip.gif" border="0" alt="Dilbert.com" width="510" /></a></p>
Posted in fun  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/812/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=812&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/11/26/c-level-titles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/70000/4000/100/74151/74151.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/70000/4000/100/74152/74152.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Ctrl-Alt-Del in Linux</title>
		<link>http://4loc.wordpress.com/2009/11/19/ctrl-alt-del-in-linux/</link>
		<comments>http://4loc.wordpress.com/2009/11/19/ctrl-alt-del-in-linux/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 22:17:03 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lolcats]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=795</guid>
		<description><![CDATA[Have you ever wondered what the Linux equivalent of CTRL-ALT-DEL in Windows is? Many Linux fans say in Linux an application cannot bring down the whole system. Well, it can. It happens rarely, but it does happen. Here is what you can do for example in Ubuntu, which uses Gnome:

With Ctrl-Alt-BackSpace you can kill the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=795&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Have you ever wondered what the Linux equivalent of CTRL-ALT-DEL in Windows is? Many Linux fans say in Linux an application cannot bring down the whole system. Well, it can. It happens rarely, but it does happen. Here is what you can do for example in Ubuntu, which uses Gnome:</p>
<ul>
<li>With Ctrl-Alt-BackSpace you can kill the whole X-Server Window System (or your GUI session) and return to the login prompt.</li>
<li>If an app blocks the whole system, you can press Ctrl-Alt-F1 (or F2 through F6) to get a console and kill the evil process with <code>ps aux</code> or <code>ps -e | grep program_name</code> and <code>kill -9</code>. Finally go back to your display manager with ctl+alt+f7</li>
<li>In Gnome, you can add the System Monitor to the Panel. When you click on one of the monitors (for processor, memory, network or harddisk), a graphical list of processes opens, similar to the Task Manager in Windows, and you can stop processes through the context menu.</li>
<li>In Gnome you can also press Alt+F2, type in xkill, press enter, and kill the non-responding application. KDE is still different..</li>
</ul>
<p>Is this so much better than the famous Ctrl-Alt-Del in Windows? I am not sure.. Anyway, it looks like this is a very operating system specific feature. For Mac OS X, there is no ALT key, but you have an option key instead and two Command or Apple keys. Option-Command-Esc brings up a force-quit menu. You can also open the activity monitor (by opening Spotlight with the shortcut Command-spacebar and typing &#8220;act&#8221;). </p>
<p><a href="http://icanhascheezburger.com/2008/08/27/funny-pictures-alt-then-deleet/"><img class="mine_1212071" src="http://icanhascheezburger.files.wordpress.com/2008/08/funny-pictures-cats-try-to-restart-computer.jpg" alt="cat" /></a><br />
see more <a href="http://icanhascheezburger.com">Lolcats and funny pictures</a></p>
Posted in software  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/795/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/795/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/795/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=795&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/11/19/ctrl-alt-del-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://icanhascheezburger.files.wordpress.com/2008/08/funny-pictures-cats-try-to-restart-computer.jpg" medium="image">
			<media:title type="html">cat</media:title>
		</media:content>
	</item>
		<item>
		<title>Problems are opportunities</title>
		<link>http://4loc.wordpress.com/2009/11/11/problems-are-opportunities/</link>
		<comments>http://4loc.wordpress.com/2009/11/11/problems-are-opportunities/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 20:08:58 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[dilbert]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=783</guid>
		<description><![CDATA[
Posted in fun       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=783&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://dilbert.com/strips/comic/2009-09-24/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/60000/8000/600/68622/68622.strip.gif" border="0" alt="Dilbert.com" width="510" /></a></p>
Posted in fun  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/783/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/783/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/783/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=783&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/11/11/problems-are-opportunities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/60000/8000/600/68622/68622.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Continuous Integration and Agile Development</title>
		<link>http://4loc.wordpress.com/2009/11/11/continuous-integration-and-agile-development/</link>
		<comments>http://4loc.wordpress.com/2009/11/11/continuous-integration-and-agile-development/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:30:50 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[analogies]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=778</guid>
		<description><![CDATA[Did you notice that Continuous Integration and Agile Development are similar? The principle of continuous integration means that members of a team integrate their work frequently, because merging is much easier to do frequently and small rather than rarely and large. Agile development means iterative development with many feedback rounds between customer and developer. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=778&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Did you notice that <a href="http://martinfowler.com/articles/continuousIntegration.html">Continuous Integration</a> and <a href="http://martinfowler.com/articles/newMethodology.html">Agile Development</a> are similar? The principle of continuous integration means that members of a team integrate their work frequently, because merging is much easier to do frequently and small rather than rarely and large. Agile development means iterative development with many feedback rounds between customer and developer. The common thread is that frequent interaction reduces conflicts and prevents that things diverge too much from each other:</p>
<ul>
<li> frequent integration through merging avoids in <strong>Continuous Integration</strong> that different branches diverge too much from each other</li>
<li>frequent feedback rounds and iterations in <strong>Agile Development</strong> avoid that expectation from the customer, specification from product manager and real product from developer diverge too much from each other</li>
</ul>
Posted in analogies, development, software  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/778/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/778/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/778/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=778&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/11/11/continuous-integration-and-agile-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>
	</item>
		<item>
		<title>Could not connect to webserver</title>
		<link>http://4loc.wordpress.com/2009/11/11/could-not-connect-to-webserver/</link>
		<comments>http://4loc.wordpress.com/2009/11/11/could-not-connect-to-webserver/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:24:42 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=772</guid>
		<description><![CDATA[Powerful IDEs such as Eclipse or NetBeans are useful even for dynamic languages as Ruby, which don&#8217;t need to be compiled like Java or .NET applications. They offer all necessary functionalities, syntax highlighting, and debugging possibilities. Yet they also have drawbacks, sometimes they are quite slow: Eclipse seems to be very slow at large CSS [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=772&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Powerful IDEs such as Eclipse or NetBeans are useful even for dynamic languages as Ruby, which don&#8217;t need to be compiled like Java or .NET applications. They offer all necessary functionalities, syntax highlighting, and debugging possibilities. Yet they also have drawbacks, sometimes they are quite slow: Eclipse seems to be very slow at large CSS files, while NetBeans constantly tries to scan all your projects. And sometimes their behavior is difficult to understand. For example, if you get the error message &#8220;Could not connect to webserver&#8221; in a NetBeans RubyOnRails project, then you might have a faulty plugin or gem. This is possible if you just have modified or edited it. Then you have to restart the server, and this does not work if you have introduced a fatal error. If the Rails application can not be started, then NetBeans does not display the correct error message. It simply says &#8220;Could not connect to webserver&#8221;.  The reason can also be a missing or faulty gem which is required for your application, for example a broken rmagick gem after an OS update of Linux. In this case, examine the log in the output window (which can be opened in NetBeans with Ctrl-4) and install the required gem.</p>
Posted in development  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/772/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/772/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/772/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/772/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/772/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/772/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/772/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/772/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/772/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/772/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=772&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/11/11/could-not-connect-to-webserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>
	</item>
		<item>
		<title>72 Virgins</title>
		<link>http://4loc.wordpress.com/2009/10/20/72-virgins/</link>
		<comments>http://4loc.wordpress.com/2009/10/20/72-virgins/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 19:12:24 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=765</guid>
		<description><![CDATA[Sometimes things are not always what they seem..

Posted in Uncategorized       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=765&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes things are not always what they seem..<br />
<img src="http://4loc.files.wordpress.com/2009/10/virgins.jpg?w=450&#038;h=337" alt="virgins" title="virgins" width="450" height="337" class="alignleft size-full wp-image-764" /></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/765/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/765/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/765/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/765/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/765/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/765/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/765/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/765/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/765/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/765/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=765&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/10/20/72-virgins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://4loc.files.wordpress.com/2009/10/virgins.jpg" medium="image">
			<media:title type="html">virgins</media:title>
		</media:content>
	</item>
		<item>
		<title>Lines of Code</title>
		<link>http://4loc.wordpress.com/2009/08/24/lines-of-code/</link>
		<comments>http://4loc.wordpress.com/2009/08/24/lines-of-code/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:33:49 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[principles]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[loc]]></category>
		<category><![CDATA[magnitude]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=746</guid>
		<description><![CDATA[Shakespeare&#8217;s sonnets have exactly 14 lines, his plays have usually around 2600 lines (Hamlet about 4000 lines). This is not that different from the few thousand lines of code a typical programmer writes for a unit, library or project, for example jQuery 1.2 and 1.3 have around 4000 LoC (jQuery 1.2.6: 3549 LoC, jQuery 1.3.2: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=746&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Shakespeare&#8217;s sonnets have exactly 14 lines, his plays have usually around 2600 lines (Hamlet about 4000 lines). This is not that different from the few thousand lines of code a typical programmer writes for a unit, library or project, for example jQuery 1.2 and 1.3 have around 4000 LoC (jQuery 1.2.6: 3549 LoC, jQuery 1.3.2: 4376 LoC). It is well-known that progress and productivity cannot be measure in lines of code. Yet the order of magnitude is often quite similar in completely different projects and environments, because there is a limit what people can handle and produce.</p>
<p>The order of magnitude for the typical lines of code is as follows. A <strong>single programmer working a few days</strong> will usually produce some functions, methods and classes more or less rapidly, depending on his experience. If he is working a few months he will produce typically a few thousands lines of code. This is an amount a single person can still understand well, and it can still be customized and changed easily:</p>
<ul>
<li> function/method: 10 = 10^1 LoC/Method</li>
<li>class: 100 = 10^2 LoC/Class</li>
<li>library or small project: 1000 = 10^3 LoC/Project</li>
</ul>
<p>A <strong>few programmers together working a few months</strong> will produce about 10^4 lines of code. This is an order of magnitude where it is becoming difficult for a single developer to understand and comprehend the complete code base if it is not well structured. According to <a href="http://www.loudthinking.com/posts/33-myth-4-rails-is-a-monolith">DHH</a>, Rails on Rails 2.3 has currently about 35.000 LoC (without tests and comments). A large framework requires about 10^5 lines of code. A complete operating system belongs to the largest software projects, it requires about 10^6 &#8211; 10^7 lines of code, Microsoft Windows 2000, Windows XP and early Debian Versions for example <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">are said</a> to have around 50.000.000 lines of code or ~5GB of data:</p>
<ul>
<li> a small framework or large application: 10.000 = 10^4 LoC/Framework</li>
<li>ide/framework: 100.000 = 10^5 LoC/Framework</li>
<li>operating system: 10.000.000 = 10^7 LoC/OS</li>
</ul>
<p>For comparison only, a human has around 30,000 genes (~3.1B base pairs ~ 1.5GB). Modern versions of Debian Linux have up to 280.000.000 lines of code, see <a href="http://en.wikipedia.org/wiki/Source_lines_of_code">here</a>. This is a tremendous amount of code which a single programmer can hardly handle anymore.</p>
Posted in development, principles, software  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/746/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=746&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/08/24/lines-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>
	</item>
		<item>
		<title>Longing for World Domination</title>
		<link>http://4loc.wordpress.com/2009/08/23/longing-for-world-domination/</link>
		<comments>http://4loc.wordpress.com/2009/08/23/longing-for-world-domination/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 09:23:09 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[analogies]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[principles]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[frustration]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[world domination]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=722</guid>
		<description><![CDATA[As a computer programmer or software developer, you long each day for world domination. To be precise, you stagger constantly between world domination (in German &#8220;Weltherrschaft&#8221;) and total powerlessness, between absolute might and complete plight, between omnipotence and complete impotence. One day you feel like a mighty emperor, and the next day you feel like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=722&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignleft size-medium wp-image-723" title="spqr" src="http://4loc.files.wordpress.com/2009/08/spqr.jpg?w=164&#038;h=265" alt="spqr" width="164" height="265" />As a computer programmer or software developer, you long each day for <strong>world domination</strong>. To be precise, you stagger constantly between world domination (in German &#8220;Weltherrschaft&#8221;) and total powerlessness, between absolute might and complete plight, between omnipotence and complete impotence. One day you feel like a mighty emperor, and the next day you feel like a powerless subject. Here&#8217;s why:</p>
<p>In the world of your own software, you are the lawgiver with absolute power and undisputed authority. This means world domination: everything follows your command without the slightest kind of opposition or resistance. The programmer determines in detail what every object, every class and every function should do, step by step, in every possible situation and in every possible context.</p>
<blockquote><p>“The computer programmer is a creator of universes for which he alone is the lawgiver&#8230;No playwright, no stage director, no emperor, however powerful, has ever exercised such absolute authority to arrange a stage or a field of battle and to command such unswervingly dutiful actors or troops.”<br />
(Joseph Weizenbaum)</p></blockquote>
<p>The programmer and developer is the ultimate commander. Ideally he can create a whole application with only a few lines of code, he can create worlds with his fingertips. That&#8217;s the fun part. Yet despite all this power, and no matter how smart you are, as a programmer you will typically trying to understand what is going on most of the time. The problem is you usually use a lot of code from others &#8211; plugins, modules, units, libraries, frameworks &#8211; which you do not and can not understand completely. Even your own legacy code from the past is sometimes difficult to understand. Debugging foreign code is like walking around in a foreign city without a map. You don&#8217;t know how everything is connected, where the center is, or where everything leads to.</p>
<p>And there are always bugs around the corner waiting to be solved. Bugs belong to software like explosions to rockets. Rockets are based on controlled gas flow which results in explosions. Software is based on controlled program flow which results in features and bugs: there is saying that &#8220;the only difference between a bug and a feature is the documentation.&#8221; If debugging is the process of removing software bugs, then programming must be the process of putting them in.</p>
<p>Because there are always code parts which he doesn&#8217;t understand or bugs which he is trying to solve, a programmer gets often completely stuck, and falls into total powerlessness, until he is able to find out what happened. For a programmer, it is extremely important to find out what happened: either by examining existing or newly created log files, or by debugging (that is by stepping through the code bit by bit). Once a bug has been identified and located by logging and debugging the code, it is often easy to remove it, and the programmer is ready to dominate the world again. </p>
<p>This is why programmers stagger constantly between world domination and total powerlessness. Programming is 20% world domination and 80% frustration. Unfortunately, the frustrating times prevail, but the world domination times compensate for everything.</p>
<p>(<em>The <a href="http://www.flickr.com/photos/tonetefoto/3416365358/">Flickr photo</a> is from the user <a href="http://www.flickr.com/photos/tonetefoto/">Toni Villen</a></em>)</p>
Posted in analogies, development, principles, software  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/722/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/722/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/722/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=722&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/08/23/longing-for-world-domination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://4loc.files.wordpress.com/2009/08/spqr.jpg?w=184" medium="image">
			<media:title type="html">spqr</media:title>
		</media:content>
	</item>
		<item>
		<title>Holidays</title>
		<link>http://4loc.wordpress.com/2009/06/28/holidays/</link>
		<comments>http://4loc.wordpress.com/2009/06/28/holidays/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 17:18:43 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=713</guid>
		<description><![CDATA[I am on holiday for the next weeks


Posted in Uncategorized       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=713&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I am <a href="http://www.myvideo.de/watch/2911455/hummel_und_bier">on holiday</a> for the next weeks</p>
<p style="float:left;">
<span style="text-align:center; display: block;"><a href="http://4loc.wordpress.com/2009/06/28/holidays/"><img src="http://img.youtube.com/vi/pusPxN_7mm8/2.jpg" alt="" /></a></span></p>
Posted in Uncategorized  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/713/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/713/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/713/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=713&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/06/28/holidays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/pusPxN_7mm8/2.jpg" medium="image" />
	</item>
		<item>
		<title>Charts and Graphics</title>
		<link>http://4loc.wordpress.com/2009/06/11/charts-and-graphics/</link>
		<comments>http://4loc.wordpress.com/2009/06/11/charts-and-graphics/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 20:35:33 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[dilbert]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[graphics]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=710</guid>
		<description><![CDATA[We know that a picture is worth a thousand words. A few charts can indeed improve any application and presentation..

..sometimes it works too well:

Posted in fun       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=710&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We know that a picture is worth a thousand words. A few charts can indeed improve any application and presentation..</p>
<p><a href="http://dilbert.com/strips/comic/2009-03-07/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/40000/3000/500/43544/43544.strip.gif" border="0" alt="Dilbert.com" width="510" /></a></p>
<p>..sometimes it works too well:</p>
<p><a href="http://dilbert.com/strips/comic/2009-03-09/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/40000/4000/400/44411/44411.strip.gif" border="0" alt="Dilbert.com" width="510" /></a></p>
Posted in fun  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/710/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/710/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/710/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=710&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/06/11/charts-and-graphics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/40000/3000/500/43544/43544.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/40000/4000/400/44411/44411.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Object matching in Ruby</title>
		<link>http://4loc.wordpress.com/2009/06/11/object-matching-in-ruby/</link>
		<comments>http://4loc.wordpress.com/2009/06/11/object-matching-in-ruby/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 20:25:54 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[matching]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=699</guid>
		<description><![CDATA[Often one must traverse a list or array of items to find and return the first instance with a certain property, attribute or id. For pattern matching in strings or texts, one would use regular expressions. For object matching in lists or arrays, usually one would write a function like this:

result = nil
instances.each do &#124;instance&#124;
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=699&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Often one must traverse a list or array of items to find and return the first instance with a certain property, attribute or id. For pattern matching in strings or texts, one would use regular expressions. For object matching in lists or arrays, usually one would write a function like this:</p>
<pre class="brush: ruby;">
result = nil
instances.each do |instance|
  if instance.id == _id
    result = instance
    break
  end
end
</pre>
<p>With the <a href="http://www.ruby-doc.org/core/classes/Enumerable.html#M003154">detect method</a> of the Enumerable module in Ruby this is quite easy. It returns the first object for which the passed block is true, for example the first element which is divisible by 5 and 7:</p>
<pre class="brush: ruby;">
instances.detect{|instance| instance.id == _id}

(1..100).detect {|i| i % 5 == 0 and i % 7 == 0 }
=&gt; 35
</pre>
Posted in development, ruby  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/699/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/699/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/699/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=699&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/06/11/object-matching-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>
	</item>
		<item>
		<title>Error</title>
		<link>http://4loc.wordpress.com/2009/06/03/error/</link>
		<comments>http://4loc.wordpress.com/2009/06/03/error/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 18:24:47 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=692</guid>
		<description><![CDATA[From the Daily WTF:: an error in an error message:

this is also great: the word of the day

Posted in fun       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=692&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>From <a href="http://thedailywtf.com/Articles/10,-10,-or-15.aspx">the Daily WTF:</a>: an error in an error message:<br />
<img src="http://4loc.files.wordpress.com/2009/06/previouserror.png?w=410&#038;h=229" alt="previouserror" title="previouserror" width="410" height="229" class="aligncenter size-full wp-image-691" /></p>
<p>this is also great: the word of the day<br />
<img src="http://4loc.files.wordpress.com/2009/06/word-of-the-day.png?w=252&#038;h=232" alt="word-of-the-day" title="word-of-the-day" width="252" height="232" class="aligncenter size-full wp-image-694" /></p>
Posted in fun  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/692/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/692/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/692/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=692&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/06/03/error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://4loc.files.wordpress.com/2009/06/previouserror.png" medium="image">
			<media:title type="html">previouserror</media:title>
		</media:content>

		<media:content url="http://4loc.files.wordpress.com/2009/06/word-of-the-day.png" medium="image">
			<media:title type="html">word-of-the-day</media:title>
		</media:content>
	</item>
		<item>
		<title>Eval, module_eval, and instance_eval</title>
		<link>http://4loc.wordpress.com/2009/05/29/eval-module_eval-and-instance_eval/</link>
		<comments>http://4loc.wordpress.com/2009/05/29/eval-module_eval-and-instance_eval/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:43:51 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[eval]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=679</guid>
		<description><![CDATA[As a dynamic script language, Ruby provides a few different options to evaluate a string or a block of code: eval, class_eval, module_eval, and instance_eval. What is the difference between them? This article describes it well. The main different is the context: instance_eval evaluates in the context of a certain instance, module_eval (and class_eval) in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=679&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As a dynamic script language, Ruby provides a few different options to <a href="http://www.infoq.com/articles/eval-options-in-ruby">evaluate a string or a block of code</a>: eval, class_eval, module_eval, and instance_eval. What is the difference between them? This <a href="http://www.elctech.com/snippets/the-difference-between-eval-class_eval-module_eval-and-instance_eval">article</a> describes it well. The main different is the context: instance_eval evaluates in the context of a certain instance, module_eval (and class_eval) in the context of a class, and eval in the current context or the context of the given binding. </p>
<h2>instance_eval</h2>
<p><strong>Object.instance_eval</strong> evaluates a string (or the given block) within the context of a certain class instance and allows thus the direct access to class properties without attr or attr_accessor. It allows you to define new methods for a instance</p>
<pre class="brush: ruby;">
class Klass
  def initialize
    @secret = 99
  end
end
k = Klass.new
k.instance_eval(&quot;@secret&quot;)    # =&gt; &quot;99&quot;
k.instance_eval(&quot;@secret=42&quot;) # =&gt; &quot;42&quot;

k.instance_eval(&quot;def hi() \&quot;Hello there\&quot; end&quot;)
k.hi()  # =&gt; &quot;Hello there&quot;
</pre>
<h2> eval </h2>
<p><strong>Kernel.eval</strong> evaluates a string in the current context or the context of the given binding. It is the method used by IRB to process your input. It allows you to define new variables and methods for the current context.</p>
<pre class="brush: ruby;">
def secret(number)
  return binding
end
number = &quot;42&quot;
eval &quot;number&quot;                #=&gt; &quot;42&quot;
eval &quot;number&quot;, secret(&quot;99&quot;)  #=&gt; &quot;99&quot;

eval &quot;def hi() \&quot;Hello there\&quot; end&quot;
hi()  # =&gt; &quot;Hello there&quot;
</pre>
<h2> module_eval </h2>
<p>As the name says, <strong>Module.module_eval</strong> evaluates the string or block in the context of a module or class (Synonym: class_eval). module_eval allows you to define new instance method for a class.</p>
<pre class="brush: ruby;">
String.module_eval do
  def secret
    &quot;42&quot;
  end
end

&quot;string&quot;.secret    #=&gt; &quot;42&quot;
</pre>
Posted in development, ruby  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/679/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/679/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/679/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/679/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/679/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/679/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/679/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/679/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/679/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/679/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=679&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/05/29/eval-module_eval-and-instance_eval/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>
	</item>
		<item>
		<title>MBAs from Top Business Schools</title>
		<link>http://4loc.wordpress.com/2009/05/29/mbas-from-top-business-schools/</link>
		<comments>http://4loc.wordpress.com/2009/05/29/mbas-from-top-business-schools/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:10:42 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[dilbert]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[humor]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=674</guid>
		<description><![CDATA[Dilbert has got the point again, here is a nice cartoon about MBAs:

and a follow-up here

Posted in fun       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=674&subd=4loc&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Dilbert has got the point again, here is a nice <a href="http://dilbert.com/strips/comic/2009-05-18/">cartoon about MBAs</a>:<br />
<a href="http://dilbert.com/strips/comic/2009-05-18/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/50000/4000/500/54565/54565.strip.gif" border="0" width="510" alt="Dilbert.com" /></a></p>
<p>and a follow-up <a href="http://dilbert.com/strips/comic/2009-05-19/">here</a><br />
<a href="http://dilbert.com/strips/comic/2009-05-19/" title="Dilbert.com"><img src="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/50000/4000/500/54566/54566.strip.gif" border="0" width="510" alt="Dilbert.com" /></a></p>
Posted in fun  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/674/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/674/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/674/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&blog=4732228&post=674&subd=4loc&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2009/05/29/mbas-from-top-business-schools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0fd9c0c07d7161defee1f25b6b46b20b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">0x4a6f4672</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/50000/4000/500/54565/54565.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>

		<media:content url="http://dilbert.com/dyn/str_strip/000000000/00000000/0000000/000000/50000/4000/500/54566/54566.strip.gif" medium="image">
			<media:title type="html">Dilbert.com</media:title>
		</media:content>
	</item>
	</channel>
</rss>