<?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>Tue, 17 Jan 2012 21:26:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='4loc.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>4 Lines of Code</title>
		<link>http://4loc.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://4loc.wordpress.com/osd.xml" title="4 Lines of Code" />
	<atom:link rel='hub' href='http://4loc.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Programming together</title>
		<link>http://4loc.wordpress.com/2012/01/17/programming-together/</link>
		<comments>http://4loc.wordpress.com/2012/01/17/programming-together/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 21:25:33 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[analogies]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1386</guid>
		<description><![CDATA[Programming together in a group is a bit like living together in the same house or sharing the same apartment. It can be fun if all work together. It can be frustrating and annoying, too. Others will get upset if you don&#8217;t clean up the kitchen (and do not leave clean code), mess things up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1386&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://4loc.files.wordpress.com/2012/01/1483155938_f65dee08b2_z.jpg"><img src="http://4loc.files.wordpress.com/2012/01/1483155938_f65dee08b2_z.jpg?w=300&#038;h=225" alt="" title="1483155938_f65dee08b2_z" width="300" height="225" class="alignleft size-medium wp-image-1393" /></a>Programming together in a group is a bit like living together in the same house or sharing the same apartment. It can be fun if all work together. It can be frustrating and annoying, too. Others will get upset if you don&#8217;t clean up the kitchen (and do not leave <a href="http://4loc.wordpress.com/2009/04/14/clean-software/">clean code</a>), mess things up or if you change their things. It works best if everyone owns his own space, i.e. everyone has his own room(s), owned only by himself, where the others are not allowed to change things. If you are lucky, then the others may show you their rooms occasionally. Some shared regions like the main entrance, can be public, though. Basically, programming well with others is difficult, just like living together, because likes, tastes and preferences vary. </p>
<p><em>(The picture is from Flickr user <a href="http://www.flickr.com/photos/70672543@N00/">Annette Bouvain</a>  and shows a <a href="http://www.flickr.com/photos/70672543@N00/1483155938/">flat share</a></em>)</p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/analogies/'>analogies</a>, <a href='http://4loc.wordpress.com/category/development/'>development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1386/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1386/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1386/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1386&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2012/01/17/programming-together/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/2012/01/1483155938_f65dee08b2_z.jpg?w=300" medium="image">
			<media:title type="html">1483155938_f65dee08b2_z</media:title>
		</media:content>
	</item>
		<item>
		<title>A minimum number of chips and code</title>
		<link>http://4loc.wordpress.com/2011/12/31/a-minimum-number-of-chips-and-code/</link>
		<comments>http://4loc.wordpress.com/2011/12/31/a-minimum-number-of-chips-and-code/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 12:57:14 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1375</guid>
		<description><![CDATA[Good hardware engineers like the legendary Steve Wozniak make designs which have a minimum number of chips. They try to design a simple minimum-chip circuit, because in hardware design a minimal number of chips means to minimize the cost. Good software engineers make code which have a minimum number of lines. They try to design [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1375&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://4loc.files.wordpress.com/2011/12/2680667779_5c72de38b1_z.jpg"><img src="http://4loc.files.wordpress.com/2011/12/2680667779_5c72de38b1_z.jpg?w=300&#038;h=225" alt="" title="2680667779_5c72de38b1_z" width="300" height="225" class="alignleft size-medium wp-image-1380" /></a>Good <strong>hardware </strong>engineers like the legendary Steve Wozniak make designs which have a minimum number of chips. They try to design a simple minimum-chip circuit, because in hardware design a minimal number of chips means to minimize the cost. </p>
<p>Good <strong>software </strong>engineers make code which have a minimum number of lines. They try to design a simple minimum-code program, because in software design a minimal number of lines means to minimize the complexity. Less code means less effort to understand it, less trouble while maintaining it, and less hassle in changing it. </p>
<p>Thus in general, less items in engineering means less cost and less complexity. A minimum number of items, whether chips or lines of code, is important to achieve simplicity and the KISS principle. The <a href="http://en.wikipedia.org/wiki/KISS_principle">KISS principle</a> states that most systems work best if they are kept simple rather than made complex, therefore simplicity should be a key goal in design and unnecessary complexity should be avoided.</p>
<p><em>(the image from Flickr User <a href="http://www.flickr.com/photos/richevenhouse/">Fellowship of the Rich</a> shows an <a href="http://www.flickr.com/photos/38101026@N00/2680668251/">Apple motherboard</a>)</em></p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/general/'>general</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1375/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1375/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1375/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1375&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/12/31/a-minimum-number-of-chips-and-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>

		<media:content url="http://4loc.files.wordpress.com/2011/12/2680667779_5c72de38b1_z.jpg?w=300" medium="image">
			<media:title type="html">2680667779_5c72de38b1_z</media:title>
		</media:content>
	</item>
		<item>
		<title>Social networks are like expanding universes</title>
		<link>http://4loc.wordpress.com/2011/12/30/social-networks-are-like-expanding-universes/</link>
		<comments>http://4loc.wordpress.com/2011/12/30/social-networks-are-like-expanding-universes/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 12:51:00 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[analogies]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[social network]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1362</guid>
		<description><![CDATA[The universe is not static, it is expanding ever since the Big Bang 13.7 billion years ago. It contains billions and billions of stars and galaxies, and it is getting bigger all the time. Social networks like Google+, Twitter, or Facebook are similar. They do not only contain billions and billions of users and pages, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1362&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://4loc.files.wordpress.com/2011/12/640px-wmap_2010.png"><img class="alignleft size-medium wp-image-1364" title="640px-WMAP_2010" src="http://4loc.files.wordpress.com/2011/12/640px-wmap_2010.png?w=300&#038;h=150" alt="" width="300" height="150" /></a>The universe is not static, it is expanding ever since the Big Bang 13.7 billion years ago. It contains billions and billions of stars and galaxies, and it is getting bigger all the time.</p>
<p>Social networks like Google+, Twitter, or Facebook are similar. They do not only contain billions and billions of users and pages, they are also getting bigger all the time. Each day, more users join, and existing users add more content: they add more photos, share more links, and write more posts.</p>
<p>This is the major challenge in the engineering of social networks: <strong>to handle a system which is getting bigger all the time</strong>. An engineer of such a network is like a cook whose pots are constantly boiling over. He must add more pots each day, and keep the old still cooking.</p>
<p>Facebook was founded in 2004, and it was expanding ever since, gaining more users and more friends each day. Since it does not allow users to quit, and does not delete old content, it grows more and more each day. Twitter was founded in march 2006, and it was expanding ever since that time, too. Each day more users join, existing users gain more followers, and create more tweets. The latest and most advanced social network is Google+, which was started in July 2011 and combines the best features of Facebook and Twitter. It is growing at an ever accelerating rate, too.</p>
<p>The fundamental problem for the engineer is clear: a system which is getting bigger all the time is hard to handle, because it requires nearly unlimited scalability. If the engineers do not consider this from the start, it will be hard to build it later. Apparently, Google has the best prerequisites to master this challenge, it knows how to build scalable systems better than any other company. Some websites say <a href="http://highscalability.com/google-architecture">Google is the King of scalability</a>.</p>
<p><em>(The picture of the <a href="http://en.wikipedia.org/wiki/Accelerating_universe">accelerating universe</a> is from Wikipedia)</em></p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/analogies/'>analogies</a>, <a href='http://4loc.wordpress.com/category/development/'>development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1362&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/12/30/social-networks-are-like-expanding-universes/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/2011/12/640px-wmap_2010.png?w=300" medium="image">
			<media:title type="html">640px-WMAP_2010</media:title>
		</media:content>
	</item>
		<item>
		<title>Programming well with others</title>
		<link>http://4loc.wordpress.com/2011/11/06/programming-well-with-others/</link>
		<comments>http://4loc.wordpress.com/2011/11/06/programming-well-with-others/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 11:05:33 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[ownership]]></category>
		<category><![CDATA[team]]></category>
		<category><![CDATA[teamwork]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1317</guid>
		<description><![CDATA[Recently there was a post at the 37signals blog Signal vs. Noise about the question why programs become territorial. The reason is simple: Programs become territorial because programmers naturally consider their code as their territory. Your code is your work and your creation based on your ideas, right? Therefore as a programmer it is natural [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1317&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently there was a post at the 37signals blog <a href="http://37signals.com/svn">Signal vs. Noise</a> about the question <a href="http://37signals.com/svn/posts/3023-why-programs-become-territorial">why programs become territorial</a>. The reason is simple: Programs become territorial because programmers naturally consider their code as their territory. Your code is your work and your creation based on your ideas, right? Therefore as a programmer it is natural to think that your code belongs to you. It is the world you have created. And in his own world the <a href="http://4loc.wordpress.com/2010/11/16/programmers-are-like-little-gods/">programmer is a little god</a> who knows everything, while everyone else is a mere mortal without superpowers. The own world contains only cities and places the programmer has built himself &#8211; so the programmer is the creator, architect, ruler, general, and governor all in one. A programmer which tries to understand the code from someone else has not only lost his superpowers, he is completely lost. It is a bit like being a tourist in a foreign city &#8211; you will feel lost in the beginning. Maps in form of database diagrams and UML models help to a certain degree, but even with a map it remains difficult to understand a foreign territory.</p>
<p>Software engineers tend to own their creations. It goes well in two cases: if everybody knows and owns his own part, i.e. if everybody has his own territory, or &#8211; if if the territory belongs to the team.  This means everybody knows and can change everything, everything is well documented and the team agrees on certain coding standards, policies and guidelines. Unfortunately, working in a team is not easy, because it is difficult to create useful documentation, and programmers do not like giving up their freedom. They like their superpowers. Developers want autonomy, mastery and purpose. Working in a team is difficult, because it means to have a team ego instead of an individual ego. Agreeing on standards does not mean that everyone in the team has to accept tools, libraries and plugins <strong>you</strong> prefer, rather it means to accept things others prefer more than you, and to abandon personal habits and likes. This is not easy, because programmers are often very opinionated. So the two extremes that work are:</p>
<ul>
<li>The <strong>individual</strong> rules: team has no strong ego, territory belongs to the individual</li>
<li>The <strong>team</strong> rules: individuals give up their ego, territory belongs to the team </li>
</ul>
<p>Between those extremes it gets complicated. Code changes can lead easily to personal conflicts if code is owned by people. Therefore developers tend to avoid changing the code from others. <strong>Programming well with others is difficult</strong>. It certainly requires good communication. Most programmers know how to communicate, but they don&#8217;t want to. They want to do it themselves, and they see others as competitors. It takes indeed a bit the fun out of programming if you have to justify and explain every decision to others. To find the right <a href="http://4loc.wordpress.com/2009/01/08/a-number-of-issues/">balance between cooperation and competition</a> in a team is not easy. In general, <a href="http://en.wikipedia.org/wiki/The_Golden_Rule">the golden rule</a> helps: One should treat others as one would like others to treat oneself. Do not ignore them, ask others for their opinion, show them your respect, include them in important decisions, explain your architecture, show them your achievements etc. Communication is the glue that keeps groups together. This is the reason why most programmers have difficulties when it comes to programming well with others. They lack social skills, and the only languages they really like are programming languages. They are used to work with machines and not with people. </p>
<p><a href="https://plus.google.com/113939332173985992126">Ben Collins-Sussman</a> and <a href="https://plus.google.com/101174951617223562800">Brian Fitzpatrick</a> give us some hints how to program well with others. Documentation is important: document your design decisions, your architecture, your goals, your failures, for example on an easy editable Wiki. <a href="http://4loc.wordpress.com/2010/01/31/the-google-generation/">The ability to communicate</a> is also an important aspect. They argue in this video (and their forthcoming book with the same title) that collaborating and communicating with others is at least as important as having great technical skills. According to Ben and Fitz, the right attitude is important in a team. You should be thinking about &#8220;how do I work with a team&#8221; and not &#8220;how do I present myself as a genius&#8221;</p>
<span style="text-align:center; display: block;"><a href="http://4loc.wordpress.com/2011/11/06/programming-well-with-others/"><img src="http://img.youtube.com/vi/q-7l8cnpI4k/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1317&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/11/06/programming-well-with-others/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>Programming Blogs</title>
		<link>http://4loc.wordpress.com/2011/10/18/programming-blogs/</link>
		<comments>http://4loc.wordpress.com/2011/10/18/programming-blogs/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 21:16:36 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1310</guid>
		<description><![CDATA[Hacker news has an interesting list of programming blogs which you should read daily. The blogs from John Resig, Jeff Atwood, James Hamilton, and Joel Spolsky are certainly good. And guess what? Someone even mentioned this humble blog. What programming blogs do you prefer to read? Filed under: development<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1310&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hacker news has an interesting list of <a href="http://news.ycombinator.com/item?id=3120380">programming blogs which you should read dail</a>y. The blogs from <a href="http://ejohn.org/category/blog/">John Resig</a>, <a href="http://www.codinghorror.com">Jeff Atwood</a>, <a href="http://perspectives.mvdirona.com/">James Hamilton</a>, and <a href="http://www.joelonsoftware.com/">Joel Spolsky</a> are certainly good. And guess what? Someone even mentioned this humble blog. What programming blogs do you prefer to read?</p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1310&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/10/18/programming-blogs/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>Steve Wozniak about Engineers</title>
		<link>http://4loc.wordpress.com/2011/10/09/steve-wozniak-about-engineers/</link>
		<comments>http://4loc.wordpress.com/2011/10/09/steve-wozniak-about-engineers/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 19:55:37 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[engineering]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1304</guid>
		<description><![CDATA[In a recent Google+ comment, Steve Wozniak wrote: I&#8217;ll always be for the poor engineers. They have so much skill and experience but get paid very little. They design the products that change the world but those who write stories about them get paid more. But the thrill of making things yourself is just too [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1304&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a recent <a href="https://plus.google.com/102509936935617434280/posts/1qJtVvcaDUn">Google+ comment</a>, Steve Wozniak wrote:</p>
<blockquote><p>I&#8217;ll always be for the poor engineers. They have so much skill and experience but get paid very little. They design the products that change the world but those who write stories about them get paid more. But <strong>the thrill of making things yourself is just too strong for real engineers to give up</strong>.</p></blockquote>
<p>How true!</p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1304/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1304&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/10/09/steve-wozniak-about-engineers/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>Aircraft-carrier of Authentication</title>
		<link>http://4loc.wordpress.com/2011/10/09/aircraft-carrier-of-authentication/</link>
		<comments>http://4loc.wordpress.com/2011/10/09/aircraft-carrier-of-authentication/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 08:06:19 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[analogies]]></category>
		<category><![CDATA[general]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[SSO]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1290</guid>
		<description><![CDATA[Normal applications are usually protected by authentication modules or plugins. Like warships they protect the application against hostile intruders and regulate who is allowed to get in. In Ruby on Rails one would use RestfulAuthentication or AuthLogic for this purpose. They are powerful and easy to configure, and they provide enough protection for a whole [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1290&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://4loc.files.wordpress.com/2011/10/800px-uss_nimitz_in_victoria_canada_036.jpg"><img src="http://4loc.files.wordpress.com/2011/10/800px-uss_nimitz_in_victoria_canada_036.jpg?w=300&#038;h=198" alt="" title="800px-USS_Nimitz_in_Victoria_Canada_036" width="300" height="198" class="alignleft size-medium wp-image-1291" /></a></p>
<p>Normal applications are usually protected by <a href="https://www.ruby-toolbox.com/categories/rails_authentication">authentication modules or plugins</a>. Like warships they protect the application against hostile intruders and regulate who is allowed to get in. In Ruby on Rails one would use RestfulAuthentication or AuthLogic for this purpose. They are powerful and easy to configure, and they provide enough protection for a whole application. Once they are adapted to the application and are able to communicate with it, they work fine. </p>
<p>Big <a href="http://en.wikipedia.org/wiki/Single_sign-on">Single Sign-On</a> (SSO) Servers are different. Instead of adapting them to your application, you must adapt your application to them. If normal authentication plugins are like warships, then Single Sign-On (SSO) Servers like <a href="http://shibboleth.internet2.edu/">Shibboleth</a> and <a href="http://forgerock.com/openam.html">OpenAM</a> are like <strong>aircraft-carriers of authentication</strong>. They are very powerful, and can protect multiple applications, but they are also very huge, heavy and expensive, because they are complicated to configure and to maintain. They are accompanied by multiple other units, for instance web policy agents (which correspond to airplanes). They operate with highest security measures like <a href="http://de.wikipedia.org/wiki/Security_Assertion_Markup_Language">SAML</a>. They are powerful weapons once they are configured, delivered and deployed. Unfortunately, it often takes a while until they are ready. </p>
<p><em>(The picture is from Wikipedia and shows the <a href="http://en.wikipedia.org/wiki/File:USS_Nimitz_in_Victoria_Canada_036.jpg">USS Nimitz</a>)</em></p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/analogies/'>analogies</a>, <a href='http://4loc.wordpress.com/category/general/'>general</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1290&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/10/09/aircraft-carrier-of-authentication/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/2011/10/800px-uss_nimitz_in_victoria_canada_036.jpg?w=300" medium="image">
			<media:title type="html">800px-USS_Nimitz_in_Victoria_Canada_036</media:title>
		</media:content>
	</item>
		<item>
		<title>Stephen Wolfram: The idea of computation</title>
		<link>http://4loc.wordpress.com/2011/10/01/stephen-wolfram-the-idea-of-computation/</link>
		<comments>http://4loc.wordpress.com/2011/10/01/stephen-wolfram-the-idea-of-computation/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 06:59:32 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[principles]]></category>
		<category><![CDATA[computation]]></category>
		<category><![CDATA[programs]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1281</guid>
		<description><![CDATA[Stephen Wolfram about the idea of computation, the foundation of science and the limits of technology Filed under: principles<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1281&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Stephen Wolfram about the idea of computation, the foundation of science and the limits of technology</p>
<span style="text-align:center; display: block;"><a href="http://4loc.wordpress.com/2011/10/01/stephen-wolfram-the-idea-of-computation/"><img src="http://img.youtube.com/vi/60P7717-XOQ/2.jpg" alt="" /></a></span>
<br />Filed under: <a href='http://4loc.wordpress.com/category/principles/'>principles</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1281/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1281&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/10/01/stephen-wolfram-the-idea-of-computation/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>Marketing vs. Engineering</title>
		<link>http://4loc.wordpress.com/2011/09/09/marketing-vs-engineering/</link>
		<comments>http://4loc.wordpress.com/2011/09/09/marketing-vs-engineering/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 05:05:00 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[principles]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1265</guid>
		<description><![CDATA[Marketing and engineering are two completely different worlds. Engineers sometimes despise marketing people because they think the other side does not produce anything valuable. Marketing people sometimes despise engineers because they think the other side does not care about the real valuable things: money, good looks or agreeable appearance. Yet both worlds can complement each [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1265&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Marketing and engineering are two completely different worlds. Engineers sometimes despise marketing people because they think the other side does not produce anything valuable. Marketing people sometimes despise engineers because they think the other side does not care about the real valuable things: money, good looks or agreeable appearance. Yet both worlds can complement each other well. People in engineering know how to produce something, but often they do not how to sell it. People in marketing know how to sell something, but they do not know how to produce it.</p>
<p><strong>Marketing</strong> is <strong>social</strong>, it is about convincing people. Nelson Mandela said: “Don’t talk to their minds; talk to their hearts.” You convince people by arousing their interests and emotions. You need psychological knowledge to persuade and convince people. Often you need to distort the facts and the truth to convince people to buy something.</p>
<p><strong>Engineering</strong> is not very social, it is <strong>technical</strong>. It is about convincing machines to do the right thing. Machines and people are different, you control machines by giving them exactly the right instructions and commands. You need technological knowledge to do this. You need to stick to the facts and the truth if you want to find out what happens in a machine.</p>
<p><strong>In Marketing &#8230;</strong></p>
<ul>
<li>markets rule the world</li>
<li>appearance matters, beautiful people are common</li>
<li>arousing emotions is important</li>
<li>psychological knowledge is required</li>
<li>persuasion and manipulation of people is necessary</li>
<li>everything is based on untruth, illusions, distortion of facts</li>
<li>names (and &#8220;brands&#8221;) are invented, but now new things</li>
</ul>
<p><strong>In Engineering &#8230;</strong></p>
<ul>
<li>machines rules the world</li>
<li>appearance does not matter, nerds and geeks are common</li>
<li>suppressing emotions and precise execution of instructions is important</li>
<li>technical knowledge is required</li>
<li>construction and instruction of machines is necessary</li>
<li>everything is based on correctness, truth, honesty</li>
<li>things are invented, but not new names</li>
</ul>
<br />Filed under: <a href='http://4loc.wordpress.com/category/general/'>general</a>, <a href='http://4loc.wordpress.com/category/principles/'>principles</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1265&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/09/09/marketing-vs-engineering/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>RSpec vs. Test::Unit</title>
		<link>http://4loc.wordpress.com/2011/09/02/rspec-vs-testunit/</link>
		<comments>http://4loc.wordpress.com/2011/09/02/rspec-vs-testunit/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 20:23:36 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[RSpec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1255</guid>
		<description><![CDATA[Many developers are convinced that their language, tool or library is the best. They think that C is better than Pascal, Python is better Ruby, and Git is much better than SVN. Among the editors, some prefer VIM over Emacs, while others only like Textmate or JEdit. The preference for certain languages, tools and frameworks [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1255&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many developers are convinced that their language, tool or library is the best. They think that C is better than Pascal, Python is better Ruby, and Git is much better than SVN. Among the editors, some prefer VIM over Emacs, while others only like Textmate or JEdit. The preference for certain languages, tools and frameworks can be very subjective, some like this tool, some like that, while others prefer something completely different. Often you like the tool you are used to, because you know how to use it well. Luckily we have the choice between various tools and frameworks, which are often equally powerful. Python is very similar to Ruby, and VIM is just as uncomfortable (or powerful) as Emacs. <strong>RSpec</strong> and the classic <strong>Test::Unit</strong> are another good example, both are equally powerful and more or less isomorphic, i.e. similar in form, function and relations.</p>
<table>
<tr>
<td></td>
<td><strong>Test::Unit</strong></td>
<td><strong>RSpec</strong></td>
</tr>
<tr>
<td>Existence</td>
<td>assert assigns(:object)</td>
<td>assigns(:object).should be <br />assigns(:object).should_not == nil</td>
</tr>
<tr>
<td>Matching</td>
<td>assert_match object</td>
<td>object.should match(expected)</td>
</tr>
<tr>
<td>Equality</td>
<td>assert_equal object.text,text</td>
<td>object.text.should eq(text)</td>
</tr>
<tr>
<td>Validity</td>
<td>assert object.valid?<br />assert !object.valid?</td>
<td>object.should be_valid<br />object.should_not be_valid</td>
</tr>
<tr>
<td>Collections</td>
<td>assert collection.include?(object) <br />assert !collection.include?(object)<br />assert_equal collection.count, count</td>
<td>collection.should include(object) <br />collection.should_not include(object)<br />collection.should have(count).items</td>
</tr>
<tr>
<td>HTTP Response</td>
<td>assert_response :success<br />assert_response :redirect</td>
<td>response.should be_success<br />response.should be_redirect</td>
</tr>
<tr>
<td>Redirect</td>
<td>assert_redirected_to posts_url</td>
<td>response.should redirect_to(posts_url)</td>
</tr>
<tr>
<td>Templates</td>
<td>assert_template &#8220;posts/index&#8221;</td>
<td>response.should render_template(&#8220;posts/index&#8221;)</td>
</tr>
<tr>
<td>Selectors</td>
<td>assert_select &#8220;h1&#8243;, :text =&gt; /Headline/<br />assert_select &#8220;div[id=main]&#8220;</td>
<td>response.should have_selector(&#8220;h1&#8243;, /Headline/)<br />response.should have_tag(&#8216;div#main&#8217;)</td>
</tr>
</table>
<p><em>(The have_tag or have_selector methods are not part of RSpec and are defined in Webrat and/or Capybara.)</em></p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/rubyonrails/'>rubyonrails</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1255/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1255/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1255/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1255&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/09/02/rspec-vs-testunit/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>Command Line Tips and Tricks for Linux</title>
		<link>http://4loc.wordpress.com/2011/09/02/command-line-tips-and-tricks-for-linux/</link>
		<comments>http://4loc.wordpress.com/2011/09/02/command-line-tips-and-tricks-for-linux/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 19:49:46 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1246</guid>
		<description><![CDATA[Here are some useful command line tips and tricks for Linux/Unix systems. Indispensable are commands to find certain processes or files which match a specific name or keyword: If you want to inspect log files, the following commands are useful. The grep command is useful to get all log file entries for a certain expression [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1246&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are some useful command line tips and tricks for Linux/Unix systems. Indispensable are commands to find certain processes or files which match a specific name or keyword:</p>
<p><pre class="brush: bash;">
$ ps ax | grep &quot;tomcat&quot;    # returns all instances of tomcat runnning on your system
$ find . -name *xml        # find all XML files in the current directory
$ grep -r keyword *        # find all Files which match a certain keyword recursively
</pre></p>
<p>If you want to inspect log files, the following commands are useful. The grep command is useful to get all log file entries for a certain expression with a short description (-Ax means list x lines after the match) e.g. to list all logins, all registrations, or all exceptions of a certain kind</p>
<p><pre class="brush: bash;">
$ tail -f error.log        # view live access to log file
$ grep -A1 keyword *.log   # find all lines around the match for a certain keyword, 
                           # i.e. all logins for the keyword=&quot;SessionsController#create&quot;
</pre></p>
<p>Various commands are available to add and count line numbers..</p>
<p><pre class="brush: bash;">
$ ls | nl                  # Numerates files in a directory 
$ ls | wc -l               # Count the number of files in a directory 
$ cat README | wc -l       # Count the number of lines in a file
$ nl -ba README            # Show file content with line numbers
</pre></p>
<p>Some essential file system operations:</p>
<p><pre class="brush: bash;">
$ ls -lsrt                            # file list sorted by (reverse) timestamp.
$ scp file.txt username@server:~      # copy file from local machine to remote server
$ scp username@server:~/file.txt .    # copy file from remote server to local machine
</pre></p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1246/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1246/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1246/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1246&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/09/02/command-line-tips-and-tricks-for-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>
	</item>
		<item>
		<title>Copy database from a remote host</title>
		<link>http://4loc.wordpress.com/2011/09/02/copy-database-from-a-remote-host/</link>
		<comments>http://4loc.wordpress.com/2011/09/02/copy-database-from-a-remote-host/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 19:24:02 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1239</guid>
		<description><![CDATA[Sometimes you need to copy a database from a live or staging system to a local host. For a small MySQL database, you can use the following lines: Filed under: development, software<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1239&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to copy a database from a live or staging system to a local host. For a small MySQL database, you can use the following lines:</p>
<p><pre class="brush: bash;">
$ ssh user@hostname
user@hostname:~$ mysqldump -u db_user -p dbname_production &gt; db_backup
user@hostname:~$ exit
$ scp user@hostname:~/db_backup .
$ mysql -u db_user -p dbname_production &lt; db_backup
</pre></p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1239&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/09/02/copy-database-from-a-remote-host/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>Google+ is cool</title>
		<link>http://4loc.wordpress.com/2011/07/09/google-is-cool/</link>
		<comments>http://4loc.wordpress.com/2011/07/09/google-is-cool/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 08:19:08 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1225</guid>
		<description><![CDATA[I got a Google+ account this week (which can be found here) and I must say I like it. It&#8217;s cool. It&#8217;s fun. I like Google+ because I like Google and dislike Facebook. I dislike Facebook violently. Unlike Google, which has a developer friendly culture, Facebook tortures developers. It tortures the own developers, who are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1225&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="https://plus.google.com"><img class="alignleft size-medium wp-image-1226" title="Google+_logo" src="http://4loc.files.wordpress.com/2011/07/google_logo.png?w=180&#038;h=54" alt="" width="180" height="54" /></a>I got a Google+ account this week (which can be found <a href="https://plus.google.com/104191362647183926227">here</a>) and I must say I like it. It&#8217;s cool. It&#8217;s fun. I like Google+ because I like Google and dislike Facebook. I dislike Facebook violently. Unlike Google, which has a developer friendly culture, Facebook tortures developers. It tortures the own developers, who are tormented by an everchanging code which is a mess on epic scale, and the developers who have to write apps for a constantly chaning API. <a href="http://4loc.wordpress.com/2010/01/10/facebook-is-evil/">Facebook is evil</a>.</p>
<p>Google has noticed what Facebook overlooked. You probably have multiple circles of friends, and these friends belong to different areas: family, job, hobby, sports, etc. People are members in multiple groups, for example you are a member of your family, you might be an employee in a company, but also in other groups, like the Stanford Alumni Association or the parrot breeder group of Valley Springs in South Dakota, for example. Google+ gives users an easy way to organize their social contacts into different &#8220;circles&#8221; — friends, relatives, colleagues, etc. — with which they can share things: thoughts, links, photos, etc.</p>
<p>In Facebook, users receive information by everyone by default, and they broadcast their information to everyone by default. Facebook allows you only to have one circle of friends and one single identity, your physical identity characterized by your real name and your real photo. Since the identity forms the core of a person, it reduces you to one circle, to your mere physical appearance. At its core, Facebook is a dating site for immature teens. If you are not good looking or if you have no friends, then Facebook classifies you as a loser. It denies you to be what you want to be, but the declaration of independence says: &#8220;all Men are created equal, they are endowed [..] with certain unalienable Rights, among these are Life, Liberty and the pursuit of Happiness.&#8221; It does not mention the right to have a Facebook profile.</p>
<p>Google+ is much better in every aspect. Right now it is the cutting edge of social networks. It makes Facebook look arrogant and awkward. Google shows how you can do it right. It produces great services and products because it has some of the best software developers of the world. And most of all, it shows that you can make money without being evil. Good work Google!</p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1225&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/07/09/google-is-cool/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/2011/07/google_logo.png?w=300" medium="image">
			<media:title type="html">Google+_logo</media:title>
		</media:content>
	</item>
		<item>
		<title>CKEditor and Rails</title>
		<link>http://4loc.wordpress.com/2011/06/29/ckeditor-and-rails/</link>
		<comments>http://4loc.wordpress.com/2011/06/29/ckeditor-and-rails/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 19:48:35 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1213</guid>
		<description><![CDATA[CKEditor, the successor of FCKeditor, is one of the most used WYSIWYG text editors, besides the WMD editor which is for instance used in an updated version at Stackoverflow. Integrating the CKEditor in Ruby on Rails is simple. It only requires a few lines of code. There are a number of Rails plugins, but you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1213&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://ckeditor.com/">CKEditor</a>, the successor of FCKeditor, is one of the most used WYSIWYG text editors, besides the <a href="http://code.google.com/p/wmd/">WMD editor</a> which is for instance used in an <a href="http://blog.stackoverflow.com/2009/01/wmd-editor-reverse-engineered/">updated version at Stackoverflow</a>. Integrating the CKEditor in Ruby on Rails <a href="http://ferric.net/articles/2009/09/07/ckeditor-3-0-and-rails/">is simple</a>. It only requires a few lines of code. There are a number of Rails plugins, but you don&#8217;t really need them. Download the <a href="http://ckeditor.com/download">CKEditor Zip file</a>, extract the files and place them in the sub directory &#8220;javascripts/ckeditor&#8221;, add the main JS file to the layout..</p>
<p><pre class="brush: ruby;">
javascript_include_tag 'ckeditor/ckeditor.js'
</pre></p>
<p>..and write a bit JavaScript code which replaces textareas by CKEditor instances:</p>
<p><pre class="brush: jscript;">

  $(document).ready(function() {
     if ($('textarea').length &gt; 0) {       
       var data = $('textarea');
       $.each(data, function(i) {
         CKEDITOR.replace(data[i].id);
       });     
     }  
  });
</pre></p>
<p>That&#8217;s all! Quite simple, isn&#8217;t it?</p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/javascript/'>javascript</a>, <a href='http://4loc.wordpress.com/category/ruby/'>ruby</a>, <a href='http://4loc.wordpress.com/category/rubyonrails/'>rubyonrails</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1213&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/06/29/ckeditor-and-rails/feed/</wfw:commentRss>
		<slash:comments>2</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>Uploading Images with CKEditor and Paperclip</title>
		<link>http://4loc.wordpress.com/2011/06/29/uploading-images-with-ckeditor-and-paperclip/</link>
		<comments>http://4loc.wordpress.com/2011/06/29/uploading-images-with-ckeditor-and-paperclip/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 19:20:17 +0000</pubDate>
		<dc:creator>0x4a6f4672</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rubyonrails]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[paperclip]]></category>

		<guid isPermaLink="false">http://4loc.wordpress.com/?p=1190</guid>
		<description><![CDATA[Let us say you want to use the Paperclip plugin to process images, and WYSIWYG editor like CKEditor to enter rich text. How do you integrate both, CKEditor and Paperclip? You will need to write a custom file uploader and custom file browser, and connect them to the editor by specifying urls and callback functions. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1190&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Let us say you want to use the <a href="http://github.com/thoughtbot/paperclip">Paperclip plugin</a> to process images, and WYSIWYG editor like <a href="http://ckeditor.com/">CKEditor</a> to enter rich text. How do you integrate both, CKEditor and Paperclip? You will need to write a custom file uploader and custom file browser, and connect them to the editor by specifying urls and <a href="http://zerokspot.com/weblog/2009/09/09/custom-filebrowser-callbacks-ckeditor/">callback functions</a>.</p>
<p>Well, first you need to install them. Installing Paperclip in your app is simple, just add the gem or plugin and follow the README. <a href="//ferric.net/articles/2009/09/07/ckeditor-3-0-and-rails/">Adding a CKEditor to your Rails app</a> without a plugin is easy, too: download it, place all the files of the Zip file in the javascripts/ckeditor sub directory, and write a bit JavaScript code which replaces textareas by CKEditor instances. Connecting CKeditor (at the frontend) to Paperclip (at the backend) is a bit tricky. There are several possibilities:</p>
<ol>
<li> You can upload the image files traditionally with file upload fields, and paste the links in the CKEditor yourself, manually</li>
<li> You can upload the image files traditionally with file upload fields and offer only a <strong>custom filebrowser url</strong> for the CKEditor. Then the CKEditor only needs to paste a link to an existing image. </li>
<li> The CKEditor starts the upload. You can offer a <strong>custom fileupload url</strong> for CKEditor, if you have defined a special function to handle the upload. You can configure CKEditor so that it sends the image file to your application. Your app must store it and give an URL back. CKEditor then uses this URL to paste a link in the text. </li>
</ol>
<p>The connection between CKEditor and your app are two urls, a <strong>custom fileupload url</strong> (POST) and a <strong>custom filebrowser URL</strong> (GET). The first is used to upload an image, the second to browse already available images. These custom browser/uploader urls must be registered at the CKEditor when you instantiate it. You can pass the right URLs by specifying options for the editor, for instance by calling <a href="http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replace">CKEDITOR.replace(elementOrIdOrName, config)</a> with appropriate configuration options that specify the urls. An example would be<br />
<pre class="brush: jscript;">
load_ckeditor({filebrowserUploadUrl:UploadUrl,filebrowserBrowseUrl:BrowseUrl});
</pre></p>
<p>if <code>load_ckeditor</code> is the Javascript functions which replaces the elements with a CKEditor instance:</p>
<p><pre class="brush: jscript;">
   function load_ckeditor(options){
     if ($('textarea').length &gt; 0)
     {       
       var data = $('textarea');
       $.each(data, function(i)
       {
         CKEDITOR.replace(data[i].id,options);
       }
       );     
     }
    }      
</pre></p>
<p>If you have a <code>class Image &lt; ActiveRecord::Base</code> which uses Paperclip and <code>has_attached_file :data</code>, a suitable controller action for a fileupload url would be</p>
<p><pre class="brush: ruby;">
      def upload_image
        @func_num = params[&quot;CKEditorFuncNum&quot;]
        @ck_editor = params[&quot;CKEditor&quot;]
        if params.include?(:upload)
          data = params.delete(:upload)
          @image = Image.create({:data =&gt; data}) if data.present?
        end
        render :layout =&gt; false
      end
</pre></p>
<p>Your action will receive a parameter CKEditorFuncName which specifies the callback function of the CKEditor.<br />
The corresponding HAML page `upload_image.html.haml` displays the image and calls the CKEditor callback function specified by the parameter: </p>
<p><pre class="brush: ruby;">
    - if @image
      = image_tag @image.data.url
      :javascript
        CKEditorFuncNum = #{@func_num};
        function SetUrl( fileUrl )
        {
          window.parent.CKEDITOR.tools.callFunction(CKEditorFuncNum, fileUrl);
        }
        SetUrl(&quot;#{ @image.data.url }&quot;);
</pre></p>
<p>The code for the custom file browser is similar, you only have to display multiple images and call window.opener.CKEDITOR.. instead of window.parent.CKEDITOR.. if an image is selected.</p>
<br />Filed under: <a href='http://4loc.wordpress.com/category/development/'>development</a>, <a href='http://4loc.wordpress.com/category/javascript/'>javascript</a>, <a href='http://4loc.wordpress.com/category/rubyonrails/'>rubyonrails</a>, <a href='http://4loc.wordpress.com/category/software/'>software</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/4loc.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/4loc.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/4loc.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/4loc.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/4loc.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/4loc.wordpress.com/1190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/4loc.wordpress.com/1190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/4loc.wordpress.com/1190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=4loc.wordpress.com&amp;blog=4732228&amp;post=1190&amp;subd=4loc&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://4loc.wordpress.com/2011/06/29/uploading-images-with-ckeditor-and-paperclip/feed/</wfw:commentRss>
		<slash:comments>3</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>
	</channel>
</rss>
